UNPKG

@azure-tools/linq

Version:

LINQ-like functionality for Typescript.

13 lines 650 B
export interface Index<T> { [key: number]: T; } export interface Dictionary<T> { [key: string]: T; } export declare class Dictionary<T> implements Dictionary<T> { } export declare function ToDictionary<T>(keys: Array<string>, each: (index: string) => T): Dictionary<T>; export declare type IndexOf<T> = T extends Map<T, infer V> ? T : T extends Array<infer V> ? number : string; /** performs a truthy check on the value, and calls onTrue when the condition is true,and onFalse when it's not */ export declare function when<T>(value: T, onTrue: (value: NonNullable<T>) => void, onFalse?: () => void): void; //# sourceMappingURL=common.d.ts.map