import { type ParsedCommentBlock, type ParsedCommentTag } from "./comment-syntax.js"; import * as ts from "typescript"; import { type ExtensionTagSource, type FormSpecPlacement, type FormSpecTargetKind, type TagDefinition, type TagSignature } from "./tag-registry.js"; export interface EnclosingDocComment { readonly text: string; readonly start: number; readonly end: number; readonly parsed: ParsedCommentBlock; } export interface CommentCursorTarget { readonly kind: "tag-name" | "colon" | "target" | "argument"; readonly tag: ParsedCommentTag; } export type CommentCompletionContext = { readonly kind: "tag-name"; readonly prefix: string; } | { readonly kind: "target"; readonly tag: ParsedCommentTag; } | { readonly kind: "argument"; readonly tag: ParsedCommentTag; } | { readonly kind: "none"; }; export interface CommentSemanticContextOptions { readonly extensions?: readonly ExtensionTagSource[]; readonly placement?: FormSpecPlacement | null; readonly checker?: ts.TypeChecker; readonly subjectType?: ts.Type; readonly declaration?: ts.Node; } export interface CommentTagSemanticContext { readonly tag: ParsedCommentTag; readonly tagDefinition: TagDefinition | null; readonly placement: FormSpecPlacement | null; readonly signatures: readonly TagSignature[]; readonly contextualSignatures: readonly TagSignature[]; readonly supportedTargets: readonly FormSpecTargetKind[]; readonly targetCompletions: readonly string[]; readonly compatiblePathTargets: readonly string[]; readonly valueLabels: readonly string[]; readonly argumentCompletions: readonly string[]; readonly contextualTagHoverMarkdown: string | null; readonly tagHoverMarkdown: string | null; readonly targetHoverMarkdown: string | null; readonly argumentHoverMarkdown: string | null; } export type SemanticCommentCompletionContext = { readonly kind: "tag-name"; readonly prefix: string; readonly availableTags: readonly TagDefinition[]; } | { readonly kind: "target"; readonly semantic: CommentTagSemanticContext; } | { readonly kind: "argument"; readonly semantic: CommentTagSemanticContext; readonly valueLabels: readonly string[]; } | { readonly kind: "none"; }; /** * Hover payload for a token inside a parsed FormSpec doc comment. * * @public */ export interface CommentHoverInfo { /** Comment token kind currently being described. */ readonly kind: "tag-name" | "target" | "argument"; /** Markdown rendered for the hovered token. */ readonly markdown: string; } export declare function getCommentTagSemanticContext(tag: ParsedCommentTag, options?: CommentSemanticContextOptions): CommentTagSemanticContext; export declare function findEnclosingDocComment(documentText: string, offset: number, options?: { readonly extensions?: readonly ExtensionTagSource[]; }): EnclosingDocComment | null; export declare function findCommentTagAtOffset(documentText: string, offset: number, options?: { readonly extensions?: readonly ExtensionTagSource[]; }): ParsedCommentTag | null; export declare function getCommentCursorTargetAtOffset(documentText: string, offset: number, options?: { readonly extensions?: readonly ExtensionTagSource[]; }): CommentCursorTarget | null; export declare function getTagCompletionPrefixAtOffset(documentText: string, offset: number): string | null; export declare function getCommentCompletionContextAtOffset(documentText: string, offset: number, options?: { readonly extensions?: readonly ExtensionTagSource[]; }): CommentCompletionContext; /** * Resolves the completion context at a document offset, upgrading syntax-only * results with placement/type-aware semantics when TypeScript binding data is * available. */ export declare function getSemanticCommentCompletionContextAtOffset(documentText: string, offset: number, options?: CommentSemanticContextOptions): SemanticCommentCompletionContext; /** * Returns hover information for the comment token under the given document * offset, including semantic target/argument help when binding data is * available. */ export declare function getCommentHoverInfoAtOffset(documentText: string, offset: number, options?: CommentSemanticContextOptions): CommentHoverInfo | null; //# sourceMappingURL=cursor-context.d.ts.map