-
Notifications
You must be signed in to change notification settings - Fork 0
/
fixd.d.ts
34 lines (32 loc) · 1.12 KB
/
fixd.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
declare const fixd: {
/**
* Deeply freezes an object
* @param {*} obj The object to freeze
* @returns {*}
*/
readonly freeze: (obj: any) => any;
/**
* Retrieves a value from the fixd library
* @param {Object} target Target object to retrieve from
* @param {String} name Property name to retrieve
* @returns {*} The value of the property
*/
readonly get: (target: any, name: string | symbol) => any;
/**
* Add a property to the fixd library and freezes if not in namespace
* @param {Object} obj The object to set
* @param {String} prop A string name to represent the fixture
* @param {*} value The value to set
* @returns {Boolean}
*/
readonly set: (obj: any, prop: string | symbol, value: any) => boolean;
/**
* Returns a fixture and allows for (option) modification
* @param {String} name The namespace of the fixture to mutate
* @param {Function} modifier A function to modify the fixture
* @returns {*} Unreferenced, immutable copy of object
*/
readonly create: (name: string | symbol, modifier: (obj: any) => any) => any;
[key: string]: any;
};
export = fixd