UNPKG

485 BTypeScriptView Raw
1import { Cast } from '../Any/Cast';
2import { Literal } from './_Internal';
3/**
4 * @hidden
5 */
6declare type _Replace<S extends string, R extends Literal, W extends Literal> = S extends `${infer BS}${R}${infer AS}` ? Replace<`${BS}${W}${AS}`, R, W> : S;
7/**
8 * Replace `R` with `W` in `S`
9 * @param S
10 * @param R
11 * @param W
12 */
13export declare type Replace<S extends string, R extends Literal, W extends Literal> = _Replace<S, R, W> extends infer X ? Cast<X, string> : never;
14export {};