import { type ColorTokens } from "../../style/index.js"; /** * What one span of highlighted code is: plain text, a comment, a string, a keyword, a * number, a tag, a component tag name, an attribute, a function name or a variable. * CodeBlock paints each kind in its own ink (`syntaxColor`). */ export type TokenKind = "text" | "comment" | "string" | "keyword" | "number" | "tag" | "component" | "attr" | "fn" | "var"; /** One span of a highlighted line: its text and its kind. */ export interface CodeToken { text: string; kind: TokenKind; } /** Resolve a `language` prop to a supported grammar key, or undefined. */ export declare function resolveLanguage(language?: string): string | undefined; /** * Tokenize `code` into per-line spans for the given language. Unknown or absent * languages yield monochrome lines (every span kind "text"), so rendering never * branches on highlight support. */ export declare function tokenize(code: string, language?: string): CodeToken[][]; /** * The theme-aware color for a token kind: the hand-off's code inks (cv-kit-code3.js * `hl`, and the component page's `hl` at Component.dc.html line 324 for the jsx * grammar). Keywords and component tag names in the accent's text ink * (`var(--ion-tx)`), strings in mint (`var(--mint)`), numbers in amber, tags and * attributes in cyan (`var(--cyan)`), comments in the subtle ink (`var(--tx3)`). `dark` * says the code sits on a dark bed: the dark scheme's own tokens, or the terminal's * fixed dark window in any scheme, which takes the dark scheme's inks. */ export declare function syntaxColor(kind: TokenKind, tokens: ColorTokens, dark: boolean): string; //# sourceMappingURL=tokenize.d.ts.map