forked from TypeScriptToLua/TypeScriptToLua
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDecorator.ts
More file actions
50 lines (45 loc) · 1.6 KB
/
Decorator.ts
File metadata and controls
50 lines (45 loc) · 1.6 KB
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
38
39
40
41
42
43
44
45
46
47
48
49
50
export class Decorator {
public static isValid(decoratorKindString: string): boolean {
return this.getDecoratorKind(decoratorKindString) !== undefined;
}
public static getDecoratorKind(decoratorKindString: string): DecoratorKind {
switch (decoratorKindString.toLowerCase()) {
case "extension":
return DecoratorKind.Extension;
case "metaextension":
return DecoratorKind.MetaExtension;
case "customconstructor":
return DecoratorKind.CustomConstructor;
case "compilemembersonly":
return DecoratorKind.CompileMembersOnly;
case "pureabstract":
return DecoratorKind.PureAbstract;
case "phantom":
return DecoratorKind.Phantom;
case "tuplereturn":
return DecoratorKind.TupleReturn;
case "noclassor":
return DecoratorKind.NoClassOr;
case "luaiterator":
return DecoratorKind.LuaIterator;
}
return undefined;
}
public kind: DecoratorKind;
public args: string[];
constructor(name: string, args: string[]) {
this.kind = Decorator.getDecoratorKind(name);
this.args = args;
}
}
export enum DecoratorKind {
Extension = "Extension",
MetaExtension = "MetaExtension",
CustomConstructor = "CustomConstructor",
CompileMembersOnly = "CompileMembersOnly",
PureAbstract = "PureAbstract",
Phantom = "Phantom",
TupleReturn = "TupleReturn",
NoClassOr = "NoClassOr",
LuaIterator = "LuaIterator",
}