UNPKG

@zenbase/llml

Version:

Lightweight Language Markup Language - Convert nested data structures to human-readable, XML-like markup

26 lines (25 loc) 977 B
declare namespace exports_formatters { export { vibeXML, json }; } /** * Predicate function that checks if a value matches a specific type */ type Predicate = (value: unknown) => boolean; /** * Format function that transforms a value to a string */ type Formatter = (value: unknown, llml: (data: unknown, formatters: Formatters) => string, formatters: Formatters) => string; /** * Formatters as an iterable of [predicate, formatter] pairs */ type Formatters = Iterable<[Predicate, Formatter]>; declare const json: (replacer?: (number | string)[] | ((this: any, key: string, value: any) => any) | null, space?: string | number) => Formatters; interface VibeXMLOptions { formatters?: Formatters; } declare const vibeXML: (options?: VibeXMLOptions) => Formatters; /** * Core LLML function - simple formatter-based API */ declare const llml: (data: unknown, formatters?: Formatters) => string; export { llml, exports_formatters as formatters, Predicate, Formatters, Formatter };