@buoy-gg/time-machine 7.0.17
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +58 -0
- package/README.md +55 -0
- package/lib/commonjs/components/TimeMachineBody.js +420 -0
- package/lib/commonjs/components/TimeMachineBody.js.map +1 -0
- package/lib/commonjs/components/TimeMachineModal.js +74 -0
- package/lib/commonjs/components/TimeMachineModal.js.map +1 -0
- package/lib/commonjs/hooks/useTimeMachine.js +24 -0
- package/lib/commonjs/hooks/useTimeMachine.js.map +1 -0
- package/lib/commonjs/index.js +64 -0
- package/lib/commonjs/index.js.map +1 -0
- package/lib/commonjs/package.json +1 -0
- package/lib/commonjs/preset.js +45 -0
- package/lib/commonjs/preset.js.map +1 -0
- package/lib/commonjs/store/snapshotVault.js +83 -0
- package/lib/commonjs/store/snapshotVault.js.map +1 -0
- package/lib/commonjs/store/timeMachineStore.js +335 -0
- package/lib/commonjs/store/timeMachineStore.js.map +1 -0
- package/lib/commonjs/sync/timeMachineSyncAdapter.js +139 -0
- package/lib/commonjs/sync/timeMachineSyncAdapter.js.map +1 -0
- package/lib/module/components/TimeMachineBody.js +415 -0
- package/lib/module/components/TimeMachineBody.js.map +1 -0
- package/lib/module/components/TimeMachineModal.js +68 -0
- package/lib/module/components/TimeMachineModal.js.map +1 -0
- package/lib/module/hooks/useTimeMachine.js +19 -0
- package/lib/module/hooks/useTimeMachine.js.map +1 -0
- package/lib/module/index.js +29 -0
- package/lib/module/index.js.map +1 -0
- package/lib/module/preset.js +40 -0
- package/lib/module/preset.js.map +1 -0
- package/lib/module/store/snapshotVault.js +74 -0
- package/lib/module/store/snapshotVault.js.map +1 -0
- package/lib/module/store/timeMachineStore.js +327 -0
- package/lib/module/store/timeMachineStore.js.map +1 -0
- package/lib/module/sync/timeMachineSyncAdapter.js +134 -0
- package/lib/module/sync/timeMachineSyncAdapter.js.map +1 -0
- package/lib/typescript/components/TimeMachineBody.d.ts +2 -0
- package/lib/typescript/components/TimeMachineBody.d.ts.map +1 -0
- package/lib/typescript/components/TimeMachineModal.d.ts +12 -0
- package/lib/typescript/components/TimeMachineModal.d.ts.map +1 -0
- package/lib/typescript/hooks/useTimeMachine.d.ts +6 -0
- package/lib/typescript/hooks/useTimeMachine.d.ts.map +1 -0
- package/lib/typescript/index.d.ts +18 -0
- package/lib/typescript/index.d.ts.map +1 -0
- package/lib/typescript/preset.d.ts +38 -0
- package/lib/typescript/preset.d.ts.map +1 -0
- package/lib/typescript/store/snapshotVault.d.ts +46 -0
- package/lib/typescript/store/snapshotVault.d.ts.map +1 -0
- package/lib/typescript/store/timeMachineStore.d.ts +97 -0
- package/lib/typescript/store/timeMachineStore.d.ts.map +1 -0
- package/lib/typescript/sync/timeMachineSyncAdapter.d.ts +59 -0
- package/lib/typescript/sync/timeMachineSyncAdapter.d.ts.map +1 -0
- package/package.json +59 -0
- package/src/components/TimeMachineBody.tsx +455 -0
- package/src/components/TimeMachineModal.tsx +75 -0
- package/src/hooks/useTimeMachine.ts +26 -0
- package/src/index.tsx +45 -0
- package/src/preset.tsx +38 -0
- package/src/store/snapshotVault.ts +117 -0
- package/src/store/timeMachineStore.ts +368 -0
- package/src/sync/timeMachineSyncAdapter.ts +128 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TimeMachineBody.d.ts","sourceRoot":"","sources":["../../../src/components/TimeMachineBody.tsx"],"names":[],"mappings":"AA0GA,wBAAgB,eAAe,gCAkL9B"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { ModalState } from "@buoy-gg/shared-ui";
|
|
2
|
+
export interface TimeMachineModalProps {
|
|
3
|
+
visible: boolean;
|
|
4
|
+
onClose: () => void;
|
|
5
|
+
onBack?: () => void;
|
|
6
|
+
onMinimize?: (modalState: ModalState) => void;
|
|
7
|
+
persistenceKey?: string;
|
|
8
|
+
}
|
|
9
|
+
export declare function TimeMachineModal({ visible, onClose, onBack: _onBack, onMinimize, persistenceKey, }: TimeMachineModalProps): import("react").JSX.Element;
|
|
10
|
+
/** Inline variant (no modal chrome) — used by Buoy Desktop. */
|
|
11
|
+
export declare function TimeMachineToolView(): import("react").JSX.Element;
|
|
12
|
+
//# sourceMappingURL=TimeMachineModal.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TimeMachineModal.d.ts","sourceRoot":"","sources":["../../../src/components/TimeMachineModal.tsx"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAGrD,MAAM,WAAW,qBAAqB;IACpC,OAAO,EAAE,OAAO,CAAC;IACjB,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;IACpB,UAAU,CAAC,EAAE,CAAC,UAAU,EAAE,UAAU,KAAK,IAAI,CAAC;IAC9C,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAWD,wBAAgB,gBAAgB,CAAC,EAC/B,OAAO,EACP,OAAO,EACP,MAAM,EAAE,OAAO,EACf,UAAU,EACV,cAAc,GACf,EAAE,qBAAqB,+BAiBvB;AAED,+DAA+D;AAC/D,wBAAgB,mBAAmB,gCAElC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { type StateSnapshotProvider } from "@buoy-gg/shared-ui";
|
|
2
|
+
import type { TimeMachineState } from "../store/timeMachineStore";
|
|
3
|
+
export declare function useTimeMachineState(): TimeMachineState;
|
|
4
|
+
/** Registered snapshot providers (query registers late, hence the subscribe). */
|
|
5
|
+
export declare function useSnapshotProviders(): StateSnapshotProvider[];
|
|
6
|
+
//# sourceMappingURL=useTimeMachine.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useTimeMachine.d.ts","sourceRoot":"","sources":["../../../src/hooks/useTimeMachine.ts"],"names":[],"mappings":"AACA,OAAO,EAGL,KAAK,qBAAqB,EAC3B,MAAM,oBAAoB,CAAC;AAE5B,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAElE,wBAAgB,mBAAmB,IAAI,gBAAgB,CAItD;AAED,iFAAiF;AACjF,wBAAgB,oBAAoB,IAAI,qBAAqB,EAAE,CAS9D"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @buoy-gg/time-machine
|
|
3
|
+
*
|
|
4
|
+
* Time Machine — snapshot & restore app state for React Native DevTools.
|
|
5
|
+
*
|
|
6
|
+
* Capture the complete client-side state of the app (storage, Redux,
|
|
7
|
+
* Zustand, Jotai, React Query) as a named snapshot; restore any snapshot in
|
|
8
|
+
* one tap to iterate on multi-step test flows without rebuilding state.
|
|
9
|
+
*
|
|
10
|
+
* PUBLIC API - Only these exports are supported for external use.
|
|
11
|
+
*/
|
|
12
|
+
export { timeMachineToolPreset, createTimeMachineTool } from "./preset";
|
|
13
|
+
export { TimeMachineModal, TimeMachineToolView, type TimeMachineModalProps, } from "./components/TimeMachineModal";
|
|
14
|
+
export { timeMachineSyncAdapter } from "./sync/timeMachineSyncAdapter";
|
|
15
|
+
export { timeMachineStore, RESTORE_ORDER, type RestoreMode, type RestoreOutcome, type TimeMachineState, type RemoteProviderStatus, } from "./store/timeMachineStore";
|
|
16
|
+
export { setRemoteTimeMachineHandler, replaceTimeMachineFromSnapshot, } from "./store/timeMachineStore";
|
|
17
|
+
export type { SnapshotMeta, SnapshotSourceMeta, StoredSnapshot, } from "./store/snapshotVault";
|
|
18
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAGH,OAAO,EAAE,qBAAqB,EAAE,qBAAqB,EAAE,MAAM,UAAU,CAAC;AAGxE,OAAO,EACL,gBAAgB,EAChB,mBAAmB,EACnB,KAAK,qBAAqB,GAC3B,MAAM,+BAA+B,CAAC;AAGvC,OAAO,EAAE,sBAAsB,EAAE,MAAM,+BAA+B,CAAC;AAGvE,OAAO,EACL,gBAAgB,EAChB,aAAa,EACb,KAAK,WAAW,EAChB,KAAK,cAAc,EACnB,KAAK,gBAAgB,EACrB,KAAK,oBAAoB,GAC1B,MAAM,0BAA0B,CAAC;AAGlC,OAAO,EACL,2BAA2B,EAC3B,8BAA8B,GAC/B,MAAM,0BAA0B,CAAC;AAClC,YAAY,EACV,YAAY,EACZ,kBAAkB,EAClB,cAAc,GACf,MAAM,uBAAuB,CAAC"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Pre-configured Time Machine tool for FloatingDevTools.
|
|
3
|
+
*
|
|
4
|
+
* @example
|
|
5
|
+
* ```tsx
|
|
6
|
+
* import { timeMachineToolPreset } from '@buoy-gg/time-machine';
|
|
7
|
+
*
|
|
8
|
+
* <FloatingDevTools apps={[timeMachineToolPreset]} />
|
|
9
|
+
* ```
|
|
10
|
+
*/
|
|
11
|
+
import { TimeMachineModal } from "./components/TimeMachineModal";
|
|
12
|
+
export declare const timeMachineToolPreset: {
|
|
13
|
+
id: string;
|
|
14
|
+
name: string;
|
|
15
|
+
description: string;
|
|
16
|
+
slot: "both";
|
|
17
|
+
icon: ({ size, color }: {
|
|
18
|
+
size: number;
|
|
19
|
+
color?: string;
|
|
20
|
+
}) => import("react").JSX.Element;
|
|
21
|
+
component: typeof TimeMachineModal;
|
|
22
|
+
};
|
|
23
|
+
/** Create a custom Time Machine tool configuration. */
|
|
24
|
+
export declare function createTimeMachineTool(options?: {
|
|
25
|
+
name?: string;
|
|
26
|
+
description?: string;
|
|
27
|
+
}): {
|
|
28
|
+
name: string;
|
|
29
|
+
description: string;
|
|
30
|
+
id: string;
|
|
31
|
+
slot: "both";
|
|
32
|
+
icon: ({ size, color }: {
|
|
33
|
+
size: number;
|
|
34
|
+
color?: string;
|
|
35
|
+
}) => import("react").JSX.Element;
|
|
36
|
+
component: typeof TimeMachineModal;
|
|
37
|
+
};
|
|
38
|
+
//# sourceMappingURL=preset.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"preset.d.ts","sourceRoot":"","sources":["../../src/preset.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAMH,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAEjE,eAAO,MAAM,qBAAqB;;;;;4BAKR;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAA;KAAE;;CAIzD,CAAC;AAEF,uDAAuD;AACvD,wBAAgB,qBAAqB,CACnC,OAAO,GAAE;IAAE,IAAI,CAAC,EAAE,MAAM,CAAC;IAAC,WAAW,CAAC,EAAE,MAAM,CAAA;CAAO;;;;;4BAR7B;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAA;KAAE;;EAezD"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Snapshot persistence for Time Machine.
|
|
3
|
+
*
|
|
4
|
+
* Snapshots live ON-DEVICE in persistentStorage (FileSystem → AsyncStorage →
|
|
5
|
+
* localStorage → Memory fallback): no size caps, survives restarts, and never
|
|
6
|
+
* crosses the 2MB external-sync snapshot budget — only metadata does.
|
|
7
|
+
*
|
|
8
|
+
* Layout: ONE storage key per snapshot (persistentStorage's FileSystem
|
|
9
|
+
* backend writes one file per key, and its multiGet is sequential — a single
|
|
10
|
+
* big key beats many small ones), plus one index key holding the metadata
|
|
11
|
+
* list for cheap listing.
|
|
12
|
+
*
|
|
13
|
+
* Keys use the `@react_buoy` family so every tool's isDevToolsStorageKey
|
|
14
|
+
* filter (including our own storage provider) excludes the vault itself from
|
|
15
|
+
* snapshots — a snapshot must never contain snapshots.
|
|
16
|
+
*/
|
|
17
|
+
import { type SuperJSONResult } from "@buoy-gg/shared-ui";
|
|
18
|
+
export interface SnapshotSourceMeta {
|
|
19
|
+
warnings: string[];
|
|
20
|
+
}
|
|
21
|
+
export interface SnapshotMeta {
|
|
22
|
+
id: string;
|
|
23
|
+
name: string;
|
|
24
|
+
createdAt: number;
|
|
25
|
+
/** Serialized size of the whole stored snapshot. */
|
|
26
|
+
sizeBytes: number;
|
|
27
|
+
/**
|
|
28
|
+
* A baseline snapshot has NO captured data — restoring it wipes to
|
|
29
|
+
* fresh-install state (clear + reload).
|
|
30
|
+
*/
|
|
31
|
+
baseline?: boolean;
|
|
32
|
+
/** Source ids captured, with their capture warnings. */
|
|
33
|
+
sources: Record<string, SnapshotSourceMeta>;
|
|
34
|
+
}
|
|
35
|
+
export interface StoredSnapshot {
|
|
36
|
+
meta: SnapshotMeta;
|
|
37
|
+
/** Per-source superjson payloads (absent for baseline snapshots). */
|
|
38
|
+
data: Record<string, SuperJSONResult>;
|
|
39
|
+
}
|
|
40
|
+
export declare function loadIndex(): Promise<SnapshotMeta[]>;
|
|
41
|
+
/** Persists the snapshot, stamps meta.sizeBytes, and updates the index. */
|
|
42
|
+
export declare function saveSnapshot(snapshot: StoredSnapshot, metas: SnapshotMeta[]): Promise<SnapshotMeta[]>;
|
|
43
|
+
export declare function loadSnapshot(id: string): Promise<StoredSnapshot | null>;
|
|
44
|
+
export declare function deleteSnapshot(id: string, metas: SnapshotMeta[]): Promise<SnapshotMeta[]>;
|
|
45
|
+
export declare function renameSnapshot(id: string, name: string, metas: SnapshotMeta[]): Promise<SnapshotMeta[]>;
|
|
46
|
+
//# sourceMappingURL=snapshotVault.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"snapshotVault.d.ts","sourceRoot":"","sources":["../../../src/store/snapshotVault.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AACH,OAAO,EAEL,KAAK,eAAe,EACrB,MAAM,oBAAoB,CAAC;AAK5B,MAAM,WAAW,kBAAkB;IACjC,QAAQ,EAAE,MAAM,EAAE,CAAC;CACpB;AAED,MAAM,WAAW,YAAY;IAC3B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,CAAC;IAClB,oDAAoD;IACpD,SAAS,EAAE,MAAM,CAAC;IAClB;;;OAGG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,wDAAwD;IACxD,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,kBAAkB,CAAC,CAAC;CAC7C;AAED,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,YAAY,CAAC;IACnB,qEAAqE;IACrE,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,eAAe,CAAC,CAAC;CACvC;AAED,wBAAsB,SAAS,IAAI,OAAO,CAAC,YAAY,EAAE,CAAC,CASzD;AAMD,2EAA2E;AAC3E,wBAAsB,YAAY,CAChC,QAAQ,EAAE,cAAc,EACxB,KAAK,EAAE,YAAY,EAAE,GACpB,OAAO,CAAC,YAAY,EAAE,CAAC,CAczB;AAED,wBAAsB,YAAY,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,GAAG,IAAI,CAAC,CAO7E;AAED,wBAAsB,cAAc,CAClC,EAAE,EAAE,MAAM,EACV,KAAK,EAAE,YAAY,EAAE,GACpB,OAAO,CAAC,YAAY,EAAE,CAAC,CAKzB;AAED,wBAAsB,cAAc,CAClC,EAAE,EAAE,MAAM,EACV,IAAI,EAAE,MAAM,EACZ,KAAK,EAAE,YAAY,EAAE,GACpB,OAAO,CAAC,YAAY,EAAE,CAAC,CASzB"}
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Time Machine orchestrator — snapshot CRUD + capture/restore across every
|
|
3
|
+
* registered StateSnapshotProvider (storage, redux, zustand, jotai, query,
|
|
4
|
+
* plus any custom providers the app registers).
|
|
5
|
+
*
|
|
6
|
+
* Restore ordering is fixed: persisted storage FIRST (so store persist
|
|
7
|
+
* middleware writing through after an in-memory restore converges with what
|
|
8
|
+
* we just wrote), then redux → zustand → jotai, query LAST (restored queries
|
|
9
|
+
* may derive from store state). Custom providers run after, in data order.
|
|
10
|
+
*
|
|
11
|
+
* Two restore modes:
|
|
12
|
+
* - "live": in-place state replacement, capability-gated per source.
|
|
13
|
+
* - "reload": restore ONLY persisted storage, then reload the JS bundle —
|
|
14
|
+
* in-memory stores rebuild themselves from the restored storage.
|
|
15
|
+
* Baseline snapshots always use this path (clear + reload).
|
|
16
|
+
*/
|
|
17
|
+
import { type StateSnapshotRestoreResult } from "@buoy-gg/shared-ui";
|
|
18
|
+
import { type SnapshotMeta } from "./snapshotVault";
|
|
19
|
+
export declare const RESTORE_ORDER: string[];
|
|
20
|
+
export type RestoreMode = "live" | "reload";
|
|
21
|
+
export interface RestoreOutcome {
|
|
22
|
+
snapshotId: string;
|
|
23
|
+
snapshotName: string;
|
|
24
|
+
mode: RestoreMode;
|
|
25
|
+
at: number;
|
|
26
|
+
/** True when a JS reload was scheduled as part of this restore. */
|
|
27
|
+
willReload: boolean;
|
|
28
|
+
results: Record<string, StateSnapshotRestoreResult>;
|
|
29
|
+
}
|
|
30
|
+
/** Provider capability row as mirrored to a remote dashboard. */
|
|
31
|
+
export interface RemoteProviderStatus {
|
|
32
|
+
id: string;
|
|
33
|
+
label: string;
|
|
34
|
+
canCapture: boolean;
|
|
35
|
+
canRestore: boolean;
|
|
36
|
+
detail?: string;
|
|
37
|
+
}
|
|
38
|
+
export interface TimeMachineState {
|
|
39
|
+
snapshots: SnapshotMeta[];
|
|
40
|
+
hasLoaded: boolean;
|
|
41
|
+
busy: "capture" | "restore" | null;
|
|
42
|
+
lastOutcome: RestoreOutcome | null;
|
|
43
|
+
/**
|
|
44
|
+
* Non-null when this store is a REMOTE MIRROR (Buoy Desktop): provider
|
|
45
|
+
* statuses come from the device's sync payload instead of the local
|
|
46
|
+
* registry, and every operation forwards over the socket.
|
|
47
|
+
*/
|
|
48
|
+
remoteProviders: RemoteProviderStatus[] | null;
|
|
49
|
+
}
|
|
50
|
+
type RemoteHandler = (action: string, params?: Record<string, unknown>) => Promise<unknown>;
|
|
51
|
+
declare class TimeMachineStore {
|
|
52
|
+
private state;
|
|
53
|
+
private listeners;
|
|
54
|
+
private loadPromise;
|
|
55
|
+
getState(): TimeMachineState;
|
|
56
|
+
subscribe: (listener: () => void) => (() => void);
|
|
57
|
+
private setState;
|
|
58
|
+
ensureLoaded(): Promise<void>;
|
|
59
|
+
/** @internal Buoy Desktop: mirror the device's synced metadata payload. */
|
|
60
|
+
replaceFromSnapshot(payload: {
|
|
61
|
+
snapshots?: SnapshotMeta[];
|
|
62
|
+
busy?: TimeMachineState["busy"];
|
|
63
|
+
lastOutcome?: RestoreOutcome | null;
|
|
64
|
+
providers?: RemoteProviderStatus[];
|
|
65
|
+
}): void;
|
|
66
|
+
/** Capture all capturable sources (or a subset) into a named snapshot. */
|
|
67
|
+
capture(name: string, sourceIds?: string[]): Promise<SnapshotMeta>;
|
|
68
|
+
/**
|
|
69
|
+
* Capture the fresh-install baseline: an EMPTY snapshot whose restore
|
|
70
|
+
* wipes app state (clear + reload) — regardless of what state the app is
|
|
71
|
+
* in when the button is pressed.
|
|
72
|
+
*/
|
|
73
|
+
captureBaseline(): Promise<SnapshotMeta>;
|
|
74
|
+
restore(id: string, mode: RestoreMode): Promise<RestoreOutcome>;
|
|
75
|
+
private restoreSource;
|
|
76
|
+
private scheduleReload;
|
|
77
|
+
delete(id: string): Promise<void>;
|
|
78
|
+
rename(id: string, name: string): Promise<void>;
|
|
79
|
+
clearLastOutcome(): void;
|
|
80
|
+
}
|
|
81
|
+
export declare const timeMachineStore: TimeMachineStore;
|
|
82
|
+
/**
|
|
83
|
+
* Buoy Desktop: route every Time Machine operation through a remote handler
|
|
84
|
+
* (the device's sync adapter actions) instead of running locally. Pass null
|
|
85
|
+
* to detach. While attached, feed device payloads to
|
|
86
|
+
* {@link replaceTimeMachineFromSnapshot}.
|
|
87
|
+
*/
|
|
88
|
+
export declare function setRemoteTimeMachineHandler(handler: RemoteHandler | null): void;
|
|
89
|
+
/** Buoy Desktop: mirror a device's synced Time Machine metadata payload. */
|
|
90
|
+
export declare function replaceTimeMachineFromSnapshot(payload: {
|
|
91
|
+
snapshots?: SnapshotMeta[];
|
|
92
|
+
busy?: TimeMachineState["busy"];
|
|
93
|
+
lastOutcome?: RestoreOutcome | null;
|
|
94
|
+
providers?: RemoteProviderStatus[];
|
|
95
|
+
}): void;
|
|
96
|
+
export {};
|
|
97
|
+
//# sourceMappingURL=timeMachineStore.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"timeMachineStore.d.ts","sourceRoot":"","sources":["../../../src/store/timeMachineStore.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
export declare const timeMachineSyncAdapter: {
|
|
2
|
+
version: number;
|
|
3
|
+
getSnapshot: () => {
|
|
4
|
+
snapshots: import("..").SnapshotMeta[];
|
|
5
|
+
busy: "capture" | "restore" | null;
|
|
6
|
+
lastOutcome: import("..").RestoreOutcome | null;
|
|
7
|
+
providers: {
|
|
8
|
+
id: string;
|
|
9
|
+
label: string;
|
|
10
|
+
canCapture: boolean;
|
|
11
|
+
canRestore: boolean;
|
|
12
|
+
detail: string | undefined;
|
|
13
|
+
}[];
|
|
14
|
+
};
|
|
15
|
+
subscribe: (onChange: () => void) => () => void;
|
|
16
|
+
actions: {
|
|
17
|
+
list: () => {
|
|
18
|
+
snapshots: import("..").SnapshotMeta[];
|
|
19
|
+
busy: "capture" | "restore" | null;
|
|
20
|
+
lastOutcome: import("..").RestoreOutcome | null;
|
|
21
|
+
providers: {
|
|
22
|
+
id: string;
|
|
23
|
+
label: string;
|
|
24
|
+
canCapture: boolean;
|
|
25
|
+
canRestore: boolean;
|
|
26
|
+
detail: string | undefined;
|
|
27
|
+
}[];
|
|
28
|
+
};
|
|
29
|
+
capture: (params: unknown) => Promise<{
|
|
30
|
+
captured: boolean;
|
|
31
|
+
snapshot: import("..").SnapshotMeta;
|
|
32
|
+
}>;
|
|
33
|
+
captureBaseline: () => Promise<{
|
|
34
|
+
captured: boolean;
|
|
35
|
+
snapshot: import("..").SnapshotMeta;
|
|
36
|
+
}>;
|
|
37
|
+
/** mode "live" (default) replaces state in place; "reload" restores
|
|
38
|
+
* persisted storage then reloads the JS bundle (always the path for
|
|
39
|
+
* baseline snapshots). */
|
|
40
|
+
restore: (params: unknown) => Promise<import("..").RestoreOutcome>;
|
|
41
|
+
delete: (params: unknown) => Promise<{
|
|
42
|
+
deleted: boolean;
|
|
43
|
+
id: string;
|
|
44
|
+
}>;
|
|
45
|
+
rename: (params: unknown) => Promise<{
|
|
46
|
+
renamed: boolean;
|
|
47
|
+
id: string;
|
|
48
|
+
name: string;
|
|
49
|
+
}>;
|
|
50
|
+
/** One source's captured payload, deserialized — for remote inspection. */
|
|
51
|
+
inspect: (params: unknown) => Promise<{
|
|
52
|
+
id: string;
|
|
53
|
+
sourceId: string;
|
|
54
|
+
warnings: string[];
|
|
55
|
+
data: unknown;
|
|
56
|
+
}>;
|
|
57
|
+
};
|
|
58
|
+
};
|
|
59
|
+
//# sourceMappingURL=timeMachineSyncAdapter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"timeMachineSyncAdapter.d.ts","sourceRoot":"","sources":["../../../src/sync/timeMachineSyncAdapter.ts"],"names":[],"mappings":"AA2DA,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;0BAGX,MAAM,IAAI;;;;;;;;;;;;;;0BAWN,OAAO;;;;;;;;QAW/B;;kCAE0B;0BACF,OAAO;yBAMR,OAAO;;;;yBAOP,OAAO;;;;;QAO9B,2EAA2E;0BACnD,OAAO;;;;;;;CAmBlC,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@buoy-gg/time-machine",
|
|
3
|
+
"version": "7.0.17",
|
|
4
|
+
"description": "Time Machine - snapshot & restore app state (storage, redux, zustand, jotai, react-query) for React Native DevTools",
|
|
5
|
+
"main": "lib/commonjs/index",
|
|
6
|
+
"module": "lib/module/index",
|
|
7
|
+
"types": "lib/typescript/index.d.ts",
|
|
8
|
+
"react-native": "src/index.tsx",
|
|
9
|
+
"source": "src/index.tsx",
|
|
10
|
+
"files": [
|
|
11
|
+
"src",
|
|
12
|
+
"lib"
|
|
13
|
+
],
|
|
14
|
+
"sideEffects": false,
|
|
15
|
+
"dependencies": {
|
|
16
|
+
"@buoy-gg/floating-tools-core": "^7.0.17",
|
|
17
|
+
"@buoy-gg/shared-ui": "^7.0.17"
|
|
18
|
+
},
|
|
19
|
+
"peerDependencies": {
|
|
20
|
+
"@buoy-gg/license": "7.0.17",
|
|
21
|
+
"react": "*",
|
|
22
|
+
"react-native": "*"
|
|
23
|
+
},
|
|
24
|
+
"devDependencies": {
|
|
25
|
+
"@types/react": "^19.1.0",
|
|
26
|
+
"@types/react-native": "^0.73.0",
|
|
27
|
+
"typescript": "~5.8.3",
|
|
28
|
+
"@buoy-gg/license": "^7.0.17"
|
|
29
|
+
},
|
|
30
|
+
"react-native-builder-bob": {
|
|
31
|
+
"source": "src",
|
|
32
|
+
"output": "lib",
|
|
33
|
+
"targets": [
|
|
34
|
+
"commonjs",
|
|
35
|
+
"module",
|
|
36
|
+
"typescript"
|
|
37
|
+
]
|
|
38
|
+
},
|
|
39
|
+
"repository": {
|
|
40
|
+
"type": "git",
|
|
41
|
+
"url": "https://github.com/LovesWorking/react-native-buoy.git",
|
|
42
|
+
"directory": "packages/time-machine"
|
|
43
|
+
},
|
|
44
|
+
"bugs": {
|
|
45
|
+
"url": "https://github.com/LovesWorking/react-native-buoy/issues"
|
|
46
|
+
},
|
|
47
|
+
"homepage": "https://github.com/LovesWorking/react-native-buoy/tree/main/packages/time-machine#readme",
|
|
48
|
+
"publishConfig": {
|
|
49
|
+
"access": "public",
|
|
50
|
+
"tag": "latest"
|
|
51
|
+
},
|
|
52
|
+
"scripts": {
|
|
53
|
+
"build": "bob build",
|
|
54
|
+
"typecheck": "tsc --noEmit",
|
|
55
|
+
"clean": "rimraf lib",
|
|
56
|
+
"test": "pnpm run typecheck",
|
|
57
|
+
"postinstall": "echo \"Run pnpm build to compile this package\""
|
|
58
|
+
}
|
|
59
|
+
}
|