@base-stone/hooks 0.8.8 → 0.9.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.
- package/dist/design-hooks.es.prod.d.ts +14 -12
- package/package.json +1 -1
|
@@ -22,26 +22,28 @@ declare interface GlobalTableConfig {
|
|
|
22
22
|
|
|
23
23
|
declare type MapData<T extends string | number = string | number> = Map<T, string | number | undefined>;
|
|
24
24
|
|
|
25
|
+
declare interface ModalConfig<T = any> {
|
|
26
|
+
width: number;
|
|
27
|
+
title: string | ((data: T) => string);
|
|
28
|
+
open: boolean;
|
|
29
|
+
maskClosable: boolean;
|
|
30
|
+
centered: boolean;
|
|
31
|
+
destroyOnHidden: boolean;
|
|
32
|
+
onCancel: () => void;
|
|
33
|
+
}
|
|
34
|
+
|
|
25
35
|
declare type ModalInstance<T = any> = {
|
|
26
36
|
visible: boolean;
|
|
27
37
|
data: T;
|
|
28
|
-
props:
|
|
29
|
-
width: number;
|
|
30
|
-
title: string;
|
|
31
|
-
open: boolean;
|
|
32
|
-
maskClosable: boolean;
|
|
33
|
-
centered: boolean;
|
|
34
|
-
destroyOnHidden: boolean;
|
|
35
|
-
onCancel: () => void;
|
|
36
|
-
};
|
|
38
|
+
props: ModalProps;
|
|
37
39
|
toggle: (data?: T) => void;
|
|
38
40
|
open: (data?: T) => void;
|
|
39
41
|
close: () => void;
|
|
40
42
|
};
|
|
41
43
|
|
|
42
|
-
export declare interface ModalProps
|
|
44
|
+
export declare interface ModalProps {
|
|
43
45
|
width: number;
|
|
44
|
-
title: string
|
|
46
|
+
title: string;
|
|
45
47
|
maskClosable?: boolean;
|
|
46
48
|
centered?: boolean;
|
|
47
49
|
destroyOnHidden?: boolean;
|
|
@@ -126,7 +128,7 @@ declare interface TableResponse<T> {
|
|
|
126
128
|
};
|
|
127
129
|
}
|
|
128
130
|
|
|
129
|
-
export declare function useCreateModal<const T extends Record<string,
|
|
131
|
+
export declare function useCreateModal<const T extends Record<string, ModalConfig>>(configs: T): {
|
|
130
132
|
[K in keyof T as `${string & K}Modal`]: ModalInstance;
|
|
131
133
|
} & {
|
|
132
134
|
open: (type: keyof T, data?: any) => void;
|