Sha256: b3adea08320fa04c6e67b5a2571f2b1835cbc09d3a1d9f9491e248ddd523ad80

Contents?: true

Size: 1.15 KB

Versions: 33

Compression:

Stored size: 1.15 KB

Contents

// TODO: Remove the `= unknown` sometime  in the future when most users are on TS 3.5 as it's now the default
/**
Matches a [`class` constructor](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes).

@category Basic
*/
export type Class<T = unknown, Arguments extends any[] = any[]> = new(...arguments_: Arguments) => T;

/**
Matches a JSON object.

This type can be useful to enforce some input to be JSON-compatible or as a super-type to be extended from. Don't use this as a direct return type as the user would have to double-cast it: `jsonObject as unknown as CustomResponse`. Instead, you could extend your CustomResponse type from it to ensure your type only uses JSON-compatible types: `interface CustomResponse extends JsonObject { … }`.

@category Basic
*/
export type JsonObject = {[Key in string]?: JsonValue};

/**
Matches a JSON array.

@category Basic
*/
export interface JsonArray extends Array<JsonValue> {}
// TODO: Make it this when targeting TypeScript 4.1:
// export type JsonArray = JsonValue[];

/**
Matches any valid JSON value.

@category Basic
*/
export type JsonValue = string | number | boolean | null | JsonObject | JsonArray;

Version data entries

33 entries across 33 versions & 1 rubygems

Version Path
immosquare-cleaner-0.1.60 node_modules/crypto-random-string/node_modules/type-fest/source/basic.d.ts
immosquare-cleaner-0.1.59 node_modules/crypto-random-string/node_modules/type-fest/source/basic.d.ts
immosquare-cleaner-0.1.58 node_modules/crypto-random-string/node_modules/type-fest/source/basic.d.ts
immosquare-cleaner-0.1.57 node_modules/crypto-random-string/node_modules/type-fest/source/basic.d.ts
immosquare-cleaner-0.1.56 node_modules/crypto-random-string/node_modules/type-fest/source/basic.d.ts
immosquare-cleaner-0.1.55 node_modules/crypto-random-string/node_modules/type-fest/source/basic.d.ts
immosquare-cleaner-0.1.54 node_modules/crypto-random-string/node_modules/type-fest/source/basic.d.ts
immosquare-cleaner-0.1.53 node_modules/crypto-random-string/node_modules/type-fest/source/basic.d.ts
immosquare-cleaner-0.1.52 node_modules/crypto-random-string/node_modules/type-fest/source/basic.d.ts
immosquare-cleaner-0.1.51 node_modules/crypto-random-string/node_modules/type-fest/source/basic.d.ts
immosquare-cleaner-0.1.50 node_modules/crypto-random-string/node_modules/type-fest/source/basic.d.ts
immosquare-cleaner-0.1.49 node_modules/crypto-random-string/node_modules/type-fest/source/basic.d.ts
immosquare-cleaner-0.1.48 node_modules/crypto-random-string/node_modules/type-fest/source/basic.d.ts
immosquare-cleaner-0.1.47 node_modules/crypto-random-string/node_modules/type-fest/source/basic.d.ts
immosquare-cleaner-0.1.46 node_modules/crypto-random-string/node_modules/type-fest/source/basic.d.ts
immosquare-cleaner-0.1.45 node_modules/crypto-random-string/node_modules/type-fest/source/basic.d.ts
immosquare-cleaner-0.1.44 node_modules/crypto-random-string/node_modules/type-fest/source/basic.d.ts
immosquare-cleaner-0.1.43 node_modules/crypto-random-string/node_modules/type-fest/source/basic.d.ts
immosquare-cleaner-0.1.42 node_modules/crypto-random-string/node_modules/type-fest/source/basic.d.ts
immosquare-cleaner-0.1.41 node_modules/crypto-random-string/node_modules/type-fest/source/basic.d.ts