@plyaz/types 1.29.3 → 1.31.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.
|
@@ -799,6 +799,27 @@ export interface CoreBaseFrontendServiceConfig<TData = Record<string, unknown>,
|
|
|
799
799
|
* @default undefined (auto-detect from 'error' or 'errors')
|
|
800
800
|
*/
|
|
801
801
|
responseErrorKey?: string;
|
|
802
|
+
/**
|
|
803
|
+
* Key to use when syncing entities to the store.
|
|
804
|
+
*
|
|
805
|
+
* When fetching entities, the service will wrap them in an object with this key
|
|
806
|
+
* before calling store.setData(). Supports nested keys via dot notation.
|
|
807
|
+
*
|
|
808
|
+
* @example
|
|
809
|
+
* ```typescript
|
|
810
|
+
* // Store expects: { items: ExampleEntity[] }
|
|
811
|
+
* storeDataKey: 'items'
|
|
812
|
+
*
|
|
813
|
+
* // Store expects: { data: ExampleEntity[] }
|
|
814
|
+
* storeDataKey: 'data'
|
|
815
|
+
*
|
|
816
|
+
* // Store expects: { nested: { items: ExampleEntity[] } }
|
|
817
|
+
* storeDataKey: 'nested.items'
|
|
818
|
+
* ```
|
|
819
|
+
*
|
|
820
|
+
* @default 'items'
|
|
821
|
+
*/
|
|
822
|
+
storeDataKey?: string;
|
|
802
823
|
/** Fetcher functions for API operations (replaces direct apiClient usage) */
|
|
803
824
|
fetchers?: CoreServiceFetchers<unknown, unknown, unknown, unknown, unknown, unknown, unknown>;
|
|
804
825
|
/**
|
|
@@ -840,6 +861,26 @@ export interface CoreBaseFrontendServiceConfig<TData = Record<string, unknown>,
|
|
|
840
861
|
* ```
|
|
841
862
|
*/
|
|
842
863
|
optimisticUpdates?: CoreOptimisticUpdateConfig;
|
|
864
|
+
/**
|
|
865
|
+
* Polling interval in milliseconds.
|
|
866
|
+
*
|
|
867
|
+
* When set to a value > 0, enables automatic polling via startPolling().
|
|
868
|
+
* The service will call fetchAll() at this interval.
|
|
869
|
+
*
|
|
870
|
+
* Set to 0 or omit to disable auto-polling (use default 30s when startPolling() is called).
|
|
871
|
+
*
|
|
872
|
+
* @example
|
|
873
|
+
* ```typescript
|
|
874
|
+
* // Poll every 5 seconds
|
|
875
|
+
* pollingInterval: 5000
|
|
876
|
+
*
|
|
877
|
+
* // Disable auto-polling, use default 30s when startPolling() is called
|
|
878
|
+
* pollingInterval: 0
|
|
879
|
+
* ```
|
|
880
|
+
*
|
|
881
|
+
* @default 0 (disabled, uses 30s default when startPolling() is called)
|
|
882
|
+
*/
|
|
883
|
+
pollingInterval?: number;
|
|
843
884
|
}
|
|
844
885
|
/**
|
|
845
886
|
* Base interface for frontend domain services with store integration.
|
package/dist/examples/types.d.ts
CHANGED
|
@@ -106,10 +106,12 @@ export type ExampleDeletedPayload = CoreEntityDeletedPayload;
|
|
|
106
106
|
export type ExampleValidationFailedPayload = CoreValidationFailedPayload;
|
|
107
107
|
/**
|
|
108
108
|
* Example frontend store data type
|
|
109
|
+
* Used for setData() - only items is required, selectedId is preserved if not provided
|
|
109
110
|
*/
|
|
110
111
|
export interface ExampleFrontendStoreData {
|
|
111
112
|
items: ExampleEntity[];
|
|
112
|
-
|
|
113
|
+
/** Optional - if not provided, current selection is preserved */
|
|
114
|
+
selectedId?: string | null;
|
|
113
115
|
}
|
|
114
116
|
/**
|
|
115
117
|
* Example frontend store state shape.
|
package/package.json
CHANGED