Skip to content

Instantly share code, notes, and snippets.

@cenkce
Last active February 23, 2020 08:44
Show Gist options
  • Save cenkce/96fe3c6f77287b96b24477415a0c056e to your computer and use it in GitHub Desktop.
Save cenkce/96fe3c6f77287b96b24477415a0c056e to your computer and use it in GitHub Desktop.
Tuple Operators Examples
// ... import types
type ComponentProps: {
EnvironmentVariable: TestListToUnion // [] | ["key1", "union type 1" | "union type 2" | "union type 3"] | ["key2", string] | ["key3", number] ...
EnvironmentVariables: TestListToTypeAlias // {key4: "type of string";} & {key3: number;} ...
SelectedEnvironmentVariableKey: TestKeys // "key1" | "key2" | "key3" | "key4" | undefined
...
}
function Component(props: ComponentProps) {
...
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment