/** * @file Safe references to `Map`, `Set`, `WeakMap`, `WeakSet`, and `WeakRef`. * Constructors plus uncurried prototype methods. `WeakRef` exposes only its * constructor — there's a separate `weakRefSafe` wrapper in `./uncurry` for * the throws-on-non-Object case. */ declare global { interface Map { getOrInsert(key: K, value: V): V; getOrInsertComputed(key: K, callbackfn: (key: K) => V): V; } interface WeakMap { getOrInsert(key: K, value: V): V; getOrInsertComputed(key: K, callbackfn: (key: K) => V): V; } interface ReadonlySetLike { has(value: T): boolean; keys(): IterableIterator; readonly size: number; } interface Set { difference(other: ReadonlySetLike): Set; intersection(other: ReadonlySetLike): Set; isDisjointFrom(other: ReadonlySetLike): boolean; isSubsetOf(other: ReadonlySetLike): boolean; isSupersetOf(other: ReadonlySetLike): boolean; symmetricDifference(other: ReadonlySetLike): Set; union(other: ReadonlySetLike): Set; } } export declare const MapCtor: MapConstructor; export declare const SetCtor: SetConstructor; export declare const WeakMapCtor: WeakMapConstructor; export declare const WeakRefCtor: WeakRefConstructor; export declare const WeakSetCtor: WeakSetConstructor; export declare const MapPrototypeClear: (self: unknown) => void; export declare const MapPrototypeDelete: (self: unknown, key: any) => boolean; export declare const MapPrototypeEntries: (self: unknown) => MapIterator<[any, any]>; export declare const MapPrototypeForEach: (self: unknown, callbackfn: (value: any, key: any, map: Map) => void, thisArg?: any) => void; export declare const MapPrototypeGet: (self: unknown, key: any) => any; export declare const MapPrototypeGetOrInsert: ((self: unknown, key: any, value: any) => any) | typeof mapGetOrInsertFallback; export declare const MapPrototypeGetOrInsertComputed: ((self: unknown, key: any, callbackfn: (key: any) => any) => any) | typeof mapGetOrInsertComputedFallback; export declare const MapPrototypeHas: (self: unknown, key: any) => boolean; export declare const MapPrototypeKeys: (self: unknown) => MapIterator; export declare const MapPrototypeSet: (self: unknown, key: any, value: any) => Map; export declare const MapPrototypeValues: (self: unknown) => MapIterator; export declare const SetPrototypeAdd: (self: unknown, value: any) => Set; export declare const SetPrototypeClear: (self: unknown) => void; export declare const SetPrototypeDelete: (self: unknown, value: any) => boolean; export declare const SetPrototypeDifference: (self: unknown, other: ReadonlySetLike) => Set; export declare const SetPrototypeEntries: (self: unknown) => SetIterator<[any, any]>; export declare const SetPrototypeForEach: (self: unknown, callbackfn: (value: any, value2: any, set: Set) => void, thisArg?: any) => void; export declare const SetPrototypeHas: (self: unknown, value: any) => boolean; export declare const SetPrototypeIntersection: (self: unknown, other: ReadonlySetLike) => Set; export declare const SetPrototypeIsDisjointFrom: (self: unknown, other: ReadonlySetLike) => boolean; export declare const SetPrototypeIsSubsetOf: (self: unknown, other: ReadonlySetLike) => boolean; export declare const SetPrototypeIsSupersetOf: (self: unknown, other: ReadonlySetLike) => boolean; export declare const SetPrototypeKeys: (self: unknown) => SetIterator; export declare const SetPrototypeSymmetricDifference: (self: unknown, other: ReadonlySetLike) => Set; export declare const SetPrototypeUnion: (self: unknown, other: ReadonlySetLike) => Set; export declare const SetPrototypeValues: (self: unknown) => SetIterator; export declare const SetPrototypeSizeGetter: (self: unknown) => any; export declare const WeakMapPrototypeDelete: (self: unknown, key: WeakKey) => boolean; export declare const WeakMapPrototypeGet: (self: unknown, key: WeakKey) => any; export declare const WeakMapPrototypeGetOrInsert: ((self: unknown, key: WeakKey, value: any) => any) | typeof weakMapGetOrInsertFallback; export declare const WeakMapPrototypeGetOrInsertComputed: ((self: unknown, key: WeakKey, callbackfn: (key: WeakKey) => any) => any) | typeof weakMapGetOrInsertComputedFallback; export declare const WeakMapPrototypeHas: (self: unknown, key: WeakKey) => boolean; export declare const WeakMapPrototypeSet: (self: unknown, key: WeakKey, value: any) => WeakMap; export declare const WeakSetPrototypeAdd: (self: unknown, value: WeakKey) => WeakSet; export declare const WeakSetPrototypeDelete: (self: unknown, value: WeakKey) => boolean; export declare const WeakSetPrototypeHas: (self: unknown, value: WeakKey) => boolean; export declare function mapGetOrInsertComputedFallback(map: Map, key: K, callbackfn: (key: K) => V): V; export declare function mapGetOrInsertFallback(map: Map, key: K, value: V): V; export declare function weakMapGetOrInsertComputedFallback(map: WeakMap, key: K, callbackfn: (key: K) => V): V; export declare function weakMapGetOrInsertFallback(map: WeakMap, key: K, value: V): V;