UNPKG

1.17 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 -readonly [P in keyof T]: TypedPropertyDescriptor<T[P]>;
20} & {
21 [property: string]: PropertyDescriptor;
22};
23
24declare namespace getOwnPropertyDescriptors {
25 function getPolyfill(): ReturnType<typeof getImpl>;
26 const implementation: typeof polyfill;
27 function shim(): ReturnType<typeof shimImpl>;
28}
29
30export = getOwnPropertyDescriptors;