-
Notifications
You must be signed in to change notification settings - Fork 0
/
interfaces.d.ts
35 lines (35 loc) · 1.05 KB
/
interfaces.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
export interface ISerializationOptions {
indent?: number;
es?: number;
}
export interface ISerializationResult {
code: string;
ast?: IAst;
}
export interface SrcLocation {
start: LinePosition;
end: LinePosition;
source?: string | null | undefined;
}
export interface LinePosition {
line: number;
column: number;
}
export interface IAst {
type: string;
loc?: SrcLocation | null;
}
export interface ISerializerOptions {
support: string[];
}
export interface ISerializer {
addToContext(context: ISerializationContext): void;
serialize(context: ISerializationContext, ast: IAst, opts: ISerializationOptions): ISerializationResult;
override?(type: string, otherOptions: ISerializerOptions): boolean;
}
export interface ISerializationContext {
addToContext(ser: ISerializer): this;
addHandler(type: string, ser: ISerializer, serOptions: ISerializerOptions): boolean;
handlerSupport(type: string): ISerializerOptions | undefined;
serialize(ast: IAst, options?: ISerializationOptions): ISerializationResult;
}