Comparing version 0.1.21 to 0.1.22
@@ -103,2 +103,7 @@ export interface DeclarationBase { | ||
} | ||
export interface VariableDeclaration extends DeclarationBase { | ||
kind: "var"; | ||
name: string; | ||
type: Type; | ||
} | ||
export interface ExportEqualsDeclaration extends DeclarationBase { | ||
@@ -164,4 +169,4 @@ kind: "export="; | ||
export declare type Import = ImportAllDeclaration | ImportDefaultDeclaration | ImportNamedDeclaration; | ||
export declare type NamespaceMember = InterfaceDeclaration | TypeAliasDeclaration | ClassDeclaration | NamespaceDeclaration | ConstDeclaration | FunctionDeclaration; | ||
export declare type ModuleMember = InterfaceDeclaration | TypeAliasDeclaration | ClassDeclaration | NamespaceDeclaration | ConstDeclaration | FunctionDeclaration | Import; | ||
export declare type NamespaceMember = InterfaceDeclaration | TypeAliasDeclaration | ClassDeclaration | NamespaceDeclaration | ConstDeclaration | VariableDeclaration | FunctionDeclaration; | ||
export declare type ModuleMember = InterfaceDeclaration | TypeAliasDeclaration | ClassDeclaration | NamespaceDeclaration | ConstDeclaration | VariableDeclaration | FunctionDeclaration | Import; | ||
export declare type TopLevelDeclaration = NamespaceMember | ExportEqualsDeclaration | ModuleDeclaration | EnumDeclaration | Import; | ||
@@ -202,2 +207,3 @@ export declare enum DeclarationFlags { | ||
const(name: string, type: Type): ConstDeclaration; | ||
variable(name: string, type: Type): VariableDeclaration; | ||
alias(name: string, type: Type): TypeAliasDeclaration; | ||
@@ -204,0 +210,0 @@ namespace(name: string): NamespaceDeclaration; |
@@ -119,2 +119,7 @@ "use strict"; | ||
}, | ||
variable: function (name, type) { | ||
return { | ||
kind: "var", name: name, type: type | ||
}; | ||
}, | ||
alias: function (name, type) { | ||
@@ -686,2 +691,9 @@ return { | ||
} | ||
function writeVar(c) { | ||
printDeclarationComments(c); | ||
startWithDeclareOrExport("var " + c.name + ": ", c.flags); | ||
writeReference(c.type); | ||
print(';'); | ||
newline(); | ||
} | ||
function writeAlias(a) { | ||
@@ -775,2 +787,4 @@ printDeclarationComments(a); | ||
return writeConst(d); | ||
case "var": | ||
return writeVar(d); | ||
case "alias": | ||
@@ -777,0 +791,0 @@ return writeAlias(d); |
@@ -121,2 +121,8 @@ export interface DeclarationBase { | ||
export interface VariableDeclaration extends DeclarationBase { | ||
kind: "var"; | ||
name: string; | ||
type: Type; | ||
} | ||
export interface ExportEqualsDeclaration extends DeclarationBase { | ||
@@ -200,4 +206,4 @@ kind: "export="; | ||
export type NamespaceMember = InterfaceDeclaration | TypeAliasDeclaration | ClassDeclaration | NamespaceDeclaration | ConstDeclaration | FunctionDeclaration; | ||
export type ModuleMember = InterfaceDeclaration | TypeAliasDeclaration | ClassDeclaration | NamespaceDeclaration | ConstDeclaration | FunctionDeclaration | Import; | ||
export type NamespaceMember = InterfaceDeclaration | TypeAliasDeclaration | ClassDeclaration | NamespaceDeclaration | ConstDeclaration | VariableDeclaration | FunctionDeclaration; | ||
export type ModuleMember = InterfaceDeclaration | TypeAliasDeclaration | ClassDeclaration | NamespaceDeclaration | ConstDeclaration | VariableDeclaration | FunctionDeclaration | Import; | ||
export type TopLevelDeclaration = NamespaceMember | ExportEqualsDeclaration | ModuleDeclaration | EnumDeclaration | Import; | ||
@@ -330,2 +336,8 @@ | ||
variable(name: string, type: Type): VariableDeclaration { | ||
return { | ||
kind: "var", name, type | ||
}; | ||
}, | ||
alias(name: string, type: Type): TypeAliasDeclaration { | ||
@@ -937,2 +949,10 @@ return { | ||
function writeVar(c: VariableDeclaration) { | ||
printDeclarationComments(c); | ||
startWithDeclareOrExport(`var ${c.name}: `, c.flags); | ||
writeReference(c.type); | ||
print(';'); | ||
newline(); | ||
} | ||
function writeAlias(a: TypeAliasDeclaration) { | ||
@@ -1032,2 +1052,4 @@ printDeclarationComments(a); | ||
return writeConst(d); | ||
case "var": | ||
return writeVar(d); | ||
case "alias": | ||
@@ -1034,0 +1056,0 @@ return writeAlias(d); |
{ | ||
"name": "dts-dom", | ||
"version": "0.1.21", | ||
"version": "0.1.22", | ||
"homepage": "https://github.com/RyanCavanaugh/dts-dom", | ||
@@ -10,3 +10,4 @@ "description": "DOM for TypeScript Declaration Files", | ||
"build": "tsc -p .", | ||
"prepublish": "npm run build" | ||
"prepublish": "npm run build", | ||
"test": "mocha --compilers=ts:ts-node/register --no-timeouts test/**/test.*.ts" | ||
}, | ||
@@ -18,3 +19,12 @@ "author": "Ryan Cavanaugh", | ||
"url": "https://github.com/RyanCavanaugh/dts-dom" | ||
}, | ||
"devDependencies": { | ||
"@types/chai": "^4.0.7", | ||
"@types/mocha": "^2.2.44", | ||
"@types/node": "^8.0.54", | ||
"chai": "^4.1.2", | ||
"mocha": "^4.0.1", | ||
"ts-node": "^3.3.0", | ||
"typescript": "^2.6.2" | ||
} | ||
} |
@@ -6,3 +6,7 @@ { | ||
"compilerOptions": { | ||
"types": [], | ||
"types": [ | ||
"@types/node", | ||
"@types/mocha", | ||
"@types/chai" | ||
], | ||
@@ -9,0 +13,0 @@ "module": "commonjs", |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
103595
2086
7