-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.d.ts
31 lines (26 loc) · 879 Bytes
/
index.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
declare namespace pureMutation {
interface MutatorOps {
/**
* Assign in-place given values to the input ref
*/
assign?: (inputRef: Object, values: Object) => void;
/**
* Exclude in-place given keys from the input ref
*/
exclude?: (inputRef: Object, keys: String[]) => void;
}
type NonPureFn = (input: Object) => void;
/**
* Mutate input using given pure function
*/
export function mutate(inputRef: Object, using: Function, mutatorOps?: MutatorOps): void;
/**
* Creates a non-pure function from given pure function
*
* Created function should receive an {Object} as a first argument.
* This object will be passed to the wrapped pure function,
* the results will be merged back to the input object.
*/
export function unpure(fn: Function, mutatorOps?: MutatorOps): NonPureFn;
}
export = pureMutation;