import type { Program } from "acorn"; import { type Span } from "./source.ts"; export type EmbeddedJavaScriptEditorTokenType = "class" | "function" | "method" | "property" | "variable" | "parameter"; export type EmbeddedJavaScriptEditorTokenModifier = "declaration" | "readonly" | "static"; /** * One editor-only JavaScript identifier classification. These tokens never * enter the VelarScript symbol/reference index: they describe a foreign AST * solely so an LSP client can color the source that Acorn already parsed. */ export interface EmbeddedJavaScriptEditorToken { readonly span: Span; readonly type: EmbeddedJavaScriptEditorTokenType; readonly modifiers: readonly EmbeddedJavaScriptEditorTokenModifier[]; } /** * Derives only roles established by ECMAScript syntax and lexical binding. * In particular, an unresolved ordinary global does not become a guessed * variable/function token. A name in `new X()` or `class Y extends X` is a * constructor position, so that use can safely receive the editor's `class` * role without claiming a JavaScript type for X. */ export declare function embeddedJavaScriptEditorTokens(program: Program, sourceStart: number, rootParameters?: readonly string[]): readonly EmbeddedJavaScriptEditorToken[]; //# sourceMappingURL=embedded-javascript-editor.d.ts.map