Comparing version 0.1.23 to 0.1.24
@@ -98,2 +98,6 @@ export interface DeclarationBase { | ||
} | ||
export interface ImportDeclaration extends DeclarationBase { | ||
kind: "import"; | ||
from: string; | ||
} | ||
export interface NamespaceDeclaration extends DeclarationBase { | ||
@@ -178,3 +182,3 @@ kind: "namespace"; | ||
export declare type Type = TypeReference | UnionType | IntersectionType | PrimitiveType | ObjectType | TypeofReference | FunctionType | TypeParameter | ThisType; | ||
export declare type Import = ImportAllDeclaration | ImportDefaultDeclaration | ImportNamedDeclaration | ImportEqualsDeclaration; | ||
export declare type Import = ImportAllDeclaration | ImportDefaultDeclaration | ImportNamedDeclaration | ImportEqualsDeclaration | ImportDeclaration; | ||
export declare type NamespaceMember = InterfaceDeclaration | TypeAliasDeclaration | ClassDeclaration | NamespaceDeclaration | ConstDeclaration | VariableDeclaration | FunctionDeclaration; | ||
@@ -231,2 +235,3 @@ export declare type ModuleMember = InterfaceDeclaration | TypeAliasDeclaration | ClassDeclaration | NamespaceDeclaration | ConstDeclaration | VariableDeclaration | FunctionDeclaration | Import; | ||
importEquals(name: string, from: string): ImportEqualsDeclaration; | ||
import(from: string): ImportDeclaration; | ||
union(members: Type[]): UnionType; | ||
@@ -233,0 +238,0 @@ typeof(type: NamedTypeReference): TypeofReference; |
@@ -218,2 +218,8 @@ "use strict"; | ||
}, | ||
import: function (from) { | ||
return { | ||
kind: 'import', | ||
from: from | ||
}; | ||
}, | ||
union: function (members) { | ||
@@ -778,2 +784,6 @@ return { | ||
} | ||
function writeImport(i) { | ||
start("import '" + i.from + "';"); | ||
newline(); | ||
} | ||
function writeEnum(e) { | ||
@@ -840,2 +850,4 @@ printDeclarationComments(e); | ||
return writeImportEquals(d); | ||
case "import": | ||
return writeImport(d); | ||
case "enum": | ||
@@ -842,0 +854,0 @@ return writeEnum(d); |
@@ -115,2 +115,7 @@ export interface DeclarationBase { | ||
export interface ImportDeclaration extends DeclarationBase { | ||
kind: "import"; | ||
from: string; | ||
} | ||
export interface NamespaceDeclaration extends DeclarationBase { | ||
@@ -216,3 +221,3 @@ kind: "namespace"; | ||
export type Import = ImportAllDeclaration | ImportDefaultDeclaration | ImportNamedDeclaration | ImportEqualsDeclaration; | ||
export type Import = ImportAllDeclaration | ImportDefaultDeclaration | ImportNamedDeclaration | ImportEqualsDeclaration | ImportDeclaration; | ||
@@ -455,2 +460,9 @@ export type NamespaceMember = InterfaceDeclaration | TypeAliasDeclaration | ClassDeclaration | NamespaceDeclaration | ConstDeclaration | VariableDeclaration | FunctionDeclaration; | ||
import(from: string): ImportDeclaration { | ||
return { | ||
kind: 'import', | ||
from | ||
}; | ||
}, | ||
union(members: Type[]): UnionType { | ||
@@ -1052,2 +1064,7 @@ return { | ||
function writeImport(i: ImportDeclaration) { | ||
start(`import '${i.from}';`); | ||
newline(); | ||
} | ||
function writeEnum(e: EnumDeclaration) { | ||
@@ -1115,2 +1132,4 @@ printDeclarationComments(e); | ||
return writeImportEquals(d); | ||
case "import": | ||
return writeImport(d); | ||
case "enum": | ||
@@ -1117,0 +1136,0 @@ return writeEnum(d); |
{ | ||
"name": "dts-dom", | ||
"version": "0.1.23", | ||
"version": "0.1.24", | ||
"homepage": "https://github.com/RyanCavanaugh/dts-dom", | ||
@@ -5,0 +5,0 @@ "description": "DOM for TypeScript Declaration Files", |
@@ -43,1 +43,15 @@ [![npm version](https://badge.fury.io/js/dts-dom.svg)](https://badge.fury.io/js/dts-dom) | ||
``` | ||
# Contributors | ||
The following people have contributed features and/or bug requests. Thank you! | ||
* [Sean Barag](https://www.github.com/sjbarag) | ||
* [wehrstedt](https://www.github.com/wehrstedt) | ||
* [New Future](https://www.github.com/NewFuture) | ||
* [Leonard Thieu](https://www.github.com/leonard-thieu) | ||
* [Ryan McNeely](https://www.github.com/RMcNeely) | ||
* [Markus Wolf](https://www.github.com/KnisterPeter) | ||
* [Joshua Skrzypek](https://www.github.com/jskrzypek) | ||
* [Chad Engler](https://www.github.com/englercj) | ||
* [Morlay](https://www.github.com/morlay) | ||
* [Jeremy Danyow](https://www.github.com/jdanyow) |
import * as dom from "../lib/index" | ||
import { expect } from "chai"; | ||
// import { expect } from "chai"; | ||
@@ -4,0 +4,0 @@ describe("variable definition", () => { |
Sorry, the diff of this file is not supported yet
109956
2213
57