// Type definitions for es6-collections v0.5.1 // Project: https://github.com/WebReflection/es6-collections/ // Definitions by: Ron Buckton // Definitions: https://github.com/borisyankov/DefinitelyTyped /* ***************************************************************************** Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 THIS CODE IS PROVIDED *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, MERCHANTABLITY OR NON-INFRINGEMENT. See the Apache Version 2.0 License for specific language governing permissions and limitations under the License. ***************************************************************************** */ interface IteratorResult { done: boolean; value?: T; } interface Iterator { next(value?: any): IteratorResult; return?(value?: any): IteratorResult; throw?(e?: any): IteratorResult; } interface ForEachable { forEach(callbackfn: (value: T) => void): void; } interface Map { clear(): void; delete(key: K): boolean; forEach(callbackfn: (value: V, index: K, map: Map) => void, thisArg?: any): void; get(key: K): V; has(key: K): boolean; set(key: K, value?: V): Map; entries(): Iterator<[K, V]>; keys(): Iterator; values(): Iterator; size: number; } interface MapConstructor { new (): Map; new (iterable: ForEachable<[K, V]>): Map; prototype: Map; } declare var Map: MapConstructor; interface Set { add(value: T): Set; clear(): void; delete(value: T): boolean; forEach(callbackfn: (value: T, index: T, set: Set) => void, thisArg?: any): void; has(value: T): boolean; entries(): Iterator<[T, T]>; keys(): Iterator; values(): Iterator; size: number; } interface SetConstructor { new (): Set; new (iterable: ForEachable): Set; prototype: Set; } declare var Set: SetConstructor; interface WeakMap { delete(key: K): boolean; clear(): void; get(key: K): V; has(key: K): boolean; set(key: K, value?: V): WeakMap; } interface WeakMapConstructor { new (): WeakMap; new (iterable: ForEachable<[K, V]>): WeakMap; prototype: WeakMap; } declare var WeakMap: WeakMapConstructor; interface WeakSet { delete(value: T): boolean; clear(): void; add(value: T): WeakSet; has(value: T): boolean; } interface WeakSetConstructor { new (): WeakSet; new (iterable: ForEachable): WeakSet; prototype: WeakSet; } declare var WeakSet: WeakSetConstructor; declare module "es6-collections" { var Map: MapConstructor; var Set: SetConstructor; var WeakMap: WeakMapConstructor; var WeakSet: WeakSetConstructor; }