Skip to content

Commit a5f9e16

Browse files
authored
Remove ES6 lib duplication (#50)
1 parent 39945f2 commit a5f9e16

File tree

4 files changed

+5
-181
lines changed

4 files changed

+5
-181
lines changed

0.12/node.d.ts

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -80,14 +80,6 @@ interface ErrorConstructor {
8080
stackTraceLimit: number;
8181
}
8282

83-
// compat for TypeScript 1.5.3
84-
// if you use with --target es3 or --target es5 and use below definitions,
85-
// use the lib.es6.d.ts that is bundled with TypeScript 1.5.3.
86-
interface MapConstructor { }
87-
interface WeakMapConstructor { }
88-
interface SetConstructor { }
89-
interface WeakSetConstructor { }
90-
9183
/************************************************
9284
* *
9385
* GLOBAL *

4.0/node.d.ts

Lines changed: 0 additions & 86 deletions
Original file line numberDiff line numberDiff line change
@@ -80,92 +80,6 @@ interface ErrorConstructor {
8080
stackTraceLimit: number;
8181
}
8282

83-
// ES2015 collection types
84-
interface NodeCollection {
85-
size: number;
86-
}
87-
88-
interface NodeWeakCollection {}
89-
90-
interface IterableIterator<T> {}
91-
92-
interface NodeCollectionConstructor<T> {
93-
prototype: T;
94-
}
95-
96-
interface Map<K, V> extends NodeCollection {
97-
clear(): void;
98-
delete(key: K): boolean;
99-
entries(): Array<[K, V]>;
100-
forEach(callbackfn: (value: V, index: K, map: Map<K, V>) => void, thisArg?: any): void;
101-
get(key: K): V;
102-
has(key: K): boolean;
103-
keys(): Array<K>;
104-
set(key: K, value?: V): Map<K, V>;
105-
values(): Array<V>;
106-
// [Symbol.iterator]():Array<[K,V]>;
107-
// [Symbol.toStringTag]: "Map";
108-
}
109-
110-
interface MapConstructor extends NodeCollectionConstructor<Map<any, any>> {
111-
new (): Map<any, any>;
112-
new <K, V>(): Map<K, V>;
113-
}
114-
115-
declare var Map: MapConstructor;
116-
117-
interface WeakMap<K, V> extends NodeWeakCollection {
118-
clear(): void;
119-
delete(key: K): boolean;
120-
get(key: K): V | void;
121-
has(key: K): boolean;
122-
set(key: K, value?: V): WeakMap<K, V>;
123-
}
124-
125-
interface WeakMapConstructor extends NodeCollectionConstructor<WeakMap<any, any>> {
126-
new (): WeakMap<any, any>;
127-
new <K, V>(): WeakMap<K, V>;
128-
}
129-
130-
declare var WeakMap: WeakMapConstructor;
131-
132-
interface Set<T> extends NodeCollection {
133-
add(value: T): Set<T>;
134-
clear(): void;
135-
delete(value: T): boolean;
136-
entries(): Array<[T, T]>;
137-
forEach(callbackfn: (value: T, index: T, set: Set<T>) => void, thisArg?: any): void;
138-
has(value: T): boolean;
139-
keys(): Array<T>;
140-
values(): Array<T>;
141-
// [Symbol.iterator]():Array<T>;
142-
// [Symbol.toStringTag]: "Set";
143-
}
144-
145-
interface SetConstructor extends NodeCollectionConstructor<Set<any>> {
146-
new (): Set<any>;
147-
new <T>(): Set<T>;
148-
new <T>(iterable: Array<T>): Set<T>;
149-
}
150-
151-
declare var Set: SetConstructor;
152-
153-
interface WeakSet<T> extends NodeWeakCollection {
154-
add(value: T): WeakSet<T>;
155-
clear(): void;
156-
delete(value: T): boolean;
157-
has(value: T): boolean;
158-
// [Symbol.toStringTag]: "WeakSet";
159-
}
160-
161-
interface WeakSetConstructor extends NodeCollectionConstructor<WeakSet<any>> {
162-
new (): WeakSet<any>;
163-
new <T>(): WeakSet<T>;
164-
new <T>(iterable: Array<T>): WeakSet<T>;
165-
}
166-
167-
declare var WeakSet: WeakSetConstructor;
168-
16983
/************************************************
17084
* *
17185
* GLOBAL *

6.0/node.d.ts

Lines changed: 0 additions & 86 deletions
Original file line numberDiff line numberDiff line change
@@ -80,92 +80,6 @@ interface ErrorConstructor {
8080
stackTraceLimit: number;
8181
}
8282

83-
// ES2015 collection types
84-
interface NodeCollection {
85-
size: number;
86-
}
87-
88-
interface NodeWeakCollection {}
89-
90-
interface IterableIterator<T> {}
91-
92-
interface NodeCollectionConstructor<T> {
93-
prototype: T;
94-
}
95-
96-
interface Map<K, V> extends NodeCollection {
97-
clear(): void;
98-
delete(key: K): boolean;
99-
entries(): Array<[K, V]>;
100-
forEach(callbackfn: (value: V, index: K, map: Map<K, V>) => void, thisArg?: any): void;
101-
get(key: K): V;
102-
has(key: K): boolean;
103-
keys(): Array<K>;
104-
set(key: K, value?: V): Map<K, V>;
105-
values(): Array<V>;
106-
// [Symbol.iterator]():Array<[K,V]>;
107-
// [Symbol.toStringTag]: "Map";
108-
}
109-
110-
interface MapConstructor extends NodeCollectionConstructor<Map<any, any>> {
111-
new (): Map<any, any>;
112-
new <K, V>(): Map<K, V>;
113-
}
114-
115-
declare var Map: MapConstructor;
116-
117-
interface WeakMap<K, V> extends NodeWeakCollection {
118-
clear(): void;
119-
delete(key: K): boolean;
120-
get(key: K): V | void;
121-
has(key: K): boolean;
122-
set(key: K, value?: V): WeakMap<K, V>;
123-
}
124-
125-
interface WeakMapConstructor extends NodeCollectionConstructor<WeakMap<any, any>> {
126-
new (): WeakMap<any, any>;
127-
new <K, V>(): WeakMap<K, V>;
128-
}
129-
130-
declare var WeakMap: WeakMapConstructor;
131-
132-
interface Set<T> extends NodeCollection {
133-
add(value: T): Set<T>;
134-
clear(): void;
135-
delete(value: T): boolean;
136-
entries(): Array<[T, T]>;
137-
forEach(callbackfn: (value: T, index: T, set: Set<T>) => void, thisArg?: any): void;
138-
has(value: T): boolean;
139-
keys(): Array<T>;
140-
values(): Array<T>;
141-
// [Symbol.iterator]():Array<T>;
142-
// [Symbol.toStringTag]: "Set";
143-
}
144-
145-
interface SetConstructor extends NodeCollectionConstructor<Set<any>> {
146-
new (): Set<any>;
147-
new <T>(): Set<T>;
148-
new <T>(iterable: Array<T>): Set<T>;
149-
}
150-
151-
declare var Set: SetConstructor;
152-
153-
interface WeakSet<T> extends NodeWeakCollection {
154-
add(value: T): WeakSet<T>;
155-
clear(): void;
156-
delete(value: T): boolean;
157-
has(value: T): boolean;
158-
// [Symbol.toStringTag]: "WeakSet";
159-
}
160-
161-
interface WeakSetConstructor extends NodeCollectionConstructor<WeakSet<any>> {
162-
new (): WeakSet<any>;
163-
new <T>(): WeakSet<T>;
164-
new <T>(iterable: Array<T>): WeakSet<T>;
165-
}
166-
167-
declare var WeakSet: WeakSetConstructor;
168-
16983
/************************************************
17084
* *
17185
* GLOBAL *

README.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
1-
# Typings Env Node
1+
# Typings Env Node
22

33
[![Build Status](https://travis-ci.org/types/env-node.svg?branch=master)](https://travis-ci.org/types/env-node)
44

55
Typescript typings for [NodeJS](https://nodejs.org/).
6+
7+
## Usage
8+
9+
TypeScript has an option to set `lib` in `tsconfig.json` separately to `target`. You should use this option to get ES2015+ definitions in node v4 or higher.

0 commit comments

Comments
 (0)