-
Notifications
You must be signed in to change notification settings - Fork 234
/
metadata.ts
37 lines (30 loc) · 799 Bytes
/
metadata.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
36
37
import { RawSourceMap } from 'source-map';
import * as ts from 'typescript';
export interface CodeWithSourceMap {
code: string;
map?: RawSourceMap;
source?: string;
}
interface PropertyMetadata {
node?: ts.Node;
url?: string;
}
export interface AnimationMetadata extends PropertyMetadata {
animation: CodeWithSourceMap;
}
export interface StyleMetadata extends PropertyMetadata {
style: CodeWithSourceMap;
}
export interface TemplateMetadata extends PropertyMetadata {
template: CodeWithSourceMap;
}
export class DirectiveMetadata {
controller!: ts.ClassDeclaration;
decorator!: ts.Decorator;
selector!: string;
}
export class ComponentMetadata extends DirectiveMetadata {
animations!: AnimationMetadata[];
styles!: StyleMetadata[];
template!: TemplateMetadata;
}