Sha256: 9bd8219f88db1339a2203f7fa18cf01aeeb60bca80aeda842a9fd9599d84d2eb

Contents?: true

Size: 1.62 KB

Versions: 28

Compression:

Stored size: 1.62 KB

Contents

/// <reference lib="es2020.bigint"/>

// TODO: This can just be `export type Primitive = not object` when the `not` keyword is out.
/**
Matches any [primitive value](https://developer.mozilla.org/en-US/docs/Glossary/Primitive).
*/
export type Primitive =
	| null
	| undefined
	| string
	| number
	| boolean
	| symbol
	| bigint;

// 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).
*/
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 { … }`.
*/
export type JsonObject = {[Key in string]?: JsonValue};

/**
Matches a JSON array.
*/
export interface JsonArray extends Array<JsonValue> {}

/**
Matches any valid JSON value.
*/
export type JsonValue = string | number | boolean | null | JsonObject | JsonArray;

declare global {
	interface SymbolConstructor {
		readonly observable: symbol;
	}
}

/**
Matches a value that is like an [Observable](https://github.com/tc39/proposal-observable).
*/
export interface ObservableLike {
	subscribe(observer: (value: unknown) => void): void;
	[Symbol.observable](): ObservableLike;
}

Version data entries

28 entries across 28 versions & 2 rubygems

Version Path
clapton-0.0.26 lib/clapton/javascripts/node_modules/ansi-escapes/node_modules/type-fest/source/basic.d.ts
clapton-0.0.25 lib/clapton/javascripts/node_modules/ansi-escapes/node_modules/type-fest/source/basic.d.ts
clapton-0.0.24 lib/clapton/javascripts/node_modules/ansi-escapes/node_modules/type-fest/source/basic.d.ts
clapton-0.0.23 lib/clapton/javascripts/node_modules/ansi-escapes/node_modules/type-fest/source/basic.d.ts
clapton-0.0.22 lib/clapton/javascripts/node_modules/ansi-escapes/node_modules/type-fest/source/basic.d.ts
clapton-0.0.21 lib/clapton/javascripts/node_modules/ansi-escapes/node_modules/type-fest/source/basic.d.ts
clapton-0.0.20 lib/clapton/javascripts/node_modules/ansi-escapes/node_modules/type-fest/source/basic.d.ts
clapton-0.0.19 lib/clapton/javascripts/node_modules/ansi-escapes/node_modules/type-fest/source/basic.d.ts
clapton-0.0.18 lib/clapton/javascripts/node_modules/ansi-escapes/node_modules/type-fest/source/basic.d.ts
clapton-0.0.17 lib/clapton/javascripts/node_modules/ansi-escapes/node_modules/type-fest/source/basic.d.ts
clapton-0.0.16 lib/clapton/javascripts/node_modules/ansi-escapes/node_modules/type-fest/source/basic.d.ts
clapton-0.0.15 lib/clapton/javascripts/node_modules/ansi-escapes/node_modules/type-fest/source/basic.d.ts
clapton-0.0.14 lib/clapton/javascripts/node_modules/ansi-escapes/node_modules/type-fest/source/basic.d.ts
clapton-0.0.13 lib/clapton/javascripts/node_modules/ansi-escapes/node_modules/type-fest/source/basic.d.ts
clapton-0.0.12 lib/clapton/javascripts/node_modules/ansi-escapes/node_modules/type-fest/source/basic.d.ts
clapton-0.0.11 lib/clapton/javascripts/node_modules/ansi-escapes/node_modules/type-fest/source/basic.d.ts
clapton-0.0.10 lib/clapton/javascripts/node_modules/ansi-escapes/node_modules/type-fest/source/basic.d.ts
clapton-0.0.9 lib/clapton/javascripts/node_modules/ansi-escapes/node_modules/type-fest/source/basic.d.ts
clapton-0.0.8 lib/clapton/javascripts/node_modules/ansi-escapes/node_modules/type-fest/source/basic.d.ts
clapton-0.0.7 lib/clapton/javascripts/node_modules/ansi-escapes/node_modules/type-fest/source/basic.d.ts