Skip to content

Commit

Permalink
Merge pull request microsoft#13350 from HerringtonDarkholme/lib
Browse files Browse the repository at this point in the history
update declaration file to use intrinsic object type
  • Loading branch information
sandersn authored Jan 27, 2017
2 parents a67b80d + e8af1d2 commit aeeff28
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 12 deletions.
4 changes: 2 additions & 2 deletions src/lib/es2015.collection.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ interface ReadonlyMap<K, V> {
readonly size: number;
}

interface WeakMap<K, V> {
interface WeakMap<K extends object, V> {
delete(key: K): boolean;
get(key: K): V | undefined;
has(key: K): boolean;
Expand All @@ -31,7 +31,7 @@ interface WeakMap<K, V> {

interface WeakMapConstructor {
new (): WeakMap<any, any>;
new <K, V>(entries?: [K, V][]): WeakMap<K, V>;
new <K extends object, V>(entries?: [K, V][]): WeakMap<K, V>;
readonly prototype: WeakMap<any, any>;
}
declare var WeakMap: WeakMapConstructor;
Expand Down
2 changes: 1 addition & 1 deletion src/lib/es2015.core.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,7 @@ interface ObjectConstructor {
* @param o The object to change its prototype.
* @param proto The value of the new prototype or null.
*/
setPrototypeOf(o: any, proto: any): any;
setPrototypeOf(o: any, proto: object | null): any;

/**
* Gets the own property descriptor of the specified object.
Expand Down
6 changes: 3 additions & 3 deletions src/lib/es2015.iterable.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -99,10 +99,10 @@ interface MapConstructor {
new <K, V>(iterable: Iterable<[K, V]>): Map<K, V>;
}

interface WeakMap<K, V> { }
interface WeakMap<K extends object, V> { }

interface WeakMapConstructor {
new <K, V>(iterable: Iterable<[K, V]>): WeakMap<K, V>;
new <K extends object, V>(iterable: Iterable<[K, V]>): WeakMap<K, V>;
}

interface Set<T> {
Expand Down Expand Up @@ -442,4 +442,4 @@ interface Float64ArrayConstructor {
* @param thisArg Value of 'this' used to invoke the mapfn.
*/
from(arrayLike: Iterable<number>, mapfn?: (v: number, k: number) => number, thisArg?: any): Float64Array;
}
}
4 changes: 2 additions & 2 deletions src/lib/es2015.proxy.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
interface ProxyHandler<T> {
getPrototypeOf? (target: T): {} | null;
getPrototypeOf? (target: T): object | null;
setPrototypeOf? (target: T, v: any): boolean;
isExtensible? (target: T): boolean;
preventExtensions? (target: T): boolean;
Expand All @@ -12,7 +12,7 @@ interface ProxyHandler<T> {
enumerate? (target: T): PropertyKey[];
ownKeys? (target: T): PropertyKey[];
apply? (target: T, thisArg: any, argArray?: any): any;
construct? (target: T, argArray: any, newTarget?: any): {};
construct? (target: T, argArray: any, newTarget?: any): object
}

interface ProxyConstructor {
Expand Down
4 changes: 2 additions & 2 deletions src/lib/es2015.symbol.wellknown.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ interface Map<K, V> {
readonly [Symbol.toStringTag]: "Map";
}

interface WeakMap<K, V>{
interface WeakMap<K extends object, V>{
readonly [Symbol.toStringTag]: "WeakMap";
}

Expand Down Expand Up @@ -324,4 +324,4 @@ interface Float32Array {
*/
interface Float64Array {
readonly [Symbol.toStringTag]: "Float64Array";
}
}
4 changes: 2 additions & 2 deletions src/lib/es5.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -146,14 +146,14 @@ interface ObjectConstructor {
* Creates an object that has the specified prototype, and that optionally contains specified properties.
* @param o Object to use as a prototype. May be null
*/
create<T>(o: T): T;
create<T extends object>(o: T): T;

/**
* Creates an object that has the specified prototype, and that optionally contains specified properties.
* @param o Object to use as a prototype. May be null
* @param properties JavaScript object that contains one or more property descriptors.
*/
create(o: any, properties: PropertyDescriptorMap): any;
create(o: object | null, properties: PropertyDescriptorMap): any;

/**
* Adds a property to an object, or modifies attributes of an existing property.
Expand Down

0 comments on commit aeeff28

Please sign in to comment.