AK-21/Graphite-Industrial-Intelligence
0
1/*! *****************************************************************************2Copyright (c) Microsoft Corporation. All rights reserved.3Licensed under the Apache License, Version 2.0 (the "License"); you may not use4this file except in compliance with the License. You may obtain a copy of the5License at http://www.apache.org/licenses/LICENSE-2.06 7THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY8KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED9WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,10MERCHANTABILITY OR NON-INFRINGEMENT.11 12See the Apache Version 2.0 License for specific language governing permissions13and limitations under the License.14***************************************************************************** */15 16 17interface Map<K, V> {18 /**19 * Removes all elements from the Map.20 */21 clear(): void;22 /**23 * @returns true if an element in the Map existed and has been removed, or false if the element does not exist.24 */25 delete(key: K): boolean;26 /**27 * Executes a provided function once per each key/value pair in the Map, in insertion order.28 */29 forEach(callbackfn: (value: V, key: K, map: Map<K, V>) => void, thisArg?: any): void;30 /**31 * Returns a specified element from the Map object. If the value that is associated to the provided key is an object, then you will get a reference to that object and any change made to that object will effectively modify it inside the Map.32 * @returns Returns the element associated with the specified key. If no element is associated with the specified key, undefined is returned.33 */34 get(key: K): V | undefined;35 /**36 * @returns boolean indicating whether an element with the specified key exists or not.37 */38 has(key: K): boolean;39 /**40 * Adds a new element with a specified key and value to the Map. If an element with the same key already exists, the element will be updated.41 */42 set(key: K, value: V): this;43 /**44 * @returns the number of elements in the Map.45 */46 readonly size: number;47}48 49interface MapConstructor {50 new (): Map<any, any>;51 new <K, V>(entries?: readonly (readonly [K, V])[] | null): Map<K, V>;52 readonly prototype: Map<any, any>;53}54declare var Map: MapConstructor;55 56interface ReadonlyMap<K, V> {57 forEach(callbackfn: (value: V, key: K, map: ReadonlyMap<K, V>) => void, thisArg?: any): void;58 get(key: K): V | undefined;59 has(key: K): boolean;60 readonly size: number;61}62 63interface WeakMap<K extends WeakKey, V> {64 /**65 * Removes the specified element from the WeakMap.66 * @returns true if the element was successfully removed, or false if it was not present.67 */68 delete(key: K): boolean;69 /**70 * @returns a specified element.71 */72 get(key: K): V | undefined;73 /**74 * @returns a boolean indicating whether an element with the specified key exists or not.75 */76 has(key: K): boolean;77 /**78 * Adds a new element with a specified key and value.79 * @param key Must be an object or symbol.80 */81 set(key: K, value: V): this;82}83 84interface WeakMapConstructor {85 new <K extends WeakKey = WeakKey, V = any>(entries?: readonly (readonly [K, V])[] | null): WeakMap<K, V>;86 readonly prototype: WeakMap<WeakKey, any>;87}88declare var WeakMap: WeakMapConstructor;89 90interface Set<T> {91 /**92 * Appends a new element with a specified value to the end of the Set.93 */94 add(value: T): this;95 /**96 * Removes all elements from the Set.97 */98 clear(): void;99 /**100 * Removes a specified value from the Set.101 * @returns Returns true if an element in the Set existed and has been removed, or false if the element does not exist.102 */103 delete(value: T): boolean;104 /**105 * Executes a provided function once per each value in the Set object, in insertion order.106 */107 forEach(callbackfn: (value: T, value2: T, set: Set<T>) => void, thisArg?: any): void;108 /**109 * @returns a boolean indicating whether an element with the specified value exists in the Set or not.110 */111 has(value: T): boolean;112 /**113 * @returns the number of (unique) elements in Set.114 */115 readonly size: number;116}117 118interface SetConstructor {119 new <T = any>(values?: readonly T[] | null): Set<T>;120 readonly prototype: Set<any>;121}122declare var Set: SetConstructor;123 124interface ReadonlySet<T> {125 forEach(callbackfn: (value: T, value2: T, set: ReadonlySet<T>) => void, thisArg?: any): void;126 has(value: T): boolean;127 readonly size: number;128}129 130interface WeakSet<T extends WeakKey> {131 /**132 * Appends a new value to the end of the WeakSet.133 */134 add(value: T): this;135 /**136 * Removes the specified element from the WeakSet.137 * @returns Returns true if the element existed and has been removed, or false if the element does not exist.138 */139 delete(value: T): boolean;140 /**141 * @returns a boolean indicating whether a value exists in the WeakSet or not.142 */143 has(value: T): boolean;144}145 146interface WeakSetConstructor {147 new <T extends WeakKey = WeakKey>(values?: readonly T[] | null): WeakSet<T>;148 readonly prototype: WeakSet<WeakKey>;149}150declare var WeakSet: WeakSetConstructor;151 