UNPKG

539 BTypeScriptView Raw
1import { List } from '../List/List';
2import { Literal } from './_Internal';
3import { Cast } from '../Any/Cast';
4/**
5 * @hidden
6 */
7declare type _Join<T extends List, D extends string> = T extends [] ? '' : T extends [Literal] ? `${T[0]}` : T extends [Literal, ...infer R] ? `${T[0]}${D}${_Join<R, D>}` : string;
8/**
9 * Concat many literals together
10 * @param T to concat
11 * @param D to delimit
12 */
13export declare type Join<T extends List<Literal>, D extends string = ''> = _Join<T, D> extends infer X ? Cast<X, string> : never;
14export {};