UNPKG

@limetech/lime-elements

Version:
19 lines 669 B
/** * A syntax token representing a colored segment of code. */ export interface SyntaxToken { value: string; type: SyntaxTokenType; } export type SyntaxTokenType = 'plain' | 'string' | 'number' | 'boolean' | 'null' | 'key' | 'punctuation'; /** * Tokenize a text fragment for syntax highlighting. * Returns the original text as a single plain token when the * language is not supported. * * @param text - the text to tokenize * @param language - the language identifier (e.g. "json") * @returns array of syntax tokens */ export declare function tokenize(text: string, language?: string): SyntaxToken[]; //# sourceMappingURL=syntax-highlighter.d.ts.map