import { SafeUint } from 'ts-data-forge'; import { type DropInitialValueOperator } from '../types/index.mjs'; /** * Skips values from the source observable while the predicate returns true. * Once the predicate returns false, all subsequent values pass through. * * @template A - The type of values from the source * @param predicate - Function to test each value * @returns An operator that skips values while the predicate is true * * @example * ```ts * // Timeline: * // * // num$ 1 2 3 4 5 6 7 1 2 * // skipped$ 5 6 7 1 2 * // |-------- skip --------| * // * // Explanation: * // - skipWhile skips values while the predicate returns true * // - Once the predicate returns false, all subsequent values pass through * // - Unlike filter, the predicate is never checked again after the first false * * const num$ = source(); * * const skipped$ = num$.pipe(skipWhile((x) => x < 5)); * * const valueHistory: number[] = []; * * skipped$.subscribe((x) => { * valueHistory.push(x); * }); * * num$.next(1); // nothing logged * * num$.next(2); // nothing logged * * num$.next(3); // nothing logged * * num$.next(4); // nothing logged * * num$.next(5); // logs: 5 * * assert.deepStrictEqual(valueHistory, [5]); * * num$.next(6); // logs: 6 * * assert.deepStrictEqual(valueHistory, [5, 6]); * * num$.next(7); // logs: 7 * * assert.deepStrictEqual(valueHistory, [5, 6, 7]); * * num$.next(1); // logs: 1 * * num$.next(2); // logs: 2 * * assert.deepStrictEqual(valueHistory, [5, 6, 7, 1, 2]); * ``` */ export declare const skipWhile: (predicate: (value: A, index: SafeUint | -1) => boolean) => DropInitialValueOperator; //# sourceMappingURL=skip-while.d.mts.map