UNPKG

689 BTypeScriptView Raw
1import { Match } from '../Any/_Internal';
2import { Is } from '../Any/Is';
3/**
4 * @hidden
5 */
6export declare type _Replace<O extends object, M extends any, A extends any, match extends Match> = {
7 [K in keyof O]: {
8 1: A;
9 0: O[K];
10 }[Is<M, O[K], match>];
11} & {};
12/**
13 * Update with `A` the fields of `O` that match `M`
14 * @param O to update
15 * @param M to select fields
16 * @param A to update with
17 * @param match (?=`'default'`) to change precision
18 * @returns [[Object]]
19 * @example
20 * ```ts
21 * ```
22 */
23export declare type Replace<O extends object, M extends any, A extends any, match extends Match = 'default'> = O extends unknown ? _Replace<O, M, A, match> : never;