Skip to content

Instantly share code, notes, and snippets.

@Soul-Master
Created February 3, 2022 08:46
Show Gist options
  • Save Soul-Master/944f9e62c721ba26500ecd3d41d801b6 to your computer and use it in GitHub Desktop.
Save Soul-Master/944f9e62c721ba26500ecd3d41d801b6 to your computer and use it in GitHub Desktop.
JSON Type Definition
type JSONPrimitive<T> = number | boolean | string | null | T;
type JSONValue<T> = JSONPrimitive<T> | JSONArray<T> | JSONObject<T>;
type JSONObject<T> = { [k: string]: JSONValue<T>; };
interface JSONArray<T> extends Array<JSONValue<T>> {
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment