export type Pos = { x: number; y: number; }; export interface OMap { [k: string]: T | undefined; } export interface OMapF { [k: string]: T; } export type Rect = Pos & { w: number; h: number; }; export declare const intersectRect: (r1: Rect, r2: Rect) => boolean; export declare const calcCenter: ({ w, h, x, y }: Rect) => Pos; export declare const middlePos: (p1: Pos, p2: Pos) => Pos; export declare const mapOMap: (map: OMap, cb: (key: string, item: T) => T) => OMap; export declare const filterOMap: (map: OMap, cb: (key: string, item: T) => boolean) => OMap; export declare const keys: (map: OMap) => string[]; export declare const values: (map: OMap) => V[]; export declare const entries: (map: OMap) => Array<[string, V]>; export declare const fromEntries: (entries: Array<[string, V]>) => OMap; export declare const pickFirst: (v: [K, any]) => K; export declare const pickSecond: (v: [any, K]) => K; export type RandomFunction = { (): number; (max: number): number; (max: number, min: number): number; }; export declare const randomInt: RandomFunction; export declare const randomPos: (to?: number, from?: number) => Pos; export declare const pickRandom: (v: K[]) => K; export declare const repeat: (count: number, run: (idx: number) => T) => T[]; export declare const randomInts: (count: number, to?: number, from?: number) => number[]; export declare const shuffle: (arr: any[]) => any[]; export declare const containsAll: (arr: T[], items: T[]) => boolean; export declare const isDefined: (o: T) => o is NonNullable; export declare const isPromise: (o: any) => o is Promise; export declare const callFnOrFnPromise: (maybeFnOrFnPromise: void | Function | Promise, errorMsg: string) => void; export declare const isOptionalType: (type: string) => boolean; export declare const ensure: (v: T, msg?: string) => NonNullable; export declare const removeDupes: (list: string[]) => string[]; export declare const noop: () => void; export declare const delay: (ms: number) => Promise; export declare const eventually: (callback: () => void, timeout?: number, retryDelay?: number, errorSet?: Set) => Promise; export declare function simplePluralize(count: number, noun: string): string; //# sourceMappingURL=utils.d.ts.map