import { URI } from '../../base/common/uri'; export declare function getOrSet(map: Map, key: K, value: V): V; export declare function mapToString(map: Map): string; export declare function setToString(set: Set): string; interface ResourceMapKeyFn { (resource: URI): string; } export declare class ResourceMap implements Map { private static readonly defaultToKey; readonly [Symbol.toStringTag] = "ResourceMap"; private readonly map; private readonly toKey; /** * * @param toKey Custom uri identity function, e.g use an existing `IExtUri#getComparison`-util */ constructor(toKey?: ResourceMapKeyFn); /** * * @param other Another resource which this maps is created from * @param toKey Custom uri identity function, e.g use an existing `IExtUri#getComparison`-util */ constructor(other?: ResourceMap, toKey?: ResourceMapKeyFn); /** * * @param other Another resource which this maps is created from * @param toKey Custom uri identity function, e.g use an existing `IExtUri#getComparison`-util */ constructor(entries?: readonly (readonly [URI, T])[], toKey?: ResourceMapKeyFn); set(resource: URI, value: T): this; get(resource: URI): T | undefined; has(resource: URI): boolean; get size(): number; clear(): void; delete(resource: URI): boolean; forEach(clb: (value: T, key: URI, map: Map) => void, thisArg?: any): void; values(): IterableIterator; keys(): IterableIterator; entries(): IterableIterator<[URI, T]>; [Symbol.iterator](): IterableIterator<[URI, T]>; } export declare class ResourceSet implements Set { readonly [Symbol.toStringTag]: string; private readonly _map; constructor(toKey?: ResourceMapKeyFn); constructor(entries: readonly URI[], toKey?: ResourceMapKeyFn); get size(): number; add(value: URI): this; clear(): void; delete(value: URI): boolean; forEach(callbackfn: (value: URI, value2: URI, set: Set) => void, thisArg?: any): void; has(value: URI): boolean; entries(): IterableIterator<[URI, URI]>; keys(): IterableIterator; values(): IterableIterator; [Symbol.iterator](): IterableIterator; } export declare const enum Touch { None = 0, AsOld = 1, AsNew = 2 } export declare class LinkedMap implements Map { readonly [Symbol.toStringTag] = "LinkedMap"; private _map; private _head; private _tail; private _size; private _state; constructor(); clear(): void; isEmpty(): boolean; get size(): number; get first(): V | undefined; get last(): V | undefined; has(key: K): boolean; get(key: K, touch?: Touch): V | undefined; set(key: K, value: V, touch?: Touch): this; delete(key: K): boolean; remove(key: K): V | undefined; shift(): V | undefined; forEach(callbackfn: (value: V, key: K, map: LinkedMap) => void, thisArg?: any): void; keys(): IterableIterator; values(): IterableIterator; entries(): IterableIterator<[K, V]>; [Symbol.iterator](): IterableIterator<[K, V]>; protected trimOld(newSize: number): void; private addItemFirst; private addItemLast; private removeItem; private touch; toJSON(): [K, V][]; fromJSON(data: [K, V][]): void; } export declare class LRUCache extends LinkedMap { private _limit; private _ratio; constructor(limit: number, ratio?: number); get limit(): number; set limit(limit: number); get ratio(): number; set ratio(ratio: number); get(key: K, touch?: Touch): V | undefined; peek(key: K): V | undefined; set(key: K, value: V): this; private checkTrim; } export declare class CounterSet { private map; add(value: T): CounterSet; delete(value: T): boolean; has(value: T): boolean; } /** * A map that allows access both by keys and values. * **NOTE**: values need to be unique. */ export declare class BidirectionalMap { private readonly _m1; private readonly _m2; constructor(entries?: readonly (readonly [K, V])[]); clear(): void; set(key: K, value: V): void; get(key: K): V | undefined; getKey(value: V): K | undefined; delete(key: K): boolean; forEach(callbackfn: (value: V, key: K, map: BidirectionalMap) => void, thisArg?: any): void; keys(): IterableIterator; values(): IterableIterator; } export declare class SetMap { private map; add(key: K, value: V): void; delete(key: K, value: V): void; forEach(key: K, fn: (value: V) => void): void; get(key: K): ReadonlySet; } export {};