/** * @license * Copyright Larry Diamond 2018 All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://github.com/larrydiamond/typescriptcollectionsframework/blob/master/LICENSE */ import { Collectable } from "./Collectable"; import { Comparator } from "./Comparator"; import { Hashable } from "./Hashable"; import { ImmutableCollection } from "./ImmutableCollection"; import { ImmutableList } from "./ImmutableList"; import { ImmutableMap } from "./ImmutableMap"; import { ImmutableMultiSet } from "./ImmutableMultiSet"; import { ImmutableSet } from "./ImmutableSet"; import { MapEntry } from "../src/MapEntry"; /** * This class consists exclusively of static methods that operate on or return collections. * * It contains polymorphic algorithms that operate on collections, "wrappers", which return a new collection backed by a specified collection, and a few other odds and ends. */ export declare class Collections { /** * Returns a Comparator that works correctly for string native objects */ static getStringComparator(): Comparator; /** * Returns a Comparator that works correctly for number native objects */ static getNumberComparator(): Comparator; /** * Returns a hash code good for string objects */ static getHashCodeForString(o: string): number; /** * Returns a hash code good for Collections for objects */ static getHashCodeForStrings(o: ImmutableCollection): number; /** * Returns a hash code good for number objects */ static getHashCodeForNumber(o: number): number; /** * Returns an ImmutableList of the entries passed in, using an AllFieldCollectable as the Collectable */ static list(...values: T[]): ImmutableList; static emptyList(): ImmutableList; static emptySet(): ImmutableSet; static emptyMultiSet(): ImmutableMultiSet; static emptyMap(): ImmutableMap; /** * Returns an Collectable made from the Comparator passed in */ static collectableFromComparator(iComp: Comparator): Collectable; /** * This method creates a Collectable for a class and prevents you from having to copy and paste and then test and debug all the boilerplate code */ static dynamicCollectable(...values: string[]): Collectable; /** * This method creates a Hashable for a class and prevents you from having to copy and paste and then test and debug all the boilerplate code */ static dynamicHashable(...values: string[]): Hashable; /** * This method creates a Comparator for a class and prevents you from having to copy and paste and then test and debug all the boilerplate code */ static dynamicComparator(...values: string[]): Comparator; private static booleanCompare; private static numberCompare; private static stringCompare; /** * Returns an Array of the elements of this Immutable Collection */ static asArray(icoll: ImmutableCollection): Array; /** * Returns an Array of the elements of this Immutable Map */ static asArrayMap(imap: ImmutableMap): Array>; static containsValue(map: ImmutableMap, value: V): boolean; }