source: frontend/node_modules/immer/dist/immer.d.ts

Last change on this file was 9af201e, checked in by MBK <marija.karapandzova@…>, 12 days ago

Fix frontend appearance

  • Property mode set to 100644
File size: 3.5 KB
Line 
1import { IProduce, IProduceWithPatches, Immer, Draft, Immutable } from "./internal";
2export { Draft, Immutable, Patch, PatchListener, original, current, isDraft, isDraftable, NOTHING as nothing, DRAFTABLE as immerable, freeze } from "./internal";
3/**
4 * The `produce` function takes a value and a "recipe function" (whose
5 * return value often depends on the base state). The recipe function is
6 * free to mutate its first argument however it wants. All mutations are
7 * only ever applied to a __copy__ of the base state.
8 *
9 * Pass only a function to create a "curried producer" which relieves you
10 * from passing the recipe function every time.
11 *
12 * Only plain objects and arrays are made mutable. All other objects are
13 * considered uncopyable.
14 *
15 * Note: This function is __bound__ to its `Immer` instance.
16 *
17 * @param {any} base - the initial state
18 * @param {Function} producer - function that receives a proxy of the base state as first argument and which can be freely modified
19 * @param {Function} patchListener - optional function that will be called with all the patches produced here
20 * @returns {any} a new state, or the initial state if nothing was modified
21 */
22export declare const produce: IProduce;
23export default produce;
24/**
25 * Like `produce`, but `produceWithPatches` always returns a tuple
26 * [nextState, patches, inversePatches] (instead of just the next state)
27 */
28export declare const produceWithPatches: IProduceWithPatches;
29/**
30 * Pass true to automatically freeze all copies created by Immer.
31 *
32 * Always freeze by default, even in production mode
33 */
34export declare const setAutoFreeze: (value: boolean) => void;
35/**
36 * Pass true to use the ES2015 `Proxy` class when creating drafts, which is
37 * always faster than using ES5 proxies.
38 *
39 * By default, feature detection is used, so calling this is rarely necessary.
40 */
41export declare const setUseProxies: (value: boolean) => void;
42/**
43 * Apply an array of Immer patches to the first argument.
44 *
45 * This function is a producer, which means copy-on-write is in effect.
46 */
47export declare const applyPatches: <T extends import("./internal").Objectish>(base: T, patches: import("./internal").Patch[]) => T;
48/**
49 * Create an Immer draft from the given base state, which may be a draft itself.
50 * The draft can be modified until you finalize it with the `finishDraft` function.
51 */
52export declare const createDraft: <T extends import("./internal").Objectish>(base: T) => Draft<T>;
53/**
54 * Finalize an Immer draft from a `createDraft` call, returning the base state
55 * (if no changes were made) or a modified copy. The draft must *not* be
56 * mutated afterwards.
57 *
58 * Pass a function as the 2nd argument to generate Immer patches based on the
59 * changes that were made.
60 */
61export declare const finishDraft: <D extends any>(draft: D, patchListener?: import("./internal").PatchListener | undefined) => D extends Draft<infer T> ? T : never;
62/**
63 * This function is actually a no-op, but can be used to cast an immutable type
64 * to an draft type and make TypeScript happy
65 *
66 * @param value
67 */
68export declare function castDraft<T>(value: T): Draft<T>;
69/**
70 * This function is actually a no-op, but can be used to cast a mutable type
71 * to an immutable type and make TypeScript happy
72 * @param value
73 */
74export declare function castImmutable<T>(value: T): Immutable<T>;
75export { Immer };
76export { enableES5 } from "./plugins/es5";
77export { enablePatches } from "./plugins/patches";
78export { enableMapSet } from "./plugins/mapset";
79export { enableAllPlugins } from "./plugins/all";
80//# sourceMappingURL=immer.d.ts.map
Note: See TracBrowser for help on using the repository browser.