import { IList } from './collections'; import './computation/math/Declaration'; import { IObjectDictionary, Selector } from './core'; import './GlobalDeclarationImpl'; import { IParallelQueryable, IQueryable } from './linq/index'; import './parallels/Declaration'; import { ExtendedPromiseOptions } from './parallels/Declaration'; declare global { interface String { toPascalCase(): string; toCamelCase(): string; toTitleCase(): string; toSentenceCase(): string; toSnakeCase(): string; toUpperFirstCase(): string; toLowerFirstCase(): string; toDotCase(): string; } interface Number { clamp(min: number, max: number): number; } interface Math { DEG_PER_RAD: number; RAD_PER_DEG: number; clamp(x: number, min: number, max: number): number; degrees(degree: number): number; radians(radian: number): number; scale(x: number, inLow: number, inHigh: number, outLow: number, outHigh: number): number; fscale(x: number, inLow: number, inHigh: number, outLow: number, outHigh: number): number; } interface ObjectConstructor { isObjectType(target: any): boolean; deepAssign(target: T, source1: U): T & U; deepAssign(target: T, source1: U, source2: V): T & U & V; deepAssign(target: T, source1: U, source2: V, source3: W): T & U & V & W; deepAssign(target: T, source1: U, source2: V, source3: W, source4: X): T & U & V & W & X; deepAssign(target: T, source1: U, source2: V, source3: W, source4: X, source5: Y): T & U & V & W & X & Y; deepAssign(target: T, source1: U, source2: V, source3: W, source4: X, source5: Y, source6: Z): T & U & V & W & X & Y & Z; deepAssign(target: T, ...sources: any[]): T & any; deepEqual(x: Record, y: Record): boolean; cloneObject(target: T): T; createInstance(c: new () => T): T; } interface IterableIterator { } interface Array { clear(): void; contains(obj: T): boolean; findDuplicates(): T[]; itemCount(): Array<{ item: T; count: number; }>; toUnique(): T[]; hasDuplicate(): boolean; groupBy>(selector: Selector | string | string[]): R; linq(): IQueryable; plinq(): IParallelQueryable; toArray(): T[]; toList(): IList; } interface Set { isSuperSetOf

(other: Set

): boolean; isSubSetOf

(other: Set

): boolean; isEmpty(): boolean; intersect

(other: Set

): Set; union

(other: Set

): Set; except

(other: Set

): Set; xor

(other: Set

): Set; find(callbackfn: (value: T, index: number, set: Set) => boolean, thisArg?: any): T; filter(callbackfn: (value: T, index: number, set: Set) => boolean, thisArg?: any): Set; every(callbackfn: (value: T, index: number, set: Set) => boolean, thisArg?: any): boolean; some(callbackfn: (value: T, index: number, set: Set) => boolean, thisArg?: any): boolean; map(callbackfn: (value: T, index: number, set: Set) => U, thisArg?: any): Set; join(separator?: string): string; toArray(): T[]; toList(): IList; linq(): IQueryable; plinq(): IParallelQueryable; } interface Map { put(key: K, value: V): this; putAll(...entries: Array<[K, V]>): this; isEmpty(): boolean; toArray(): Array<[K, V]>; toList(): IList<[K, V]>; toObject(): IObjectDictionary; toValueList(): IList; toKeyList(): IList; containsKey(key: string | symbol): boolean; containsValue(value: any): boolean; linq(): IQueryable<[K, V]>; plinq(): IParallelQueryable<[K, V]>; map(callbackfn: (value: [K, V], index: number, map: Map) => [T, U], thisArg?: any): Map; } interface WeakSet { isSuperSetOf

(other: Set

): boolean; isSubSetOf

(other: Set

): boolean; isEmpty(): boolean; intersect

(other: Set

): Set; union

(other: Set

): Set; except

(other: Set

): Set; xor

(other: Set

): Set; find(callbackfn: (value: T, index: number, set: WeakSet) => boolean, thisArg?: any): T; filter(callbackfn: (value: T, index: number, set: WeakSet) => boolean, thisArg?: any): WeakSet; every(callbackfn: (value: T, index: number, set: WeakSet) => boolean, thisArg?: any): boolean; some(callbackfn: (value: T, index: number, set: WeakSet) => boolean, thisArg?: any): boolean; map(callbackfn: (value: T, index: number, set: WeakSet) => U, thisArg?: any): WeakSet; join(separator?: string): string; toArray(): T[]; toList(): IList; linq(): IQueryable; plinq(): IParallelQueryable; } interface WeakMap { put(key: K, value: V): this; putAll(...entries: Array<[K, V]>): this; isEmpty(): boolean; toArray(): Array<[K, V]>; toList(): IList<[K, V]>; toObject(): IObjectDictionary; toValueList(): IList; toKeyList(): IList; containsKey(key: string | symbol): boolean; containsValue(value: any): boolean; linq(): IQueryable<[K, V]>; plinq(): IParallelQueryable<[K, V]>; map(callbackfn: (value: [K, V], index: number, map: Map) => [T, U], thisArg?: any): WeakMap; } export interface PromiseConstructor { delay(ms: number, defaulValue?: T): Promise; wait(ms: number): Promise; extendedPromise(promise: Promise, options?: ExtendedPromiseOptions): ExtendedPromise; } export interface Promise { delay(ms: number, defaulValue?: T): Promise; timeout(ms: number, err?: string | Error): Promise; wait(ms: number): Promise; spread(fn: (...args: T[]) => void): Promise; } export interface ExtendedPromise extends Promise { cancel(): void; progress(data: any): void; } }