//#region src/constants.d.ts declare const DELIMITERS: { readonly comma: ","; readonly tab: " "; readonly pipe: "|"; }; type DelimiterKey = keyof typeof DELIMITERS; type Delimiter = typeof DELIMITERS[DelimiterKey]; declare const DEFAULT_DELIMITER: Delimiter; //#endregion //#region src/types.d.ts type JsonPrimitive = string | number | boolean | null; type JsonObject = { [Key in string]: JsonValue } & { [Key in string]?: JsonValue | undefined }; type JsonArray = JsonValue[] | readonly JsonValue[]; type JsonValue = JsonPrimitive | JsonObject | JsonArray; interface EncodeOptions { /** * Number of spaces per indentation level. * @default 2 */ indent?: number; /** * Delimiter to use for tabular array rows and inline primitive arrays. * @default DELIMITERS.comma */ delimiter?: Delimiter; /** * Optional marker to prefix array lengths in headers. * When set to `#`, arrays render as [#N] instead of [N]. * @default false */ lengthMarker?: "#" | false; } type ResolvedEncodeOptions = Readonly>; interface DecodeOptions { /** * Number of spaces per indentation level. * @default 2 */ indent?: number; /** * When true, enforce strict validation of array lengths and tabular row counts. * @default true */ strict?: boolean; } type ResolvedDecodeOptions = Readonly>; //#endregion //#region src/index.d.ts declare function encode(input: unknown, options?: EncodeOptions): string; declare function decode(input: string, options?: DecodeOptions): JsonValue; //#endregion export { DEFAULT_DELIMITER, DELIMITERS, type DecodeOptions, type Delimiter, type DelimiterKey, type EncodeOptions, type JsonArray, type JsonObject, type JsonPrimitive, type JsonValue, type ResolvedDecodeOptions, type ResolvedEncodeOptions, decode, encode };