@hamak/ui-store-api 0.10.1 → 0.12.0

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.
Files changed (73) hide show
  1. package/package.json +2 -2
  2. package/dist/api/index.d.ts +0 -7
  3. package/dist/api/index.d.ts.map +0 -1
  4. package/dist/api/index.js +0 -6
  5. package/dist/api/middleware-registry.d.ts +0 -33
  6. package/dist/api/middleware-registry.d.ts.map +0 -1
  7. package/dist/api/middleware-registry.js +0 -5
  8. package/dist/api/reducer-registry.d.ts +0 -41
  9. package/dist/api/reducer-registry.d.ts.map +0 -1
  10. package/dist/api/reducer-registry.js +0 -5
  11. package/dist/api/store-manager.d.ts +0 -55
  12. package/dist/api/store-manager.d.ts.map +0 -1
  13. package/dist/api/store-manager.js +0 -5
  14. package/dist/autosave/autosave-action-factory.d.ts +0 -69
  15. package/dist/autosave/autosave-action-factory.d.ts.map +0 -1
  16. package/dist/autosave/autosave-action-factory.js +0 -135
  17. package/dist/autosave/autosave-action-types.d.ts +0 -134
  18. package/dist/autosave/autosave-action-types.d.ts.map +0 -1
  19. package/dist/autosave/autosave-action-types.js +0 -44
  20. package/dist/autosave/autosave-types.d.ts +0 -86
  21. package/dist/autosave/autosave-types.d.ts.map +0 -1
  22. package/dist/autosave/autosave-types.js +0 -35
  23. package/dist/autosave/index.d.ts +0 -9
  24. package/dist/autosave/index.d.ts.map +0 -1
  25. package/dist/autosave/index.js +0 -8
  26. package/dist/es2015/api/index.js +0 -22
  27. package/dist/es2015/api/middleware-registry.js +0 -6
  28. package/dist/es2015/api/reducer-registry.js +0 -6
  29. package/dist/es2015/api/store-manager.js +0 -6
  30. package/dist/es2015/autosave/autosave-action-factory.js +0 -139
  31. package/dist/es2015/autosave/autosave-action-types.js +0 -47
  32. package/dist/es2015/autosave/autosave-types.js +0 -40
  33. package/dist/es2015/autosave/index.js +0 -24
  34. package/dist/es2015/fs/contracts/filesystem-facade.contract.js +0 -2
  35. package/dist/es2015/fs/contracts/filesystem-manager.contract.js +0 -2
  36. package/dist/es2015/fs/index.js +0 -22
  37. package/dist/es2015/tokens/index.js +0 -20
  38. package/dist/es2015/tokens/service-tokens.js +0 -13
  39. package/dist/es2015/types/extension-types.js +0 -5
  40. package/dist/es2015/types/index.js +0 -23
  41. package/dist/es2015/types/middleware-types.js +0 -5
  42. package/dist/es2015/types/reducer-types.js +0 -5
  43. package/dist/es2015/types/store-types.js +0 -5
  44. package/dist/fs/contracts/filesystem-facade.contract.d.ts +0 -57
  45. package/dist/fs/contracts/filesystem-facade.contract.d.ts.map +0 -1
  46. package/dist/fs/contracts/filesystem-facade.contract.js +0 -1
  47. package/dist/fs/contracts/filesystem-manager.contract.d.ts +0 -42
  48. package/dist/fs/contracts/filesystem-manager.contract.d.ts.map +0 -1
  49. package/dist/fs/contracts/filesystem-manager.contract.js +0 -1
  50. package/dist/fs/index.d.ts +0 -5
  51. package/dist/fs/index.d.ts.map +0 -1
  52. package/dist/fs/index.js +0 -4
  53. package/dist/tokens/index.d.ts +0 -5
  54. package/dist/tokens/index.d.ts.map +0 -1
  55. package/dist/tokens/index.js +0 -4
  56. package/dist/tokens/service-tokens.d.ts +0 -10
  57. package/dist/tokens/service-tokens.d.ts.map +0 -1
  58. package/dist/tokens/service-tokens.js +0 -10
  59. package/dist/types/extension-types.d.ts +0 -32
  60. package/dist/types/extension-types.d.ts.map +0 -1
  61. package/dist/types/extension-types.js +0 -4
  62. package/dist/types/index.d.ts +0 -8
  63. package/dist/types/index.d.ts.map +0 -1
  64. package/dist/types/index.js +0 -7
  65. package/dist/types/middleware-types.d.ts +0 -31
  66. package/dist/types/middleware-types.d.ts.map +0 -1
  67. package/dist/types/middleware-types.js +0 -4
  68. package/dist/types/reducer-types.d.ts +0 -22
  69. package/dist/types/reducer-types.d.ts.map +0 -1
  70. package/dist/types/reducer-types.js +0 -4
  71. package/dist/types/store-types.d.ts +0 -49
  72. package/dist/types/store-types.d.ts.map +0 -1
  73. package/dist/types/store-types.js +0 -4
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hamak/ui-store-api",
3
- "version": "0.10.1",
3
+ "version": "0.12.0",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "description": "DEPRECATED: Use @hamak/ui-store/api instead",
@@ -31,7 +31,7 @@
31
31
  }
