Revert "Added a new test case and fixed some missing generators"
This reverts commit 9818385a29
.
canary
parent
4d983dc36a
commit
6ce07804b5
|
@ -1,8 +1,6 @@
|
||||||
import * as ts from "typescript";
|
import * as ts from "typescript";
|
||||||
import {SyntaxKind} from "typescript";
|
import {SyntaxKind} from "typescript";
|
||||||
|
|
||||||
type TSExpression = ts.Type | ts.Node;
|
|
||||||
|
|
||||||
interface Array<T> {
|
interface Array<T> {
|
||||||
last?(): T;
|
last?(): T;
|
||||||
}
|
}
|
||||||
|
@ -102,9 +100,9 @@ class StackParameters implements StackParameter {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
const generators: {[key: number]:((settings: _Settings, stack: StackParameters, node: ts.Node | ts.Type) => ts.Node | ts.Type | undefined) | undefined} = {};
|
const generators: {[key: number]:((settings: _Settings, stack: StackParameters, node: ts.Node) => ts.Node | undefined) | undefined} = {};
|
||||||
|
|
||||||
function _generate(settings: _Settings, stack: StackParameters, layer: TSExpression[], node: ts.Node) {
|
function _generate(settings: _Settings, stack: StackParameters, layer: ts.Node[], node: ts.Node) {
|
||||||
//console.log(SyntaxKind[node.kind]);
|
//console.log(SyntaxKind[node.kind]);
|
||||||
if(generators[node.kind]) {
|
if(generators[node.kind]) {
|
||||||
const result = generators[node.kind](settings, stack, node);
|
const result = generators[node.kind](settings, stack, node);
|
||||||
|
@ -324,6 +322,7 @@ generators[SyntaxKind.ClassDeclaration] = (settings, stack, node: ts.ClassDeclar
|
||||||
};
|
};
|
||||||
|
|
||||||
generators[SyntaxKind.PropertySignature] = (settings, stack, node: ts.PropertySignature) => {
|
generators[SyntaxKind.PropertySignature] = (settings, stack, node: ts.PropertySignature) => {
|
||||||
|
console.log(SyntaxKind[node.type.kind]);
|
||||||
let type: ts.TypeNode = node.type;
|
let type: ts.TypeNode = node.type;
|
||||||
switch (node.type.kind) {
|
switch (node.type.kind) {
|
||||||
case SyntaxKind.LiteralType:
|
case SyntaxKind.LiteralType:
|
||||||
|
@ -385,10 +384,3 @@ generators[SyntaxKind.EnumDeclaration] = (settings, stack, node: ts.EnumDeclarat
|
||||||
members.push(generators[SyntaxKind.EnumMember](settings, stack, member));
|
members.push(generators[SyntaxKind.EnumMember](settings, stack, member));
|
||||||
return ts.createEnumDeclaration(undefined, append_export(append_declare(node.modifiers, !stack.flag_declare), stack.flag_namespace), node.name, members);
|
return ts.createEnumDeclaration(undefined, append_export(append_declare(node.modifiers, !stack.flag_declare), stack.flag_namespace), node.name, members);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
generators[SyntaxKind.TypeParameter] = (settings, stack, node: ts.TypeParameter) => undefined;
|
|
||||||
generators[SyntaxKind.HeritageClause] = (settings, stack, node: ts.HeritageClause) => undefined;
|
|
||||||
generators[SyntaxKind.IfStatement] = (settings, stack, node: ts.IfStatement) => undefined;
|
|
||||||
generators[SyntaxKind.ExpressionStatement] = (settings, stack, node: ts.ExpressionStatement) => undefined;
|
|
||||||
generators[SyntaxKind.SemicolonClassElement] = (settings, stack, node: ts.ExpressionStatement) => undefined;
|
|
|
@ -1,6 +1,13 @@
|
||||||
|
|
||||||
/* File: /home/wolverindev/TeaSpeak/TeaSpeak/Web-Client/tools/dtsgen/test/test_04.ts */
|
/* File: /home/wolverindev/TeaSpeak/TeaSpeak/Web-Client/tools/dtsgen/test/test_03.ts */
|
||||||
declare class TestClass<T> extends Promise<T> {
|
declare enum YY {
|
||||||
|
H,
|
||||||
|
B
|
||||||
|
}
|
||||||
|
declare interface X {
|
||||||
|
type: any;
|
||||||
|
c: YY.B;
|
||||||
|
}
|
||||||
|
declare class X {
|
||||||
|
static x();
|
||||||
}
|
}
|
||||||
declare const lambda_function;
|
|
||||||
declare const lambda_function2;
|
|
||||||
|
|
|
@ -1,4 +0,0 @@
|
||||||
class TestClass<T> extends Promise<T> { }
|
|
||||||
|
|
||||||
const lambda_function = (str) => {};
|
|
||||||
const lambda_function2 = (str: string) => {};
|
|
Loading…
Reference in New Issue