@base-stone/hooks 1.2.8 → 1.3.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.
|
@@ -115,10 +115,10 @@ declare interface RequestFn {
|
|
|
115
115
|
}>;
|
|
116
116
|
}
|
|
117
117
|
|
|
118
|
-
declare interface SelectConfig {
|
|
118
|
+
declare interface SelectConfig<K extends string> {
|
|
119
119
|
queryFn: (data: Record<string, any>) => Promise<QueryResponse>;
|
|
120
120
|
params?: Record<string, any>;
|
|
121
|
-
dataKey:
|
|
121
|
+
dataKey: K;
|
|
122
122
|
transform?: (result: Record<string, any>) => Record<string, any>[];
|
|
123
123
|
fieldNames: {
|
|
124
124
|
label: string;
|
|
@@ -200,9 +200,9 @@ export declare function useFormSubmit(requestFn: RequestFn, successFn: SuccessFn
|
|
|
200
200
|
|
|
201
201
|
export declare function useMemoizedFn<T extends noop>(fn: T): PickFunction<T>;
|
|
202
202
|
|
|
203
|
-
export declare function useRequestQuery<T = Record<string, any> | Record<string, any>[] | undefined>({ queryFn, params, dataType, dataKey, initialValue, transform }: QueryOptions<
|
|
203
|
+
export declare function useRequestQuery<T = Record<string, any> | Record<string, any>[] | undefined, const K extends string = string>({ queryFn, params, dataType, dataKey, initialValue, transform }: QueryOptions<K, T>): QueryResult<K, T>;
|
|
204
204
|
|
|
205
|
-
export declare function useSelectOptions<V extends string | number = string | number>({ queryFn, params, dataKey, fieldNames, transform }: SelectConfig): SelectOptionsResult<
|
|
205
|
+
export declare function useSelectOptions<V extends string | number = string | number, const K extends string = string>({ queryFn, params, dataKey, fieldNames, transform }: SelectConfig<K>): SelectOptionsResult<K, V>;
|
|
206
206
|
|
|
207
207
|
export declare function useTableList<T extends Record<string, any> = Record<string, any>>({ queryFn, params: initParams, transform, rowSelection }: TableOptions<T>): TableResult<T>;
|
|
208
208
|
|