UNPKG

914 BTypeScriptView Raw
1export type Present = {} | void;
2export type Option<T> = T | null;
3export type Maybe<T> = Option<T> | undefined | void;
4export type FIXME<T, S extends string> = T;
5
6export interface Dict<T = unknown> {
7 [key: string]: T;
8}
9
10export type DictValue<D extends Dict> = D extends Dict<infer V> ? V : never;
11
12export interface Unique<T> {
13 'Unique [id=ada0f31f-27f7-4ab0-bc03-0005387c9d5f]': T;
14}
15
16export type Recast<T, U> = (T & U) | U;
17
18/**
19 * This is needed because the normal IteratorResult in the TypeScript
20 * standard library is generic over the value in each tick and not over
21 * the return value. It represents a standard ECMAScript IteratorResult.
22 */
23export type RichIteratorResult<Tick, Return> =
24 | {
25 done: false;
26 value: Tick;
27 }
28 | {
29 done: true;
30 value: Return;
31 };
32
33export type Destroyable = object;
34export type Destructor<T extends Destroyable> = (destroyable: T) => void;