UNPKG

720 BTypeScriptView Raw
1import { Option, PresentArray } from '@glimmer/interfaces';
2export declare function isPresent<T>(list: readonly T[]): list is PresentArray<T>;
3export declare function ifPresent<T, U, V>(list: T[], ifPresent: (input: PresentArray<T>) => U, otherwise: () => V): U | V;
4export declare function toPresentOption<T>(list: T[]): Option<PresentArray<T>>;
5export declare function assertPresent<T>(list: T[], message?: string): asserts list is PresentArray<T>;
6export declare function mapPresent<T, U>(list: PresentArray<T>, callback: (input: T) => U): PresentArray<U>;
7export declare function mapPresent<T, U>(list: PresentArray<T> | null, callback: (input: T) => U): PresentArray<U> | null;
8//# sourceMappingURL=present.d.ts.map
\No newline at end of file