// Generated by dts-bundle v0.7.3 declare module 'alot' { import { Alot as AlotInner } from 'alot/alot'; import { AlotMeta } from 'alot/AlotMeta'; interface IAlotConstructor { new (array: T[], meta?: AlotMeta): AlotInner; (array: T[], meta?: AlotMeta): AlotInner; default: IAlotConstructor; fromObject: typeof AlotInner.fromObject; fromRange: typeof AlotInner.fromRange; } const alot: IAlotConstructor; export = alot; } declare module 'alot/alot' { import { AlotMeta } from 'alot/AlotMeta'; import { AlotProto } from 'alot/AlotProto'; import { IAlotStream, AlotStreamIterationResult } from 'alot/streams/IAlotStream'; export class Alot extends AlotProto { array: T[]; meta?: AlotMeta; constructor(array: T[], meta?: AlotMeta); static fromObject(obj: { [key: string]: TValue; }): Alot<{ key: string; value: TValue; }>; static fromRange(start: number, endExcluded: number): Alot; } export class ArrayStream implements IAlotStream { array: T[]; isAsync: boolean; constructor(array: T[]); next(): AlotStreamIterationResult; nextAsync(): Promise>; reset(): this; } } declare module 'alot/AlotMeta' { export interface AlotStreamOpts { async?: boolean; } export interface AlotMeta { } export interface AlotMetaAsync extends AlotMeta { threads?: number; errors?: 'include' | 'ignore' | 'reject'; } } declare module 'alot/AlotProto' { import { MethodFilter } from 'alot/Methods'; import { AlotMeta, AlotMetaAsync, AlotStreamOpts } from 'alot/AlotMeta'; import { TAggregateNumeric } from 'alot/utils/Aggregation'; /** Loading all stream from extra exports file to fix circular dependencies */ import { IAlotStream, AlotStreamIterationResult, GroupByKeyFn, GroupByStream, DistinctByKeyFn, DistinctByStream, SkipStream, SkipWhileMethod, SkipWhileStream, SkipWhileMethodAsync, SkipWhileStreamAsync, TakeStream, TakeWhileStream, TakeWhileStreamAsync, TakeWhileMethod, TakeWhileMethodAsync, MapStream, MapManyStream, MethodMap, MethodMapMany, FilterStream, FilterStreamAsync, ForEachStream, ForEachMethod, SortByStream, SortByLocalCompareStream, SortMethod, JoinStream, ConcatStream } from 'alot/streams/exports'; import { ParametersFromSecond } from 'alot/utils/types'; import { type TTakeWhileMethodOpts } from 'alot/streams/TakeStream'; import { type TSkipWhileMethodOpts } from 'alot/streams/SkipStream'; export class AlotProto implements IAlotStream { stream: IAlotStream; isAsync: boolean; constructor(stream: IAlotStream, opts?: AlotStreamOpts); next(): AlotStreamIterationResult; nextAsync(): Promise>; [Symbol.iterator](): this; /** * Resets current stream to the beginning. */ reset(): this; /** * Creates filtered stream. Is Lazy. * ``` * alot(users).filter(x => x.age > 20).take(3).toArray(); * ``` * Filter is evaluated only N times, to match only 3 items. */ filter(fn: MethodFilter): FilterStream; /** * Creates async filted stream. Same as filter, but accepts async methods, and returns awaitable stream. */ filterAsync(fn: MethodFilter): FilterStreamAsync; map(fn: MethodMap): MapStream; mapAsync(fn: MethodMap, meta?: AlotMeta): MapStream; mapMany(fn: MethodMapMany): MapManyStream; mapManyAsync(fn: MethodMapMany): MapManyStream; mapFull(fn: (arr: T[]) => TResult): TResult; mapFullAsync(fn: (arr: T[]) => Promise, opts?: AlotMetaAsync): Promise; forEach(fn: ForEachMethod): ForEachStream; forEachAsync(fn: ForEachMethod): ForEachStream; take(count: number): TakeStream; takeWhile(fn: TakeWhileMethod, opts?: TTakeWhileMethodOpts): TakeWhileStream; takeWhileAsync(fn: TakeWhileMethodAsync, opts?: TTakeWhileMethodOpts): TakeWhileStreamAsync; skip(count: number): SkipStream; skipWhile(fn: SkipWhileMethod, opts?: TSkipWhileMethodOpts): SkipWhileStream; skipWhileAsync(fn: SkipWhileMethodAsync, opts?: TSkipWhileMethodOpts): SkipWhileStreamAsync; groupBy(fn: GroupByKeyFn): GroupByStream; /** Join Left Inner */ join(inner: TInner[], getKey: (x: T) => string | number, getForeignKey: (x: TInner) => string | number, joinFn: (a: T, b: TInner) => TResult): JoinStream; /** Join Full Outer */ joinOuter(inner: TInner[], getKey: (x: T) => string | number, getForeignKey: (x: TInner) => string | number, joinFn: (a?: T, b?: TInner) => TResult): JoinStream; concat(arr: TSourceB[]): ConcatStream; distinctBy(fn: DistinctByKeyFn): DistinctByStream; distinct(): DistinctByStream; sortBy(sortByFn: SortMethod, direction?: 'asc' | 'desc'): SortByStream; sortBy(sortByKey: keyof T | string, direction?: 'asc' | 'desc'): SortByStream; sortByAsync(sortByFn: SortMethod, direction?: 'asc' | 'desc'): SortByStream; sortByAsync(sortByKey: keyof T | string, direction?: 'asc' | 'desc'): SortByStream; sortByLocalCompare(getValFn: (x: T, i: number) => string, direction?: 'asc' | 'desc', ...params: ParametersFromSecond): SortByLocalCompareStream; fork(fn: (stream: this) => void | any): this; toDictionary(keyFn: (x: T) => TKey, valFn?: (x: T) => TValue): { [key: string]: TValue; }; toDictionaryAsync(keyFn: (x: T) => Promise | TKey, valFn?: (x: T) => Promise | TValue): Promise<{ [key: string]: TValue; }>; toMap(keyFn: (x: T) => TKey, valFn?: (x: T) => TValue): Map; toMapAsync(keyFn: (x: T) => Promise | TKey, valFn?: (x: T) => Promise | TValue): Promise>; toArray(): T[]; toArrayAsync(meta?: AlotMetaAsync): PromiseLike; first(matcher?: (x: T, i: number) => boolean): T; firstAsync(matcher?: (x: T, i: number) => (boolean | Promise)): Promise; find(matcher?: (x: T, i: number) => boolean): T; findAsync(matcher?: (x: T, i: number) => (boolean | Promise)): Promise; sum(getVal: (x: T, i: number) => number, initialValue?: number): number; sum(getVal: (x: T, i: number) => bigint, initialValue: bigint): bigint; sumAsync(getVal: (x: T, i: number) => number | Promise, initialValue?: number): Promise; sumBigInt(getVal: (x: T, i: number) => bigint): bigint; sumBigIntAsync(getVal: (x: T, i: number) => bigint | Promise, initialValue?: bigint): Promise; max(fn: (x: T, i: number) => TOut): TOut; maxAsync(fn: (x: T, i: number) => TOut): Promise; maxItem(fn: (x: T, i: number) => TOut): T; maxItemAsync(fn: (x: T, i: number) => TOut): Promise; min(fn: (x: T, i: number) => TOut): TOut; minAsync(fn: (x: T, i: number) => TOut): Promise; minItem(fn: (x: T, i: number) => TOut): T; minItemAsync(fn: (x: T, i: number) => TOut): Promise; } } declare module 'alot/streams/IAlotStream' { export interface IAlotStream { reset(): this; next(): AlotStreamIterationResult; nextAsync(): Promise>; isAsync: boolean; } export interface AlotStreamIterationResult { value: T; done: boolean; index?: number; } } declare module 'alot/Methods' { export type MethodFilter = (x: T, i: number) => boolean | Promise; } declare module 'alot/utils/Aggregation' { import { IAlotStream } from 'alot/streams/IAlotStream'; export type TAggregateNumeric = number | { valueOf: () => number; } | bigint; export namespace Aggregation { function getMinMaxValueBy(stream: IAlotStream, getFn: (x: T, i: number) => TOut, compare: 'min' | 'max'): any; function getMinMaxValueByAsync(stream: IAlotStream, getFn: (x: T, i: number) => TOut | Promise, compare: 'min' | 'max'): Promise; function getMinMaxItemBy(stream: IAlotStream, getFn: (x: T, i: number) => TOut, compare: 'min' | 'max'): any; function getMinMaxItemByAsync(stream: IAlotStream, getFn: (x: T, i: number) => TOut | Promise, compare: 'min' | 'max'): Promise; function sum(stream: IAlotStream, fn: (x: T, i: number) => number, startVal: number): number; function sum(stream: IAlotStream, fn: (x: T, i: number) => bigint, startVal: bigint): bigint; function sumAsync(stream: IAlotStream, fn: (x: T, i: number) => number | Promise, startVal: number): Promise; function sumAsync(stream: IAlotStream, fn: (x: T, i: number) => bigint | Promise, startVal: bigint): Promise; } } declare module 'alot/streams/exports' { export { IAlotStream, AlotStreamIterationResult } from 'alot/streams/IAlotStream'; export { FilterStream, FilterStreamAsync } from 'alot/streams/FilterStream'; export { MapStream, MapManyStream, MethodMap, MethodMapMany } from 'alot/streams/MapStream'; export { TakeStream, TakeWhileStream, TakeWhileStreamAsync, TakeWhileMethod, TakeWhileMethodAsync } from 'alot/streams/TakeStream'; export { SkipStream, SkipWhileMethod, SkipWhileMethodAsync, SkipWhileStream, SkipWhileStreamAsync } from 'alot/streams/SkipStream'; export { GroupByKeyFn, GroupByStream } from 'alot/streams/GroupStream'; export { DistinctByKeyFn, DistinctByStream } from 'alot/streams/DistinctStream'; export { ForEachStream, ForEachMethod } from 'alot/streams/ForEachStream'; export { ForkStreamInner, ForkStreamOuter } from 'alot/streams/ForkStream'; export { SortByStream, SortMethod, SortByLocalCompareStream } from 'alot/streams/SortedStream'; export { JoinStream } from 'alot/streams/JoinStream'; export { ConcatStream } from 'alot/streams/ConcatStream'; } declare module 'alot/utils/types' { export type ParametersFromSecond any> = T extends (x: any, ...args: infer P) => any ? P : never; } declare module 'alot/streams/TakeStream' { import { AlotStreamIterationResult } from 'alot/streams/IAlotStream'; import { IAlotStream } from 'alot/streams/IAlotStream'; import { AlotProto } from "alot/AlotProto"; export class TakeStream extends AlotProto { stream: IAlotStream; _count: number; constructor(stream: IAlotStream, _count: number); next(): AlotStreamIterationResult; reset(): this; } export interface TTakeWhileMethodOpts { includeLast?: boolean; } export type TakeWhileMethod = (x: T, i: number) => boolean; export type TakeWhileMethodAsync = (x: T, i: number) => boolean | Promise; export class TakeWhileStream extends AlotProto { stream: IAlotStream; fn: TakeWhileMethod; opts?: TTakeWhileMethodOpts; constructor(stream: IAlotStream, fn: TakeWhileMethod, opts?: TTakeWhileMethodOpts); next(): { done: boolean; value: any; }; reset(): this; } export class TakeWhileStreamAsync extends AlotProto { stream: IAlotStream; fn: TakeWhileMethodAsync; opts?: TTakeWhileMethodOpts; isAsync: boolean; constructor(stream: IAlotStream, fn: TakeWhileMethodAsync, opts?: TTakeWhileMethodOpts); nextAsync(): Promise<{ done: boolean; value: any; }>; reset(): this; } } declare module 'alot/streams/SkipStream' { import { AlotStreamIterationResult } from 'alot/streams/IAlotStream'; import { IAlotStream } from "alot/streams/IAlotStream"; import { AlotProto } from "alot/AlotProto"; export class SkipStream extends AlotProto { stream: IAlotStream; _count: number; constructor(stream: IAlotStream, _count: number); next(): AlotStreamIterationResult; reset(): this; } export interface TSkipWhileMethodOpts { } export type SkipWhileMethod = (x: T, i: number) => boolean; export class SkipWhileStream extends AlotProto { stream: IAlotStream; fn: SkipWhileMethod; opts?: TSkipWhileMethodOpts; constructor(stream: IAlotStream, fn: SkipWhileMethod, opts?: TSkipWhileMethodOpts); next(): AlotStreamIterationResult; reset(): this; } export type SkipWhileMethodAsync = (x: T, i: number) => boolean | Promise; export class SkipWhileStreamAsync extends AlotProto { stream: IAlotStream; fn: SkipWhileMethodAsync; opts?: TSkipWhileMethodOpts; isAsync: boolean; constructor(stream: IAlotStream, fn: SkipWhileMethodAsync, opts?: TSkipWhileMethodOpts); nextAsync(): Promise>; reset(): this; } } declare module 'alot/streams/FilterStream' { import { AlotStreamIterationResult } from 'alot/streams/IAlotStream'; import { IAlotStream } from "alot/streams/IAlotStream"; import { AlotProto } from "alot/AlotProto"; import { MethodFilter } from 'alot/Methods'; export class FilterStream extends AlotProto { stream: IAlotStream; fn: MethodFilter; constructor(stream: IAlotStream, fn: MethodFilter); next(): AlotStreamIterationResult; } export class FilterStreamAsync extends AlotProto { stream: IAlotStream; fn: MethodFilter; isAsync: boolean; constructor(stream: IAlotStream, fn: MethodFilter); nextAsync(): Promise>; reset(): this; } } declare module 'alot/streams/MapStream' { import { IAlotStream } from "alot/streams/IAlotStream"; import { AlotProto } from "alot/AlotProto"; import { AlotStreamOpts } from 'alot/AlotMeta'; export type MethodMap = (x: T, i: number) => TResult | PromiseLike; export class MapStream extends AlotProto { stream: IAlotStream; fn: MethodMap; constructor(stream: IAlotStream, fn: MethodMap, opts?: AlotStreamOpts); next(): any; nextAsync(): Promise; reset(): this; } export type MethodMapMany = (x: T, i: number) => TResult[] | PromiseLike; export class MapManyStream extends AlotProto { stream: IAlotStream; fn: MethodMapMany; opts?: AlotStreamOpts; constructor(stream: IAlotStream, fn: MethodMapMany, opts?: AlotStreamOpts); next(): any; nextAsync(): any; reset(): this; } } declare module 'alot/streams/GroupStream' { import { IAlotStream } from "alot/streams/IAlotStream"; import { AlotProto } from "alot/AlotProto"; export type GroupByKeyFn = (x: T, i: number) => TKey; interface IGroup { key: TKey; values: T[]; } export class GroupByStream extends AlotProto, TSource> { stream: IAlotStream; fn: GroupByKeyFn; isAsync: boolean; constructor(stream: IAlotStream, fn: GroupByKeyFn); next(): any; reset(): this; } export {}; } declare module 'alot/streams/DistinctStream' { import { AlotStreamIterationResult } from 'alot/streams/IAlotStream'; import { IAlotStream } from "alot/streams/IAlotStream"; import { AlotProto } from "alot/AlotProto"; export type DistinctByKeyFn = (x: T, i: number) => TKey; export class DistinctByStream extends AlotProto { stream: IAlotStream; fn: DistinctByKeyFn; constructor(stream: IAlotStream, fn?: DistinctByKeyFn); next(): AlotStreamIterationResult; reset(): this; } } declare module 'alot/streams/ForEachStream' { import { IAlotStream } from "alot/streams/IAlotStream"; import { AlotProto } from "alot/AlotProto"; import { AlotStreamOpts } from 'alot/AlotMeta'; export type ForEachMethod = (x: T, i: number) => void | any | never; export class ForEachStream extends AlotProto { stream: IAlotStream; fn: ForEachMethod; constructor(stream: IAlotStream, fn: ForEachMethod, opts?: AlotStreamOpts); next(): any; nextAsync(): Promise; reset(): this; } } declare module 'alot/streams/ForkStream' { import { IAlotStream } from 'alot/streams/IAlotStream'; import { AlotProto } from "alot/AlotProto"; export type ForkMethod = (x: IAlotStream) => void | any; export class ForkStreamInner extends AlotProto { stream: IAlotStream; fn: ForkMethod; _cached: any[]; constructor(stream: IAlotStream, fn: ForkMethod); next(): any; nextAsync(): Promise; reset(): this; pluck(): any; has(i: number): boolean; get(i: number): any; } export class ForkStreamOuter extends AlotProto { stream: IAlotStream; inner: ForkStreamInner; _index: number; _plucked: boolean; constructor(stream: IAlotStream, inner: ForkStreamInner); next(): any; nextAsync(): Promise; reset(): this; } } declare module 'alot/streams/SortedStream' { import { IAlotStream } from "alot/streams/IAlotStream"; import { AlotProto } from "alot/AlotProto"; import { ParametersFromSecond } from 'alot/utils/types'; export type SortMethod = (x: T, i: number) => string | number | bigint | { valueOf(): number | string; }; export class SortByStream extends AlotProto { stream: IAlotStream; direction: 'asc' | 'desc'; isAsync: boolean; constructor(stream: IAlotStream, mix: SortMethod | keyof T | string, direction?: 'asc' | 'desc', isAsync?: boolean); next(): any; thenBy(mix: SortMethod | keyof T | string, direction?: 'asc' | 'desc'): this; nextAsync(): Promise; reset(): this; } export class SortByLocalCompareStream extends AlotProto { stream: IAlotStream; getValue: (x: T, i: number) => string; direction: 'asc' | 'desc'; params: ParametersFromSecond; isAsync: boolean; constructor(stream: IAlotStream, getValue: (x: T, i: number) => string, direction: 'asc' | 'desc', params: ParametersFromSecond); next(): any; reset(): this; } } declare module 'alot/streams/JoinStream' { import { IAlotStream } from "alot/streams/IAlotStream"; import { AlotProto } from "alot/AlotProto"; import { AlotStreamOpts } from 'alot/AlotMeta'; export interface MethodJoin { (inner: TInner[], getOuterKey: (x: TOuter) => string | number, getInnerKey: (x: TInner) => string | number, joinFn: (a: TOuter, b: TInner) => TResult): TResult | PromiseLike; } export interface MethodJoin { (inner: TInner[], getOuterKey: (x: TOuter) => string | number, getInnerKey: (x: TInner) => string | number, joinFn: (a?: TOuter, b?: TInner) => TResult): TResult | PromiseLike; } export type JoinType = 'inner' | 'outer'; export class JoinStream extends AlotProto { stream: IAlotStream; constructor(stream: IAlotStream, inner: TInner[], fnKeyOuter: (x: TOuter) => string | number, fnKeyInner: (x: TInner) => string | number, joinFn: (a?: TOuter, b?: TInner) => TResult, joinType: JoinType, opts?: AlotStreamOpts); next(): any; nextAsync(): Promise; reset(): this; } } declare module 'alot/streams/ConcatStream' { import { IAlotStream } from 'alot/streams/IAlotStream'; import { AlotProto } from "alot/AlotProto"; export class ConcatStream extends AlotProto<(TSource | TSourceB), TSource> { stream: IAlotStream; sourceB: Array; constructor(stream: IAlotStream, sourceB: Array); next(): { done: boolean; value: any; }; reset(): this; } }