UNPKG

1.03 kBTypeScriptView Raw
1// Type definitions for define-properties 1.1
2// Project: https://github.com/ljharb/define-properties#readme
3// Definitions by: ExE Boss <https://github.com/ExE-Boss>
4// Jordan Harband <https://github.com/ljharb>
5// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
6// TypeScript Version: 2.3
7
8declare namespace defineProperties {
9 /**
10 * Whether the current environment correctly supports property descriptors.
11 */
12 const supportsDescriptors: boolean;
13}
14
15/**
16 * Defines new properties in `map` as non-enumerable if they don't already
17 * exist on `object`.
18 *
19 * @param object The object to define non-enumerable properties on.
20 * @param map The map of newly defined properties.
21 * @param predicates The optional predicates map, return `true` to override existing properties on `object`.
22 */
23declare function defineProperties<M extends object>(
24 object: object,
25 map: M & ThisType<any>,
26 predicates?: Partial<Record<keyof M, () => boolean>>,
27): void;
28export = defineProperties;