UNPKG

1.2 kBTypeScriptView Raw
1// Type definitions for object.getownpropertydescriptors 2.1
2// Project: https://github.com/ljharb/object.getownpropertydescriptors#readme
3// Definitions by: Vitor Luiz Cavalcanti <https://github.com/VitorLuizC>
4// Jordan Harband <https://github.com/ljharb>
5// ExE Boss <https://github.com/ExE-Boss>
6// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
7
8import polyfill = require("./implementation");
9import getImpl = require("./polyfill");
10import shimImpl = require("./shim");
11
12/**
13 * Returns an object containing all own property descriptors of an object
14 * @param o Object that contains the properties and methods. This can be an object that you created or an existing Document Object Model (DOM) object.
15 */
16declare function getOwnPropertyDescriptors<T>(
17 o: T,
18):
19 & {
20 -readonly [P in keyof T]: TypedPropertyDescriptor<T[P]>;
21 }
22 & {
23 [property: string]: PropertyDescriptor;
24 };
25
26declare namespace getOwnPropertyDescriptors {
27 function getPolyfill(): ReturnType<typeof getImpl>;
28 const implementation: typeof polyfill;
29 function shim(): ReturnType<typeof shimImpl>;
30}
31
32export = getOwnPropertyDescriptors;