@fewangsit/wangsvue-fats 1.0.0-alpha.116 → 1.0.0-alpha.117

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.
@@ -25,12 +25,25 @@ export type FilterMatchMode =
25
25
  | 'DATE_BETWEEN';
26
26
 
27
27
  /**
28
- * @param args - The query parameters to be passed to the fetchOptionFn.
28
+ * Represents a function type for fetching options based on query parameters.
29
+ *
30
+ * @template T - The type of query parameters, extending `QueryParams`. Defaults to `any`.
31
+ *
32
+ * This function can have one of the following signatures:
33
+ * - A synchronous function that takes query parameters and returns an array of `Option` objects.
34
+ * - An asynchronous function that takes query parameters and returns a `Promise` resolving to an array of `Option` objects.
35
+ * - An asynchronous function that takes query parameters and returns a `Promise` resolving to an `AxiosResponse` containing a `FetchOptionResponse` object.
36
+ *
37
+ * @param args - The query parameters of type `T` used to fetch the options.
38
+ * @returns One of the following:
39
+ * - An array of `Option` objects.
40
+ * - A `Promise` resolving to an array of `Option` objects.
41
+ * - A `Promise` resolving to an `AxiosResponse` containing a `FetchOptionResponse` object.
29
42
  */
30
- export type FetchOptionFn =
31
- | ((args: any) => Option[] | undefined) // Sync function to fetch options
32
- | ((args: any) => Promise<Option[] | undefined>) // Async function
33
- | ((args: any) => Promise<AxiosResponse<FetchOptionResponse<any>>>); // The service method handle fetching options
43
+ export type FetchOptionFn<T extends QueryParams = any> =
44
+ | ((args: T) => Option[])
45
+ | ((args: T) => Promise<Option[]>)
46
+ | ((args: T) => Promise<AxiosResponse<FetchOptionResponse<T>>>);
34
47
 
35
48
  // More specific filter field types
36
49
  export interface MultiSelectFilterField extends MultiSelectProps {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fewangsit/wangsvue-fats",
3
- "version": "1.0.0-alpha.116",
3
+ "version": "1.0.0-alpha.117",
4
4
  "author": "Wangsit FE Developer",
5
5
  "description": "Fixed Asset Tagsamurai VueJS Component Library",
6
6
  "type": "module",