@plyaz/types 1.45.5 → 1.45.7
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.
|
@@ -2,5 +2,5 @@
|
|
|
2
2
|
* Core Frontend Types
|
|
3
3
|
* Type definitions for @plyaz/core frontend services
|
|
4
4
|
*/
|
|
5
|
-
export type { CoreBaseFrontendStore, CoreBaseFrontendServiceConfig, CoreBaseFrontendServiceInterface, CoreStoreHandlers, CoreOptimisticUpdateConfig, OptimisticConflictResolution, CoreFetcherFunction, CoreServiceFetchers, CorePlyazApiConfig, FrontendFeatureFlagProvider, CorePlyazFeatureFlagConfig, CorePlyazStoreConfig, CorePlyazStreamConfig, CorePlyazConfig, CoreFeatureFlagServiceLike, CoreFeatureFlagFetcherOptions, CoreFeatureFlagStoreInitConfig, CoreBaseFrontendServiceConstructorConfig, CoreInitializationErrorProps, CoreInitializationLoadingProps, CorePlyazServices, CorePlyazContextValue, CorePlyazProviderProps, CoreStreamStoreGetter, CoreStreamHandlerIds, CoreStreamHandlerDeclaration, } from './types';
|
|
5
|
+
export type { CoreBaseFrontendStore, CoreBaseFrontendServiceConfig, CoreBaseFrontendServiceInterface, CoreStoreHandlers, CoreOptimisticUpdateConfig, OptimisticConflictResolution, CoreFetcherFunction, CoreServiceFetchers, CorePlyazApiConfig, FrontendFeatureFlagProvider, CorePlyazFeatureFlagConfig, CorePlyazStoreConfig, CorePlyazStreamConfig, CorePlyazConfig, CoreFeatureFlagServiceLike, CoreFeatureFlagFetcherOptions, CoreFeatureFlagStoreInitConfig, CoreBaseFrontendServiceConstructorConfig, CoreInitializationErrorProps, CoreInitializationLoadingProps, CorePlyazServices, CorePlyazContextValue, CorePlyazProviderProps, CoreStreamStoreGetter, CoreStreamHandlerIds, CoreStreamHandlerDeclaration, UseServiceAsyncResult, } from './types';
|
|
6
6
|
export type { CoreFrontendFeatureFlagEventType, CoreFeatureFlagStore, CoreFeatureFlagServiceConfig, CoreFeatureFlagServiceInitConfig, CoreFeatureFlagServiceInterface, } from './featureFlags';
|
|
@@ -1304,6 +1304,30 @@ export type CoreStreamStoreGetter = () => RootStoreSlice | undefined;
|
|
|
1304
1304
|
* ```
|
|
1305
1305
|
*/
|
|
1306
1306
|
export type CoreStreamHandlerIds<TKeys extends string> = Readonly<Record<TKeys, string>>;
|
|
1307
|
+
/**
|
|
1308
|
+
* Result type for async service hooks (useServiceAsync).
|
|
1309
|
+
*
|
|
1310
|
+
* Used by domain service hooks that may have loading state.
|
|
1311
|
+
*
|
|
1312
|
+
* @typeParam TService - The service type
|
|
1313
|
+
*
|
|
1314
|
+
* @example
|
|
1315
|
+
* ```typescript
|
|
1316
|
+
* import type { UseServiceAsyncResult } from '@plyaz/types/core';
|
|
1317
|
+
*
|
|
1318
|
+
* export function useNotificationsService(): UseServiceAsyncResult<FrontendNotificationsDomainService> {
|
|
1319
|
+
* return useServiceAsync<FrontendNotificationsDomainService>(NOTIFICATIONS_SERVICE_KEY);
|
|
1320
|
+
* }
|
|
1321
|
+
* ```
|
|
1322
|
+
*/
|
|
1323
|
+
export interface UseServiceAsyncResult<TService> {
|
|
1324
|
+
/** The service instance (null while loading or on error) */
|
|
1325
|
+
service: TService | null;
|
|
1326
|
+
/** Whether the service is still loading */
|
|
1327
|
+
isLoading: boolean;
|
|
1328
|
+
/** Error if service initialization failed */
|
|
1329
|
+
error: Error | null;
|
|
1330
|
+
}
|
|
1307
1331
|
/**
|
|
1308
1332
|
* Declarative stream handler configuration.
|
|
1309
1333
|
*
|
|
@@ -100,6 +100,7 @@ export interface NotificationsFrontendStoreSlice extends NotificationsFrontendSt
|
|
|
100
100
|
}
|
|
101
101
|
/**
|
|
102
102
|
* Notifications store selectors
|
|
103
|
+
*
|
|
103
104
|
*/
|
|
104
105
|
export interface NotificationsStoreSelectors {
|
|
105
106
|
/** Select all notifications */
|
|
@@ -112,8 +113,4 @@ export interface NotificationsStoreSelectors {
|
|
|
112
113
|
selectIsLoading: (state: NotificationsFrontendStoreState) => boolean;
|
|
113
114
|
/** Select notification by ID */
|
|
114
115
|
selectNotificationById: (state: NotificationsFrontendStoreState, id: string) => NotificationStoreItem | undefined;
|
|
115
|
-
/** Select unread notifications */
|
|
116
|
-
selectUnreadNotifications: (state: NotificationsFrontendStoreState) => NotificationStoreItem[];
|
|
117
|
-
/** Select unread count */
|
|
118
|
-
selectUnreadCount: (state: NotificationsFrontendStoreState) => number;
|
|
119
116
|
}
|
package/package.json
CHANGED