type TTakeOne = (Input extends `${infer Left extends string}${infer Right extends string}` ? [Left, Right] : []); type TIsInputMatchSentinal = (End extends [infer Left extends string, ...infer Right extends string[]] ? Input extends `${Left}${string}` ? true : TIsInputMatchSentinal : false); /** Match Input until but not including End. No match if End not found. */ export type TUntil = (TTakeOne extends [infer One extends string, infer Rest extends string] ? TIsInputMatchSentinal extends true ? [Result, Input] : TUntil : []); /** Match Input until but not including End. No match if End not found. */ export declare function Until(end: [...End], input: Input, result?: string): TUntil; export {};