@monorise/react 1.0.10 → 1.0.12

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.
@@ -0,0 +1,14 @@
1
+ // types/axios.d.ts
2
+ import 'axios';
3
+
4
+ declare module 'axios' {
5
+ export interface AxiosRequestConfig {
6
+ requestKey: string;
7
+ isInterruptive?: boolean;
8
+ feedback?: {
9
+ loading?: string | boolean;
10
+ success?: ((data: any) => string) | string | boolean;
11
+ failure?: string | boolean;
12
+ };
13
+ }
14
+ }
@@ -0,0 +1,8 @@
1
+ import type { CreatedEntity, Entity } from '@monorise/base';
2
+
3
+ export type CommonStore<T> = {
4
+ dataMap: Map<string, T>;
5
+ isFirstFetched: boolean;
6
+ lastKey: string;
7
+ searchResults?: CreatedEntity<Entity>[];
8
+ };
@@ -0,0 +1,32 @@
1
+ import type { Entity, EntitySchemaMap } from '@monorise/base';
2
+
3
+ type MutualDataWithIndex = {
4
+ index: number;
5
+ };
6
+
7
+ // biome-ignore lint/suspicious/noEmptyInterface: To be extended via declare module
8
+ interface MutualDataMapping {}
9
+
10
+ type MutualData<
11
+ B extends Entity,
12
+ T extends Entity,
13
+ > = B extends keyof MutualDataMapping
14
+ ? T extends keyof MutualDataMapping[B]
15
+ ? MutualDataMapping[B][T]
16
+ : Record<string, any> // Fallback for unmatched T
17
+ : Record<string, any>;
18
+
19
+ type Mutual<B extends Entity = Entity, T extends Entity = Entity> = {
20
+ entityId: string;
21
+ entityType: T;
22
+ byEntityId: string;
23
+ byEntityType: B;
24
+ mutualId: string;
25
+ data: T extends keyof EntitySchemaMap ? EntitySchemaMap[T] : never;
26
+ mutualData: MutualData<B, T> | Record<string, any>;
27
+ createdAt: string;
28
+ updatedAt: string;
29
+ mutualUpdatedAt: string;
30
+ };
31
+
32
+ export type { MutualDataWithIndex, MutualDataMapping, MutualData, Mutual };