mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-05-10 09:40:21 +08:00
es6-shim: Avoid conflict with global PropertyKey type (#25421)
This commit is contained in:
@@ -17,7 +17,7 @@ let r: RegExp = /a/;
|
||||
let sym: symbol = {} as symbol;
|
||||
let e: Error = new Error();
|
||||
let date: Date;
|
||||
let key: PropertyKey;
|
||||
let key: KeyOfProperty;
|
||||
let point: Point = { x: 1, y: 2 };
|
||||
let point3d: Point3D = { x: 1, y: 2, z: 3 };
|
||||
let point3dOrUndef: Point3D | undefined;
|
||||
@@ -25,7 +25,7 @@ let pointOrUndef: Point | undefined;
|
||||
let arrayOfPoint: Point[] = [];
|
||||
let arrayOfPoint3D: Point3D[];
|
||||
let arrayOfSymbol: symbol[];
|
||||
let arrayOfPropertyKey: PropertyKey[];
|
||||
let arrayOfPropertyKey: KeyOfProperty[];
|
||||
let arrayOfAny: any[];
|
||||
let arrayOfStringAny: [string, any][];
|
||||
let arrayLikeOfAny: ArrayLike<any> = [];
|
||||
@@ -40,8 +40,8 @@ let iterableIteratorOfPointPoint: IterableIteratorShim<[Point, Point]>;
|
||||
let iterableIteratorOfNode: IterableIteratorShim<Node>;
|
||||
let iterableIteratorOfStringPoint: IterableIteratorShim<[string, Point]>;
|
||||
let iterableIteratorOfAny: IterableIteratorShim<any>;
|
||||
let iterableIteratorOfPropertyKey: IterableIteratorShim<PropertyKey>;
|
||||
let iterableIteratorOfPropertyKeyPoint: IterableIteratorShim<[PropertyKey, Point]>;
|
||||
let iterableIteratorOfPropertyKey: IterableIteratorShim<KeyOfProperty>;
|
||||
let iterableIteratorOfPropertyKeyPoint: IterableIteratorShim<[KeyOfProperty, Point]>;
|
||||
let nodeList: NodeList;
|
||||
let pd: PropertyDescriptor = {};
|
||||
let pdm: PropertyDescriptorMap = {};
|
||||
|
||||
31
types/es6-shim/index.d.ts
vendored
31
types/es6-shim/index.d.ts
vendored
@@ -4,7 +4,8 @@
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.2
|
||||
|
||||
declare type PropertyKey = string | number | symbol;
|
||||
// TODO: As of TypeScript@2.9 there is a global type PropertyKey that should be used instead of this.
|
||||
declare type KeyOfProperty = string | number | symbol;
|
||||
|
||||
interface IteratorResult<T> {
|
||||
done: boolean;
|
||||
@@ -625,17 +626,17 @@ declare var WeakSet: WeakSetConstructor;
|
||||
declare namespace Reflect {
|
||||
function apply(target: Function, thisArgument: any, argumentsList: ArrayLike<any>): any;
|
||||
function construct(target: Function, argumentsList: ArrayLike<any>): any;
|
||||
function defineProperty(target: any, propertyKey: PropertyKey, attributes: PropertyDescriptor): boolean;
|
||||
function deleteProperty(target: any, propertyKey: PropertyKey): boolean;
|
||||
function defineProperty(target: any, propertyKey: KeyOfProperty, attributes: PropertyDescriptor): boolean;
|
||||
function deleteProperty(target: any, propertyKey: KeyOfProperty): boolean;
|
||||
function enumerate(target: any): IterableIteratorShim<any>;
|
||||
function get(target: any, propertyKey: PropertyKey, receiver?: any): any;
|
||||
function getOwnPropertyDescriptor(target: any, propertyKey: PropertyKey): PropertyDescriptor;
|
||||
function get(target: any, propertyKey: KeyOfProperty, receiver?: any): any;
|
||||
function getOwnPropertyDescriptor(target: any, propertyKey: KeyOfProperty): PropertyDescriptor;
|
||||
function getPrototypeOf(target: any): any;
|
||||
function has(target: any, propertyKey: PropertyKey): boolean;
|
||||
function has(target: any, propertyKey: KeyOfProperty): boolean;
|
||||
function isExtensible(target: any): boolean;
|
||||
function ownKeys(target: any): Array<PropertyKey>;
|
||||
function ownKeys(target: any): Array<KeyOfProperty>;
|
||||
function preventExtensions(target: any): boolean;
|
||||
function set(target: any, propertyKey: PropertyKey, value: any, receiver?: any): boolean;
|
||||
function set(target: any, propertyKey: KeyOfProperty, value: any, receiver?: any): boolean;
|
||||
function setPrototypeOf(target: any, proto: any): boolean;
|
||||
}
|
||||
|
||||
@@ -653,17 +654,17 @@ declare module "es6-shim" {
|
||||
namespace Reflect {
|
||||
function apply(target: Function, thisArgument: any, argumentsList: ArrayLike<any>): any;
|
||||
function construct(target: Function, argumentsList: ArrayLike<any>): any;
|
||||
function defineProperty(target: any, propertyKey: PropertyKey, attributes: PropertyDescriptor): boolean;
|
||||
function deleteProperty(target: any, propertyKey: PropertyKey): boolean;
|
||||
function defineProperty(target: any, propertyKey: KeyOfProperty, attributes: PropertyDescriptor): boolean;
|
||||
function deleteProperty(target: any, propertyKey: KeyOfProperty): boolean;
|
||||
function enumerate(target: any): Iterator<any>;
|
||||
function get(target: any, propertyKey: PropertyKey, receiver?: any): any;
|
||||
function getOwnPropertyDescriptor(target: any, propertyKey: PropertyKey): PropertyDescriptor;
|
||||
function get(target: any, propertyKey: KeyOfProperty, receiver?: any): any;
|
||||
function getOwnPropertyDescriptor(target: any, propertyKey: KeyOfProperty): PropertyDescriptor;
|
||||
function getPrototypeOf(target: any): any;
|
||||
function has(target: any, propertyKey: PropertyKey): boolean;
|
||||
function has(target: any, propertyKey: KeyOfProperty): boolean;
|
||||
function isExtensible(target: any): boolean;
|
||||
function ownKeys(target: any): Array<PropertyKey>;
|
||||
function ownKeys(target: any): Array<KeyOfProperty>;
|
||||
function preventExtensions(target: any): boolean;
|
||||
function set(target: any, propertyKey: PropertyKey, value: any, receiver?: any): boolean;
|
||||
function set(target: any, propertyKey: KeyOfProperty, value: any, receiver?: any): boolean;
|
||||
function setPrototypeOf(target: any, proto: any): boolean;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user