32
32
  },
33
33
  "dependencies": {
34
- "@hamak/ui-store": "*"
34
+ "@hamak/ui-store": "^0.12.0"
35
35
  },
36
36
  "devDependencies": {
37
37
  "typescript": "~5.4.0"
@@ -1,7 +0,0 @@
1
- /**
2
- * API Interfaces Export
3
- */
4
- export * from './store-manager.js';
5
- export * from './middleware-registry.js';
6
- export * from './reducer-registry.js';
7
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/api/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,cAAc,iBAAiB,CAAC;AAChC,cAAc,uBAAuB,CAAC;AACtC,cAAc,oBAAoB,CAAC"}
package/dist/api/index.js DELETED
@@ -1,6 +0,0 @@
1
- /**
2
- * API Interfaces Export
3
- */
4
- export * from './store-manager.js';
5
- export * from './middleware-registry.js';
6
- export * from './reducer-registry.js';
@@ -1,33 +0,0 @@
1
- /**
2
- * Middleware Registry Interface
3
- * Extension point for plugins to contribute middleware
4
- */
5
- import type { Middleware } from 'redux';
6
- import type { MiddlewareRegistration } from '../types/index.js';
7
- export interface IMiddlewareRegistry {
8
- /**
9
- * Register a middleware
10
- */
11
- register(registration: MiddlewareRegistration): void;
12
- /**
13
- * Unregister a middleware by ID
14
- */
15
- unregister(id: string): void;
16
- /**
17
- * Get all middleware in priority order
18
- */
19
- getAll(): Middleware[];
20
- /**
21
- * Check if middleware is registered
22
- */
23
- has(id: string): boolean;
24
- /**
25
- * Get middleware registration info
26
- */
27
- getInfo(id: string): MiddlewareRegistration | undefined;
28
- /**
29
- * Get all registrations with metadata
30
- */
31
- getAllRegistrations(): MiddlewareRegistration[];
32
- }
33
- //# sourceMappingURL=middleware-registry.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"middleware-registry.d.ts","sourceRoot":"","sources":["../../src/api/middleware-registry.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AACxC,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,UAAU,CAAC;AAEvD,MAAM,WAAW,mBAAmB;IAClC;;OAEG;IACH,QAAQ,CAAC,YAAY,EAAE,sBAAsB,GAAG,IAAI,CAAC;IAErD;;OAEG;IACH,UAAU,CAAC,EAAE,EAAE,MAAM,GAAG,IAAI,CAAC;IAE7B;;OAEG;IACH,MAAM,IAAI,UAAU,EAAE,CAAC;IAEvB;;OAEG;IACH,GAAG,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC;IAEzB;;OAEG;IACH,OAAO,CAAC,EAAE,EAAE,MAAM,GAAG,sBAAsB,GAAG,SAAS,CAAC;IAExD;;OAEG;IACH,mBAAmB,IAAI,sBAAsB,EAAE,CAAC;CACjD"}
@@ -1,5 +0,0 @@
1
- /**
2
- * Middleware Registry Interface
3
- * Extension point for plugins to contribute middleware
4
- */
5
- export {};
@@ -1,41 +0,0 @@
1
- /**
2
- * Reducer Registry Interface
3
- * Allows dynamic reducer registration and hot replacement
4
- */
5
- import type { Reducer } from 'redux';
6
- import type { ReducerMap, ReducerRegistration } from '../types/index.js';
7
- export interface IReducerRegistry {
8
- /**
9
- * Register a reducer for a state slice key
10
- * @param key - State slice key
11
- * @param reducer - Reducer function
12
- * @param replace - Whether to replace existing reducer (default: false)
13
- */
14
- register(key: string, reducer: Reducer, replace?: boolean): void;
15
- /**
16
- * Unregister a reducer
17
- * @param key - State slice key
18
- */
19
- unregister(key: string): void;
20
- /**
21
- * Get all registered reducers
22
- */
23
- getAll(): ReducerMap;
24
- /**
25
- * Get combined root reducer
26
- */
27
- getCombinedReducer(): Reducer;
28
- /**
29
- * Check if reducer is registered
30
- */
31
- has(key: string): boolean;
32
- /**
33
- * Get reducer registration info
34
- */
35
- getInfo(key: string): ReducerRegistration | undefined;
36
- /**
37
- * Get all registrations with metadata
38
- */
39
- getAllRegistrations(): ReducerRegistration[];
40
- }
41
- //# sourceMappingURL=reducer-registry.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"reducer-registry.d.ts","sourceRoot":"","sources":["../../src/api/reducer-registry.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AACrC,OAAO,KAAK,EAAE,UAAU,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAEhE,MAAM,WAAW,gBAAgB;IAC/B;;;;;OAKG;IACH,QAAQ,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,CAAC,EAAE,OAAO,GAAG,IAAI,CAAC;IAEjE;;;OAGG;IACH,UAAU,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAAC;IAE9B;;OAEG;IACH,MAAM,IAAI,UAAU,CAAC;IAErB;;OAEG;IACH,kBAAkB,IAAI,OAAO,CAAC;IAE9B;;OAEG;IACH,GAAG,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;IAE1B;;OAEG;IACH,OAAO,CAAC,GAAG,EAAE,MAAM,GAAG,mBAAmB,GAAG,SAAS,CAAC;IAEtD;;OAEG;IACH,mBAAmB,IAAI,mBAAmB,EAAE,CAAC;CAC9C"}
@@ -1,5 +0,0 @@
1
- /**
2
- * Reducer Registry Interface
3
- * Allows dynamic reducer registration and hot replacement
4
- */
5
- export {};
@@ -1,55 +0,0 @@
1
- /**
2
- * Store Manager Interface
3
- * Main orchestrator for Redux store management
4
- */
5
- import type { Store, Reducer, Action } from 'redux';
6
- import type { StoreConfig, RootState, AppAction } from '../types/index.js';
7
- import type { IMiddlewareRegistry } from './middleware-registry.js';
8
- import type { IReducerRegistry } from './reducer-registry.js';
9
- export interface IStoreManager {
10
- /**
11
- * Get the Redux store instance
12
- * @throws Error if store is not initialized
13
- */
14
- getStore(): Store<RootState, AppAction>;
15
- /**
16
- * Check if store is initialized
17
- */
18
- isInitialized(): boolean;
19
- /**
20
- * Initialize the store
21
- * Should be called after all plugins have registered middleware/reducers
22
- * @internal - Called by plugin framework during activation
23
- */
24
- initialize(config?: StoreConfig): Store<RootState, AppAction>;
25
- /**
26
- * Get middleware registry (for plugin contributions)
27
- */
28
- getMiddlewareRegistry(): IMiddlewareRegistry;
29
- /**
30
- * Get reducer registry (for dynamic reducers)
31
- */
32
- getReducerRegistry(): IReducerRegistry;
33
- /**
34
- * Dispatch an action
35
- */
36
- dispatch<A extends Action>(action: A): A;
37
- /**
38
- * Get current state
39
- */
40
- getState<S = RootState>(): S;
41
- /**
42
- * Subscribe to state changes
43
- * @returns Unsubscribe function
44
- */
45
- subscribe(listener: () => void): () => void;
46
- /**
47
- * Replace the root reducer (for hot module replacement)
48
- */
49
- replaceReducer(nextReducer: Reducer<RootState, AppAction>): void;
50
- /**
51
- * Destroy the store and clean up resources
52
- */
53
- destroy(): void;
54
- }
55
- //# sourceMappingURL=store-manager.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"store-manager.d.ts","sourceRoot":"","sources":["../../src/api/store-manager.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AACpD,OAAO,KAAK,EAAE,WAAW,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAClE,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AACjE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAE3D,MAAM,WAAW,aAAa;IAC5B;;;OAGG;IACH,QAAQ,IAAI,KAAK,CAAC,SAAS,EAAE,SAAS,CAAC,CAAC;IAExC;;OAEG;IACH,aAAa,IAAI,OAAO,CAAC;IAEzB;;;;OAIG;IACH,UAAU,CAAC,MAAM,CAAC,EAAE,WAAW,GAAG,KAAK,CAAC,SAAS,EAAE,SAAS,CAAC,CAAC;IAE9D;;OAEG;IACH,qBAAqB,IAAI,mBAAmB,CAAC;IAE7C;;OAEG;IACH,kBAAkB,IAAI,gBAAgB,CAAC;IAEvC;;OAEG;IACH,QAAQ,CAAC,CAAC,SAAS,MAAM,EAAE,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC;IAEzC;;OAEG;IACH,QAAQ,CAAC,CAAC,GAAG,SAAS,KAAK,CAAC,CAAC;IAE7B;;;OAGG;IACH,SAAS,CAAC,QAAQ,EAAE,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC;IAE5C;;OAEG;IACH,cAAc,CAAC,WAAW,EAAE,OAAO,CAAC,SAAS,EAAE,SAAS,CAAC,GAAG,IAAI,CAAC;IAEjE;;OAEG;IACH,OAAO,IAAI,IAAI,CAAC;CACjB"}
@@ -1,5 +0,0 @@
1
- /**
2
- * Store Manager Interface
3
- * Main orchestrator for Redux store management
4
- */
5
- export {};
@@ -1,69 +0,0 @@
1
- /**
2
- * Autosave Action Factory
3
- *
4
- * Factory for creating autosave actions.
5
- */
6
- import type { AnyAction } from 'redux';
7
- import type { AutosaveConfig } from './autosave-types.js';
8
- import { type SetAutosaveConfigAction, type ClearAutosaveConfigAction, type ChangeDetectedAction, type DebounceExpiredAction, type SaveStartedAction, type SaveSucceededAction, type SaveFailedAction, type RetryScheduledAction, type FlushPendingAction, type FlushAllPendingAction, type CancelPendingAction, type AutosaveAction } from './autosave-action-types.js';
9
- /**
10
- * Factory class for creating autosave actions
11
- */
12
- export declare class AutosaveActionFactory {
13
- /**
14
- * Set autosave configuration for a path
15
- */
16
- setConfig(path: string[], config: AutosaveConfig): SetAutosaveConfigAction;
17
- /**
18
- * Clear autosave configuration for a path (revert to inherited)
19
- */
20
- clearConfig(path: string[]): ClearAutosaveConfigAction;
21
- /**
22
- * Content change detected, debounce timer started
23
- */
24
- changeDetected(path: string[], detectedAt: number, scheduledFor: number, providerId: string): ChangeDetectedAction;
25
- /**
26
- * Debounce timer expired, ready to save
27
- */
28
- debounceExpired(path: string[]): DebounceExpiredAction;
29
- /**
30
- * Save operation started
31
- */
32
- saveStarted(path: string[], providerId: string): SaveStartedAction;
33
- /**
34
- * Save completed successfully
35
- */
36
- saveSucceeded(path: string[], timestamp?: number): SaveSucceededAction;
37
- /**
38
- * Save failed
39
- */
40
- saveFailed(path: string[], error: {
41
- code: string;
42
- message: string;
43
- }, attempt?: number): SaveFailedAction;
44
- /**
45
- * Retry scheduled
46
- */
47
- retryScheduled(path: string[], retryAt: number, attempt: number): RetryScheduledAction;
48
- /**
49
- * Flush pending save immediately (cancels debounce)
50
- */
51
- flushPending(path: string[]): FlushPendingAction;
52
- /**
53
- * Flush all pending saves
54
- */
55
- flushAllPending(): FlushAllPendingAction;
56
- /**
57
- * Cancel pending save
58
- */
59
- cancelPending(path: string[]): CancelPendingAction;
60
- /**
61
- * Check if an action is an autosave action
62
- */
63
- isAutosaveAction(action: AnyAction): action is AutosaveAction;
64
- }
65
- /**
66
- * Singleton instance of the autosave action factory
67
- */
68
- export declare const autosaveActions: AutosaveActionFactory;
69
- //# sourceMappingURL=autosave-action-factory.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"autosave-action-factory.d.ts","sourceRoot":"","sources":["../../src/autosave/autosave-action-factory.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AACvD,OAAO,EAEL,KAAK,uBAAuB,EAC5B,KAAK,yBAAyB,EAC9B,KAAK,oBAAoB,EACzB,KAAK,qBAAqB,EAC1B,KAAK,iBAAiB,EACtB,KAAK,mBAAmB,EACxB,KAAK,gBAAgB,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,MAAM,EAAE,SAAS,GAAG,MAAM,IAAI,cAAc;CAM9D;AAED;;GAEG;AACH,eAAO,MAAM,eAAe,uBAA8B,CAAC"}
@@ -1,135 +0,0 @@
1
- /**
2
- * Autosave Action Factory
3
- *
4
- * Factory for creating autosave actions.
5
- */
6
- import { AutosaveActionTypes, } from './autosave-action-types.js';
7
- /**
8
- * Factory class for creating autosave actions
9
- */
10
- export class AutosaveActionFactory {
11
- // ─────────────────────────────────────────────────────────────────
12
- // Configuration Actions
13
- // ─────────────────────────────────────────────────────────────────
14
- /**
15
- * Set autosave configuration for a path
16
- */
17
- setConfig(path, config) {
18
- return {
19
- type: AutosaveActionTypes.SET_CONFIG,
20
- payload: { path, config },
21
- };
22
- }
23
- /**
24
- * Clear autosave configuration for a path (revert to inherited)
25
- */
26
- clearConfig(path) {
27
- return {
28
- type: AutosaveActionTypes.CLEAR_CONFIG,
29
- payload: { path },
30
- };
31
- }
32
- // ─────────────────────────────────────────────────────────────────
33
- // Lifecycle Actions (used internally by middleware)
34
- // ─────────────────────────────────────────────────────────────────
35
- /**
36
- * Content change detected, debounce timer started
37
- */
38
- changeDetected(path, detectedAt, scheduledFor, providerId) {
39
- return {
40
- type: AutosaveActionTypes.CHANGE_DETECTED,
41
- payload: { path, detectedAt, scheduledFor, providerId },
42
- };
43
- }
44
- /**
45
- * Debounce timer expired, ready to save
46
- */
47
- debounceExpired(path) {
48
- return {
49
- type: AutosaveActionTypes.DEBOUNCE_EXPIRED,
50
- payload: { path },
51
- };
52
- }
53
- /**
54
- * Save operation started
55
- */
56
- saveStarted(path, providerId) {
57
- return {
58
- type: AutosaveActionTypes.SAVE_STARTED,
59
- payload: { path, providerId },
60
- };
61
- }
62
- /**
63
- * Save completed successfully
64
- */
65
- saveSucceeded(path, timestamp) {
66
- return {
67
- type: AutosaveActionTypes.SAVE_SUCCEEDED,
68
- payload: { path, timestamp: timestamp ?? Date.now() },
69
- };
70
- }
71
- /**
72
- * Save failed
73
- */
74
- saveFailed(path, error, attempt = 1) {
75
- return {
76
- type: AutosaveActionTypes.SAVE_FAILED,
77
- payload: {
78
- path,
79
- error: { ...error, attempt },
80
- },
81
- };
82
- }
83
- /**
84
- * Retry scheduled
85
- */
86
- retryScheduled(path, retryAt, attempt) {
87
- return {
88
- type: AutosaveActionTypes.RETRY_SCHEDULED,
89
- payload: { path, retryAt, attempt },
90
- };
91
- }
92
- // ─────────────────────────────────────────────────────────────────
93
- // Manual Trigger Actions
94
- // ─────────────────────────────────────────────────────────────────
95
- /**
96
- * Flush pending save immediately (cancels debounce)
97
- */
98
- flushPending(path) {
99
- return {
100
- type: AutosaveActionTypes.FLUSH_PENDING,
101
- payload: { path },
102
- };
103
- }
104
- /**
105
- * Flush all pending saves
106
- */
107
- flushAllPending() {
108
- return {
109
- type: AutosaveActionTypes.FLUSH_ALL_PENDING,
110
- };
111
- }
112
- /**
113
- * Cancel pending save
114
- */
115
- cancelPending(path) {
116
- return {
117
- type: AutosaveActionTypes.CANCEL_PENDING,
118
- payload: { path },
119
- };
120
- }
121
- // ─────────────────────────────────────────────────────────────────
122
- // Type Guards
123
- // ─────────────────────────────────────────────────────────────────
124
- /**
125
- * Check if an action is an autosave action
126
- */
127
- isAutosaveAction(action) {
128
- return (typeof action.type === 'string' &&
129
- action.type.startsWith('@@autosave/'));
130
- }
131
- }
132
- /**
133
- * Singleton instance of the autosave action factory
134
- */
135
- export const autosaveActions = new AutosaveActionFactory();
@@ -1,134 +0,0 @@
1
- /**
2
- * Autosave Action Types
3
- *
4
- * These actions orchestrate the autosave lifecycle but do NOT execute saves.
5
- * Actual saves are performed by plugin providers using their own actions
6
- * (e.g., PUT_REQUEST for remote-fs, UPDATE_ENTITY for remote-resource).
7
- */
8
- import type { AutosaveConfig, AutosaveError } from './autosave-types.js';
9
- /**
10
- * Autosave action type constants
11
- */
12
- export declare enum AutosaveActionTypes {
13
- /** Set autosave configuration for a path */
14
- SET_CONFIG = "@@autosave/SET_CONFIG",
15
- /** Clear autosave configuration (revert to inherited) */
16
- CLEAR_CONFIG = "@@autosave/CLEAR_CONFIG",
17
- /** Content change detected, debounce timer started */
18
- CHANGE_DETECTED = "@@autosave/CHANGE_DETECTED",
19
- /** Debounce timer expired, save will be triggered */
20
- DEBOUNCE_EXPIRED = "@@autosave/DEBOUNCE_EXPIRED",
21
- /** Save operation started */
22
- SAVE_STARTED = "@@autosave/SAVE_STARTED",
23
- /** Save completed successfully */
24
- SAVE_SUCCEEDED = "@@autosave/SAVE_SUCCEEDED",
25
- /** Save failed */
26
- SAVE_FAILED = "@@autosave/SAVE_FAILED",
27
- /** Retry scheduled */
28
- RETRY_SCHEDULED = "@@autosave/RETRY_SCHEDULED",
29
- /** Flush pending save immediately (cancels debounce) */
30
- FLUSH_PENDING = "@@autosave/FLUSH_PENDING",
31
- /** Flush all pending saves */
32
- FLUSH_ALL_PENDING = "@@autosave/FLUSH_ALL_PENDING",
33
- /** Cancel pending save */
34
- CANCEL_PENDING = "@@autosave/CANCEL_PENDING"
35
- }
36
- /** Set autosave configuration for a path */
37
- export interface SetAutosaveConfigAction {
38
- type: AutosaveActionTypes.SET_CONFIG;
39
- payload: {
40
- path: string[];
41
- config: AutosaveConfig;
42
- };
43
- [key: string]: unknown;
44
- }
45
- /** Clear autosave configuration for a path */
46
- export interface ClearAutosaveConfigAction {
47
- type: AutosaveActionTypes.CLEAR_CONFIG;
48
- payload: {
49
- path: string[];
50
- };
51
- [key: string]: unknown;
52
- }
53
- /** Content change detected */
54
- export interface ChangeDetectedAction {
55
- type: AutosaveActionTypes.CHANGE_DETECTED;
56
- payload: {
57
- path: string[];
58
- detectedAt: number;
59
- scheduledFor: number;
60
- providerId: string;
61
- };
62
- [key: string]: unknown;
63
- }
64
- /** Debounce timer expired */
65
- export interface DebounceExpiredAction {
66
- type: AutosaveActionTypes.DEBOUNCE_EXPIRED;
67
- payload: {
68
- path: string[];
69
- };
70
- [key: string]: unknown;
71
- }
72
- /** Save started */
73
- export interface SaveStartedAction {
74
- type: AutosaveActionTypes.SAVE_STARTED;
75
- payload: {
76
- path: string[];
77
- providerId: string;
78
- };
79
- [key: string]: unknown;
80
- }
81
- /** Save succeeded */
82
- export interface SaveSucceededAction {
83
- type: AutosaveActionTypes.SAVE_SUCCEEDED;
84
- payload: {
85
- path: string[];
86
- timestamp: number;
87
- };
88
- [key: string]: unknown;
89
- }
90
- /** Save failed */
91
- export interface SaveFailedAction {
92
- type: AutosaveActionTypes.SAVE_FAILED;
93
- payload: {
94
- path: string[];
95
- error: AutosaveError;
96
- };
97
- [key: string]: unknown;
98
- }
99
- /** Retry scheduled */
100
- export interface RetryScheduledAction {
101
- type: AutosaveActionTypes.RETRY_SCHEDULED;
102
- payload: {
103
- path: string[];
104
- retryAt: number;
105
- attempt: number;
106
- };
107
- [key: string]: unknown;
108
- }
109
- /** Flush pending save */
110
- export interface FlushPendingAction {
111
- type: AutosaveActionTypes.FLUSH_PENDING;
112
- payload: {
113
- path: string[];
114
- };
115
- [key: string]: unknown;
116
- }
117
- /** Flush all pending saves */
118
- export interface FlushAllPendingAction {
119
- type: AutosaveActionTypes.FLUSH_ALL_PENDING;
120
- [key: string]: unknown;
121
- }
122
- /** Cancel pending save */
123
- export interface CancelPendingAction {
124
- type: AutosaveActionTypes.CANCEL_PENDING;
125
- payload: {
126
- path: string[];
127
- };
128
- [key: string]: unknown;
129
- }
130
- /**
131
- * Union type of all autosave actions
132
- */
133
- export type AutosaveAction = SetAutosaveConfigAction | ClearAutosaveConfigAction | ChangeDetectedAction | DebounceExpiredAction | SaveStartedAction | SaveSucceededAction | SaveFailedAction | RetryScheduledAction | FlushPendingAction | FlushAllPendingAction | CancelPendingAction;
134
- //# sourceMappingURL=autosave-action-types.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"autosave-action-types.d.ts","sourceRoot":"","sources":["../../src/autosave/autosave-action-types.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,kBA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EAAE,MAAM,EAAE,CAAC;KAChB,CAAC;IACF,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB;AAED,8BAA8B;AAC9B,MAAM,WAAW,qBAAqB;IACpC,IAAI,EAAE,mBAAmB,CAAC,iBAAiB,CAAC;IAC5C,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB;AAED,0BAA0B;AAC1B,MAAM,WAAW,mBAAmB;IAClC,IAAI,EAAE,mBAAmB,CAAC,cAAc,CAAC;IACzC,OAAO,EAAE;QACP,IAAI,EAAE,MAAM,EAAE,CAAC;KAChB,CAAC;IACF,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB;AAED;;GAEG;AACH,MAAM,MAAM,cAAc,GACtB,uBAAuB,GACvB,yBAAyB,GACzB,oBAAoB,GACpB,qBAAqB,GACrB,iBAAiB,GACjB,mBAAmB,GACnB,gBAAgB,GAChB,oBAAoB,GACpB,kBAAkB,GAClB,qBAAqB,GACrB,mBAAmB,CAAC"}
@@ -1,44 +0,0 @@
1
- /**
2
- * Autosave Action Types
3
- *
4
- * These actions orchestrate the autosave lifecycle but do NOT execute saves.
5
- * Actual saves are performed by plugin providers using their own actions
6
- * (e.g., PUT_REQUEST for remote-fs, UPDATE_ENTITY for remote-resource).
7
- */
8
- /**
9
- * Autosave action type constants
10
- */
11
- export var AutosaveActionTypes;
12
- (function (AutosaveActionTypes) {
13
- // ─────────────────────────────────────────────────────────────────
14
- // Configuration Actions
15
- // ─────────────────────────────────────────────────────────────────
16
- /** Set autosave configuration for a path */
17
- AutosaveActionTypes["SET_CONFIG"] = "@@autosave/SET_CONFIG";
18
- /** Clear autosave configuration (revert to inherited) */
19
- AutosaveActionTypes["CLEAR_CONFIG"] = "@@autosave/CLEAR_CONFIG";
20
- // ─────────────────────────────────────────────────────────────────
21
- // Lifecycle Actions (dispatched by middleware)
22
- // ─────────────────────────────────────────────────────────────────
23
- /** Content change detected, debounce timer started */
24
- AutosaveActionTypes["CHANGE_DETECTED"] = "@@autosave/CHANGE_DETECTED";
25
- /** Debounce timer expired, save will be triggered */
26
- AutosaveActionTypes["DEBOUNCE_EXPIRED"] = "@@autosave/DEBOUNCE_EXPIRED";
27
- /** Save operation started */
28
- AutosaveActionTypes["SAVE_STARTED"] = "@@autosave/SAVE_STARTED";
29
- /** Save completed successfully */
30
- AutosaveActionTypes["SAVE_SUCCEEDED"] = "@@autosave/SAVE_SUCCEEDED";
31
- /** Save failed */
32
- AutosaveActionTypes["SAVE_FAILED"] = "@@autosave/SAVE_FAILED";
33
- /** Retry scheduled */
34
- AutosaveActionTypes["RETRY_SCHEDULED"] = "@@autosave/RETRY_SCHEDULED";
35
- // ─────────────────────────────────────────────────────────────────
36
- // Manual Trigger Actions
37
- // ─────────────────────────────────────────────────────────────────
38
- /** Flush pending save immediately (cancels debounce) */
39
- AutosaveActionTypes["FLUSH_PENDING"] = "@@autosave/FLUSH_PENDING";
40
- /** Flush all pending saves */
41
- AutosaveActionTypes["FLUSH_ALL_PENDING"] = "@@autosave/FLUSH_ALL_PENDING";
42
- /** Cancel pending save */
43
- AutosaveActionTypes["CANCEL_PENDING"] = "@@autosave/CANCEL_PENDING";
44
- })(AutosaveActionTypes || (AutosaveActionTypes = {}));