Last active
December 12, 2020 06:25
-
-
Save thejhh/fbd28efbff84d0d27721879ae7139f41 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Copyright (c) 2020 Sendanor. All rights reserved. | |
export interface JsonSerializable { | |
toJSON () : JsonAny; | |
} | |
export type JsonAny = string | number | boolean | null | JsonArray | JsonObject | JsonSerializable; | |
export type JsonObjectOf<T extends JsonAny> = { [name: string]: T | undefined }; | |
export type JsonObject = { [name: string]: JsonAny | undefined }; | |
export type JsonArrayOf<T extends JsonAny> = Array<T>; | |
export type JsonArray = Array<JsonAny>; | |
export type ReadonlyJsonAny = string | number | boolean | null | ReadonlyJsonArray | ReadonlyJsonObject; | |
export type ReadonlyJsonObjectOf<T extends ReadonlyJsonAny> = { readonly [name: string]: T | undefined }; | |
export type ReadonlyJsonObject = { readonly [name: string]: ReadonlyJsonAny | undefined }; | |
export type ReadonlyJsonArrayOf<T extends ReadonlyJsonAny> = ReadonlyArray<T>; | |
export type ReadonlyJsonArray = ReadonlyArray<ReadonlyJsonAny>; | |
export default JsonAny; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment