interface Tuple0 extends Tuple { readonly length: 0; } /** Singleton */ /** Singleton */ interface Tuple1 extends Tuple { readonly 0: A; readonly length: 1; } /** Pair */ /** Pair */ interface Tuple2 extends Tuple { readonly 0: A; readonly 1: B; readonly length: 2; } /** Triple */ /** Triple */ interface Tuple3 extends Tuple { readonly 0: A; readonly 1: B; readonly 2: C; readonly length: 3; } /** Quadruple */ /** Quadruple */ interface Tuple4 extends Tuple { readonly 0: A; readonly 1: B; readonly 2: C; readonly 3: D; readonly length: 4; } /** Quintuple */ /** Quintuple */ interface Tuple5 extends Tuple { readonly 0: A; readonly 1: B; readonly 2: C; readonly 3: D; readonly 4: E; readonly length: 5; } /** Sextuple */ /** Sextuple */ interface Tuple6 extends Tuple { readonly 0: A; readonly 1: B; readonly 2: C; readonly 3: D; readonly 4: E; readonly 5: F; readonly length: 6; } /** Septuple */ /** Septuple */ interface Tuple7 extends Tuple { readonly 0: A; readonly 1: B; readonly 2: C; readonly 3: D; readonly 4: E; readonly 5: F; readonly 6: G; readonly length: 7; } /** Octuple */ /** Octuple */ interface Tuple8 extends Tuple { readonly 0: A; readonly 1: B; readonly 2: C; readonly 3: D; readonly 4: E; readonly 5: F; readonly 6: G; readonly 7: H; readonly length: 8; } type CompositeSymbol = { t: T; } & symbol; // tslint:disable-next-line: variable-name // tslint:disable-next-line: variable-name declare const CompositeSymbol0: CompositeSymbol<[never]>; type CompositeSymbol1 = CompositeSymbol<[A]>; type CompositeSymbol2 = CompositeSymbol<[A, B]>; type CompositeSymbol3 = CompositeSymbol<[A, B, C]>; type CompositeSymbol4 = CompositeSymbol<[A, B, C, D]>; type CompositeSymbol5 = CompositeSymbol<[A, B, C, D, E]>; type CompositeSymbol6 = CompositeSymbol<[A, B, C, D, E, F]>; type CompositeSymbol7 = CompositeSymbol<[A, B, C, D, E, F, G]>; type CompositeSymbol8 = CompositeSymbol<[A, B, C, D, E, F, G, H]>; declare const Tuple_base: any; declare class Tuple extends Tuple_base implements ArrayLike, Iterable { [i: number]: A; length: number; /** * @throws {TypeError} Will throw if called non-locally; use the tuple() method instead. */ constructor(iterable: Iterable, confirm: typeof localToken); /** * Constructs a tuple. */ static tuple(a: A, b: B, c: C, d: D, e: E, f: F, g: G, h: H): Tuple8; static tuple(a: A, b: B, c: C, d: D, e: E, f: F, g: G): Tuple7; static tuple(a: A, b: B, c: C, d: D, e: E, f: F): Tuple6; static tuple(a: A, b: B, c: C, d: D, e: E): Tuple5; static tuple(a: A, b: B, c: C, d: D): Tuple4; static tuple(a: A, b: B, c: C): Tuple3; static tuple(a: A, b: B): Tuple2; static tuple(a: A): Tuple1; static tuple(): Tuple0; static symbol(a: A, b: B, c: C, d: D, e: E, f: F, g: G, h: H): CompositeSymbol8; static symbol(a: A, b: B, c: C, d: D, e: E, f: F, g: G): CompositeSymbol7; static symbol(a: A, b: B, c: C, d: D, e: E, f: F): CompositeSymbol6; static symbol(a: A, b: B, c: C, d: D, e: E): CompositeSymbol5; static symbol(a: A, b: B, c: C, d: D): CompositeSymbol4; static symbol(a: A, b: B, c: C): CompositeSymbol3; static symbol(a: A, b: B): CompositeSymbol2; static symbol(a: A): CompositeSymbol1; static symbol(): typeof CompositeSymbol0; // The exported member is cast as the same type as Tuple.tuple() to avoid duplicating the overloads static unsafe(...values: any[]): any; static unsafeSymbol(...values: any[]): any; [Symbol.iterator](): IterableIterator; } // Root cache keys for each tuple type // Root cache keys for each tuple type // Root cache keys for each tuple type // Root cache keys for each tuple type // Root cache keys for each tuple type // Token used to prevent calling the constructor from other modules declare const localToken: unique symbol; declare const tuple: typeof Tuple.tuple, symbol: typeof Tuple.symbol; // Expose constructor to be used for `instanceof` // Expose constructor to be used for `instanceof` // Expose constructor to be used for `instanceof` // Expose constructor to be used for `instanceof` // Expose constructor to be used for `instanceof` /** * Recursively creates a "composite key" (like a "value identity") for * an object's entries (key-value pairs). */ // tslint:disable-next-line: variable-name declare const DeepCompositeSymbol: (object: any, filter?: ((entry: [string, any]) => boolean) | undefined) => any; /** * Works somewhat similarly to Record in the Record & Tuple proposal: * https://github.com/tc39/proposal-record-tuple */ // tslint:disable-next-line: variable-name declare const ValueObject: (object: A, filter?: ((entry: [string, any]) => boolean) | undefined) => A; declare const memoize: (fn: A, cache?: WeakMap) => A; /** * A tuple whose members are allowed to all be primitive, * so it can't be garbage-collected and should only be used * in advanced contexts. */ declare const UnsafeTuple: typeof default.tuple; declare const UnsafeCompositeSymbol: typeof default.tuple; export { symbol as CompositeSymbol, memoize, UnsafeTuple, UnsafeCompositeSymbol, DeepCompositeSymbol, ValueObject, tuple as Tuple, Tuple0, Tuple1, Tuple2, Tuple3, Tuple4, Tuple5, Tuple6, Tuple7, Tuple8, CompositeSymbol as CompositeSymbolType, CompositeSymbol0, CompositeSymbol1, CompositeSymbol2, CompositeSymbol3, CompositeSymbol4, CompositeSymbol5, CompositeSymbol6, CompositeSymbol7, CompositeSymbol8 };