Sha256: 4a15fc59b27b65b9894952048be2afc561865ec37606cd0f5e929ee4a102233b

Contents?: true

Size: 1.35 KB

Versions: 25

Compression:

Stored size: 1.35 KB

Contents

/**
Matches a [`class`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes).

@category Class
*/
export type Class<T, Arguments extends unknown[] = any[]> = Constructor<T, Arguments> & {prototype: T};

/**
Matches a [`class` constructor](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes).

@category Class
*/
export type Constructor<T, Arguments extends unknown[] = 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 JSON
*/
export type JsonObject = {[Key in string]?: JsonValue};

/**
Matches a JSON array.

@category JSON
*/
export type JsonArray = JsonValue[];

/**
Matches any valid JSON primitive value.

@category JSON
*/
export type JsonPrimitive = string | number | boolean | null;

/**
Matches any valid JSON value.

@see `Jsonify` if you need to transform a type to one that is assignable to `JsonValue`.

@category JSON
*/
export type JsonValue = JsonPrimitive | JsonObject | JsonArray;

Version data entries

25 entries across 25 versions & 1 rubygems

Version Path
immosquare-cleaner-0.1.52 node_modules/type-fest/source/basic.d.ts
immosquare-cleaner-0.1.51 node_modules/type-fest/source/basic.d.ts
immosquare-cleaner-0.1.50 node_modules/type-fest/source/basic.d.ts
immosquare-cleaner-0.1.49 node_modules/type-fest/source/basic.d.ts
immosquare-cleaner-0.1.48 node_modules/type-fest/source/basic.d.ts
immosquare-cleaner-0.1.47 node_modules/type-fest/source/basic.d.ts
immosquare-cleaner-0.1.46 node_modules/type-fest/source/basic.d.ts
immosquare-cleaner-0.1.45 node_modules/type-fest/source/basic.d.ts
immosquare-cleaner-0.1.44 node_modules/type-fest/source/basic.d.ts
immosquare-cleaner-0.1.43 node_modules/type-fest/source/basic.d.ts
immosquare-cleaner-0.1.42 node_modules/type-fest/source/basic.d.ts
immosquare-cleaner-0.1.41 node_modules/type-fest/source/basic.d.ts
immosquare-cleaner-0.1.40 node_modules/type-fest/source/basic.d.ts
immosquare-cleaner-0.1.39 node_modules/type-fest/source/basic.d.ts
immosquare-cleaner-0.1.38 node_modules/type-fest/source/basic.d.ts
immosquare-cleaner-0.1.32 node_modules/boxen/node_modules/type-fest/source/basic.d.ts
immosquare-cleaner-0.1.31 node_modules/boxen/node_modules/type-fest/source/basic.d.ts
immosquare-cleaner-0.1.30 node_modules/boxen/node_modules/type-fest/source/basic.d.ts
immosquare-cleaner-0.1.29 node_modules/boxen/node_modules/type-fest/source/basic.d.ts
immosquare-cleaner-0.1.28 node_modules/boxen/node_modules/type-fest/source/basic.d.ts