/*! * Copyright 2020 Ron Buckton * * 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 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ export declare abstract class BaseCollection { abstract values(): Iterable; /** * Returns `true` if every element in the collection matches the provided callback; otherwise, `false`. */ every(callbackfn: (value: T) => boolean): boolean; /** * Returns `true` if at least one element in the collection matches the provided callback; otherwise, `false`. */ some(callbackfn?: (value: T) => boolean): boolean; /** * Calls the provided callback once for each element in the collection. */ forEach(callbackfn: (value: T) => void): void; /** * Yields the result of calling the provided callback once for each element in the collection. */ map(callbackfn: (value: T) => U): IterableIterator; /** * Yields each element in the collection that matches the provided callback. */ filter(callbackfn: (value: T) => value is S): IterableIterator; /** * Yields each element in the collection that matches the provided callback. */ filter(callbackfn: (value: T) => boolean): IterableIterator; /** * Calls the specified callback function for each elements in the collection. The return value of the callback is the accumulated result, and is provided as an argument in the next call to the callback. */ reduce(callbackfn: (previousValue: U, currentValue: T) => U, initialValue: U): U; /** * Finds the first matching element in the collection. */ find(callbackfn: (value: T) => value is S): S | undefined; /** * Finds the first matching element in the collection. */ find(callbackfn: (value: T) => boolean): T | undefined; }