Skip to content

Instantly share code, notes, and snippets.

@abinavseelan
Last active October 31, 2020 20:15
Show Gist options
  • Save abinavseelan/b8c9fa5b7b52bd5b4e355e45d8627401 to your computer and use it in GitHub Desktop.
Save abinavseelan/b8c9fa5b7b52bd5b4e355e45d8627401 to your computer and use it in GitHub Desktop.
Typescript type for JSON data
type PrimitiveValue = string | null | number | boolean;
interface JSONValue {
[k: string]: PrimitiveValue | JSONValue | Array<PrimitiveValue> | Array<JSONValue>;
}
type JSONData = PrimitiveValue | JSONValue | Array<PrimitiveValue> | Array<JSONValue>;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment