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

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

Fix frontend appearance

  • Property mode set to 100644
File size: 2.3 KB
Line 
1import { ImmerState, Patch, ImmerScope, Drafted, AnyObject, ImmerBaseState, AnyMap, AnySet, ProxyType } from "../internal";
2/** Plugin utilities */
3declare const plugins: {
4 Patches?: {
5 generatePatches_(state: ImmerState, basePath: PatchPath, patches: Patch[], inversePatches: Patch[]): void;
6 generateReplacementPatches_(base: any, replacement: any, patches: Patch[], inversePatches: Patch[]): void;
7 applyPatches_<T>(draft: T, patches: Patch[]): T;
8 };
9 ES5?: {
10 willFinalizeES5_(scope: ImmerScope, result: any, isReplaced: boolean): void;
11 createES5Proxy_<T>(base: T, parent?: ImmerState): Drafted<T, ES5ObjectState | ES5ArrayState>;
12 hasChanges_(state: ES5ArrayState | ES5ObjectState): boolean;
13 };
14 MapSet?: {
15 proxyMap_<T extends AnyMap>(target: T, parent?: ImmerState): T;
16 proxySet_<T extends AnySet>(target: T, parent?: ImmerState): T;
17 };
18};
19declare type Plugins = typeof plugins;
20export declare function getPlugin<K extends keyof Plugins>(pluginKey: K): Exclude<Plugins[K], undefined>;
21export declare function loadPlugin<K extends keyof Plugins>(pluginKey: K, implementation: Plugins[K]): void;
22/** ES5 Plugin */
23interface ES5BaseState extends ImmerBaseState {
24 assigned_: {
25 [key: string]: any;
26 };
27 parent_?: ImmerState;
28 revoked_: boolean;
29}
30export interface ES5ObjectState extends ES5BaseState {
31 type_: ProxyType.ES5Object;
32 draft_: Drafted<AnyObject, ES5ObjectState>;
33 base_: AnyObject;
34 copy_: AnyObject | null;
35}
36export interface ES5ArrayState extends ES5BaseState {
37 type_: ProxyType.ES5Array;
38 draft_: Drafted<AnyObject, ES5ArrayState>;
39 base_: any;
40 copy_: any;
41}
42/** Map / Set plugin */
43export interface MapState extends ImmerBaseState {
44 type_: ProxyType.Map;
45 copy_: AnyMap | undefined;
46 assigned_: Map<any, boolean> | undefined;
47 base_: AnyMap;
48 revoked_: boolean;
49 draft_: Drafted<AnyMap, MapState>;
50}
51export interface SetState extends ImmerBaseState {
52 type_: ProxyType.Set;
53 copy_: AnySet | undefined;
54 base_: AnySet;
55 drafts_: Map<any, Drafted>;
56 revoked_: boolean;
57 draft_: Drafted<AnySet, SetState>;
58}
59/** Patches plugin */
60export declare type PatchPath = (string | number)[];
61export {};
62//# sourceMappingURL=plugins.d.ts.map
Note: See TracBrowser for help on using the repository browser.