Compiler TSX
A custom compiler to convert .vue
to a TSX representation for type checking and IDE support.
Usage
npm add @vuedx/compiler-tsx
API
compile
More info
Signature:
export declare function compile(
source: string,
options: CompileOptions,
): Omit<CompileOutput, 'map'> & {
map: RawSourceMap
}
Parameter | Type | Description |
---|---|---|
source | string |
- |
options | CompileOptions |
- |
compileWithDecodedSourceMap
More info
Signature:
export declare function compileWithDecodedSourceMap(
source: string,
options: CompileOptions,
): CompileOutput
Parameter | Type | Description |
---|---|---|
source | string |
- |
options | CompileOptions |
- |
Types
CompileOptions
export interface CompileOptions extends TransformOptions {}
CompileOutput
export interface CompileOutput extends TransformedCode {
descriptor: SFCDescriptor
errors: Array<CompilerError | SyntaxError>
template?: RootNode
}
CustomAttributeNode
export interface CustomAttributeNode extends AttributeNode {
nameLoc: SourceLocation
}
CustomBaseElementNode
export interface CustomBaseElementNode extends BaseElementNode {
endTagLoc?: SourceLocation
hoists?: CompoundExpressionNode[]
startTagLoc: SourceLocation
tagLoc: SourceLocation
}
CustomNode
export interface CustomNode extends Node {
scope: Scope
}
Support
This package is part of VueDX project, maintained by Rahul Kadyan. You can