Skip to content

Instantly share code, notes, and snippets.

@TiagoFuelber
Created October 10, 2022 19:15
Show Gist options
  • Save TiagoFuelber/65ddf3e0476601280ea060c798a69eee to your computer and use it in GitHub Desktop.
Save TiagoFuelber/65ddf3e0476601280ea060c798a69eee to your computer and use it in GitHub Desktop.
JSON type
type Primitive = string | number | boolean | null
type JSONObject = { [k: string]: JSONValue }
type JSONArray = JSONValue[]
type JSONValue = Primitive | JSONArray | JSONObject
@TiagoFuelber
Copy link
Author

How to create a type for a JSON variable

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment