import type { CompletionItem, Diagnostic, Hover, Location, Position, SignatureHelp } from 'vscode-languageserver-types'; /** * What {@link createSsjsTypeScriptService} needs from its caller. */ export interface SsjsTypeScriptServiceOptions { /** * Text of the SSJS globals declarations: `ssjs-data/sfmc-globals.d.ts`. */ globalsDts: string; /** * Documentation link for a TypeScript diagnostic code. Diagnostics carry a * `codeDescription` only where this returns a URL. */ diagnosticUrl?: (code: number) => string | undefined; } /** * Completion items together with whether they are the members of an expression. */ export interface SsjsCompletionInfo { items: CompletionItem[]; isMemberCompletion: boolean; } /** * One independent TypeScript-based SSJS language service. A document must be handed to * `updateDocument` before it is queried; unknown documents give empty answers. */ export interface SsjsTypeScriptService { /** * Sets the SSJS text of a document. Text identical to the current text changes nothing. */ updateDocument(uri: string, text: string): void; /** * Forgets a document and its companion declarations. */ removeDocument(uri: string): void; getCompletions(uri: string, position: Position): CompletionItem[]; getCompletionInfo(uri: string, position: Position): SsjsCompletionInfo; getDiagnostics(uri: string): Diagnostic[]; getHover(uri: string, position: Position): Hover | undefined; getDefinition(uri: string, position: Position): Location[]; getReferences(uri: string, position: Position): Location[]; getSignatureHelp(uri: string, position: Position): SignatureHelp | undefined; } /** * Create a TypeScript-based SSJS language service. All state (virtual files, document names, * the active document and the TypeScript language service itself) belongs to the returned * instance; two instances share nothing. * @param options - globals declarations and optional diagnostic documentation links * @returns the service instance */ export declare function createSsjsTypeScriptService(options: SsjsTypeScriptServiceOptions): SsjsTypeScriptService; //# sourceMappingURL=service.d.ts.map