More info
Signature:
export declare class VueSFCDocument implements TextDocument {
get blocks(): SFCBlock[];
static create(fileName: string, content: string, options?: Omit<CompileOptions, 'cache' | 'fileName'>, version?: number): VueSFCDocument;
get descriptor(): SFCDescriptor;
get errors(): Array<CompilerError | SyntaxError>;
get fileName(): string;
findGeneratedTextSpan(spanInOriginalText: TextSpan): TextSpan | null;
findMapping(positionType: 'original' | 'generated', position: Position, searchBias?: SourceMapBiasType): Mapping | null;
findOriginalTextSpan(spanInGeneratedText: TextSpan): TextSpan | null;
get generated(): TextDocument;
readonly generatedFileName: string;
generatedOffsetAt(offset: number): number | null;
generatedPositionFor(position: Position): Position | null;
getBlockAt(offset: number): SFCBlock | null;
getLineAndCharacterOfPosition(position: number): Position;
getSourceFile(fileName?: string): {
fileName: string;
readonly text: string;
lineMap: unknown;
getLineAndCharacterOfPosition: (position: number) => Position;
};
getText(range?: Range): string;
get languageId(): string;
get lineCount(): number;
lineMap: unknown | undefined;
get map(): string;
offsetAt(position: Position): number;
readonly options: Required<CompileOptions>;
get original(): TextDocument;
readonly originalFileName: string;
originalOffsetAt(offset: number): number | null;
originalPositionFor(position: Position): Position | null;
positionAt(offset: number): Position;
get snapshot(): VueToTsxSnapshot;
get templateAST(): RootNode | undefined;
get text(): string;
update(changes: TextDocumentContentChangeEvent[], version: number): void;
get uri(): string;
get version(): number;
}
Members:
Signature:
static create(fileName: string, content: string, options?: Omit<CompileOptions, 'cache' | 'fileName'>, version?: number): VueSFCDocument;
Parameter | Type | Description |
---|
fileName | string | - |
content | string | - |
options | Omit<CompileOptions, 'cache' | 'fileName'> | - |
version | number | - |
Signature:
findGeneratedTextSpan(spanInOriginalText: TextSpan): TextSpan | null;
Parameter | Type | Description |
---|
spanInOriginalText | TextSpan | - |
Signature:
findMapping(positionType: 'original' | 'generated', position: Position, searchBias?: SourceMapBiasType): Mapping | null;
Signature:
findOriginalTextSpan(spanInGeneratedText: TextSpan): TextSpan | null;
Parameter | Type | Description |
---|
spanInGeneratedText | TextSpan | - |
Signature:
generatedOffsetAt(offset: number): number | null;
Parameter | Type | Description |
---|
offset | number | - |
Signature:
generatedPositionFor(position: Position): Position | null;
Parameter | Type | Description |
---|
position | Position | - |
Signature:
getBlockAt(offset: number): SFCBlock | null;
Parameter | Type | Description |
---|
offset | number | - |
Signature:
getLineAndCharacterOfPosition(position: number): Position;
Parameter | Type | Description |
---|
position | number | - |
Signature:
getSourceFile(fileName?: string): {
fileName: string;
readonly text: string;
lineMap: unknown;
getLineAndCharacterOfPosition: (position: number) => Position;
};
Parameter | Type | Description |
---|
fileName | string | - |
Signature:
getText(range?: Range): string;
Parameter | Type | Description |
---|
range | Range | - |
Signature:
offsetAt(position: Position): number;
Parameter | Type | Description |
---|
position | Position | - |
Signature:
originalOffsetAt(offset: number): number | null;
Parameter | Type | Description |
---|
offset | number | - |
Signature:
originalPositionFor(position: Position): Position | null;
Parameter | Type | Description |
---|
position | Position | - |
Signature:
positionAt(offset: number): Position;
Parameter | Type | Description |
---|
offset | number | - |
Signature:
update(changes: TextDocumentContentChangeEvent[], version: number): void;