scope.d.ts 746 B

123456789101112131415161718
  1. import { Patch, PatchListener, Immer } from "../internal";
  2. /** Each scope represents a `produce` call. */
  3. export interface ImmerScope {
  4. patches_?: Patch[];
  5. inversePatches_?: Patch[];
  6. canAutoFreeze_: boolean;
  7. drafts_: any[];
  8. parent_?: ImmerScope;
  9. patchListener_?: PatchListener;
  10. immer_: Immer;
  11. unfinalizedDrafts_: number;
  12. }
  13. export declare function getCurrentScope(): ImmerScope;
  14. export declare function usePatchesInScope(scope: ImmerScope, patchListener?: PatchListener): void;
  15. export declare function revokeScope(scope: ImmerScope): void;
  16. export declare function leaveScope(scope: ImmerScope): void;
  17. export declare function enterScope(immer: Immer): ImmerScope;
  18. //# sourceMappingURL=scope.d.ts.map