You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
svelte/src/interfaces.ts

79 lines
1.3 KiB

export interface Node {
start: number;
end: number;
type: string;
[propName: string]: any;
}
export interface Parser {
readonly template: string;
readonly filename?: string;
index: number;
stack: Array<Node>;
html: Node;
css: Node;
js: Node;
metaTags: {};
}
export interface Ast {
html: Node;
css: Node;
js: Node;
}
export interface Warning {
start?: { line: number; column: number; pos?: number };
end?: { line: number; column: number; };
pos?: number;
code: string;
message: string;
filename?: string;
frame?: string;
toString: () => string;
}
export type ModuleFormat = 'esm' | 'cjs' | 'eval';
export interface CompileOptions {
format?: ModuleFormat;
name?: string;
filename?: string;
generate?: string | false;
globals?: ((id: string) => string) | object;
amd?: {
id?: string;
};
outputFilename?: string;
cssOutputFilename?: string;
sveltePath?: string;
dev?: boolean;
immutable?: boolean;
hydratable?: boolean;
legacy?: boolean;
customElement?: CustomElementOptions | true;
css?: boolean;
preserveComments?: boolean | false;
onwarn?: (warning: Warning) => void;
}
export interface Visitor {
enter: (node: Node) => void;
leave?: (node: Node) => void;
}
export interface CustomElementOptions {
tag?: string;
props?: string[];
}
export interface AppendTarget {
slots: Record<string, string>;
slotStack: string[]
}