UNPKG

2.63 kBTypeScriptView Raw
1interface BaseNode {
2 start: number;
3 end: number;
4 type: string;
5 children?: Node[];
6 [prop_name: string]: any;
7}
8export interface Text extends BaseNode {
9 type: 'Text';
10 data: string;
11}
12export interface MustacheTag extends BaseNode {
13 type: 'MustacheTag';
14 expression: Node;
15}
16export declare type DirectiveType = 'Action' | 'Animation' | 'Binding' | 'Class' | 'EventHandler' | 'Let' | 'Ref' | 'Transition';
17interface BaseDirective extends BaseNode {
18 type: DirectiveType;
19 expression: null | Node;
20 name: string;
21 modifiers: string[];
22}
23export interface Transition extends BaseDirective {
24 type: 'Transition';
25 intro: boolean;
26 outro: boolean;
27}
28export declare type Directive = BaseDirective | Transition;
29export declare type Node = Text | MustacheTag | BaseNode | Directive | Transition;
30export interface Parser {
31 readonly template: string;
32 readonly filename?: string;
33 index: number;
34 stack: Node[];
35 html: Node;
36 css: Node;
37 js: Node;
38 meta_tags: {};
39}
40export interface Ast {
41 html: Node;
42 css: Node;
43 instance: Node;
44 module: Node;
45}
46export interface Warning {
47 start?: {
48 line: number;
49 column: number;
50 pos?: number;
51 };
52 end?: {
53 line: number;
54 column: number;
55 };
56 pos?: number;
57 code: string;
58 message: string;
59 filename?: string;
60 frame?: string;
61 toString: () => string;
62}
63export declare type ModuleFormat = 'esm' | 'cjs';
64export interface CompileOptions {
65 format?: ModuleFormat;
66 name?: string;
67 filename?: string;
68 generate?: string | false;
69 outputFilename?: string;
70 cssOutputFilename?: string;
71 sveltePath?: string;
72 dev?: boolean;
73 accessors?: boolean;
74 immutable?: boolean;
75 hydratable?: boolean;
76 legacy?: boolean;
77 customElement?: boolean;
78 tag?: string;
79 css?: boolean;
80 preserveComments?: boolean;
81 preserveWhitespace?: boolean;
82}
83export interface ParserOptions {
84 filename?: string;
85 customElement?: boolean;
86}
87export interface Visitor {
88 enter: (node: Node) => void;
89 leave?: (node: Node) => void;
90}
91export interface AppendTarget {
92 slots: Record<string, string>;
93 slot_stack: string[];
94}
95export interface Var {
96 name: string;
97 export_name?: string;
98 injected?: boolean;
99 module?: boolean;
100 mutated?: boolean;
101 reassigned?: boolean;
102 referenced?: boolean;
103 writable?: boolean;
104 global?: boolean;
105 internal?: boolean;
106 initialised?: boolean;
107 hoistable?: boolean;
108 subscribable?: boolean;
109 is_reactive_dependency?: boolean;
110}
111export {};