import type { Some } from './array.js'; import type { $Max, w_subtract } from './type-math.js'; export declare function capitalize(value: T): Capitalize; export declare function uncapitalize(value: T): Uncapitalize; export type ConcatString = T extends [infer F extends string, ...infer R extends string[]] ? `${F}${ConcatString}` : ''; export type Join = T extends [ infer F extends string, ...infer R extends string[] ] ? `${F}${R extends [] ? '' : `${S}${Join}`}` : ''; export type Whitespace = ' ' | '\t'; export type Trim = T extends `${Whitespace}${infer R extends string}` ? Trim : T; /** * Encodes a UTF-8 string into a buffer */ export declare function encodeUTF8(input: string): Uint8Array; /** * Decodes a UTF-8 string from a buffer */ export declare function decodeUTF8(input?: Uint8Array): string; export declare function encodeASCII(input: string): Uint8Array; export declare function decodeASCII(input: Uint8Array): string; export type UUID = `${string}-${string}-${string}-${string}-${string}`; export declare function decodeUUID(uuid: Uint8Array): UUID; export declare function encodeUUID(uuid: UUID): Uint8Array; export declare function stringifyUUID(uuid: bigint): UUID; export declare function parseUUID(uuid: UUID): bigint; /** * Used to support union delimiters, e.g. `'.' | ':'` */ type _SplitVariant = T extends `${infer Left}${CurrentDelim}${infer Right}` ? [Left, ...Split] : [T]; /** * Split a string. */ export type Split = string extends T ? string[] : T extends '' ? [''] : { [D in Delimiter]: Some<_SplitVariant, `${string}${Delimiter}${string}`> extends true ? never : _SplitVariant; }[Delimiter]; export type StringLength = Split['length']; export type Repeat = N extends 0 ? Init : Repeat>, `${Init}${T}`>; export type PadRight = Repeat>>, Init>; export type PadLeft = `${Repeat>>>}${Init}`; export type NonEmptyString = `${any}${string}`; export type CoercibleToString = string | number | bigint | boolean | null | undefined; export {};