Skip to content

Instantly share code, notes, and snippets.

@xdevmaycry
Last active November 9, 2023 12:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save xdevmaycry/f647a28c4be81c20d9f4bb4d491811fd to your computer and use it in GitHub Desktop.
Save xdevmaycry/f647a28c4be81c20d9f4bb4d491811fd to your computer and use it in GitHub Desktop.
typescripts.md
  1. Define interface for nested object, with [key: string]

    export interface Item {
      id: number;
      size: number;
     }
    
    export interface Example {
      name: string;
      items: {
        [key: string]: Item
      };
    }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment