api-core-lib 11.2.2 → 11.3.3
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/index.d.mts +28 -2
- package/dist/index.d.ts +28 -2
- package/dist/index.js +1 -1
- package/dist/index.mjs +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -327,6 +327,28 @@ interface UseApiReturn<T> {
|
|
|
327
327
|
query: UseApiQuery;
|
|
328
328
|
}
|
|
329
329
|
|
|
330
|
+
/**
|
|
331
|
+
* [إضافة جديدة]
|
|
332
|
+
* يمثل الكائن الكامل الذي يتم إرجاعه من الهوك `useApiModule`.
|
|
333
|
+
* يفصل بين الدوال المستقرة والحالات المتغيرة.
|
|
334
|
+
* @template TModule نوع إعدادات الموديول.
|
|
335
|
+
*/
|
|
336
|
+
interface UseApiModuleReturn<TModule extends ApiModuleConfig> {
|
|
337
|
+
/**
|
|
338
|
+
* قاموس من الإجراءات التنفيذية المستقرة.
|
|
339
|
+
* آمن للاستخدام في مصفوفات الاعتماديات مثل `useEffect`.
|
|
340
|
+
*/
|
|
341
|
+
actions: ModuleActions<TModule>;
|
|
342
|
+
/**
|
|
343
|
+
* قاموس من الحالات المتغيرة لجميع الإجراءات.
|
|
344
|
+
* استخدم هذا الكائن لعرض البيانات، وحالات التحميل، والأخطاء في واجهة المستخدم.
|
|
345
|
+
*/
|
|
346
|
+
states: Record<keyof TModule['actions'], ActionState<any>>;
|
|
347
|
+
/**
|
|
348
|
+
* قاموس من أدوات التحكم بالاستعلام لجميع الإجراءات التي تم تمييزها بـ `isList: true`.
|
|
349
|
+
*/
|
|
350
|
+
queries: Record<string, UseApiQuery | undefined>;
|
|
351
|
+
}
|
|
330
352
|
/**
|
|
331
353
|
* يصف إجراءً واحدًا داخل وحدة API، مع أنواع دقيقة للإدخال والإخراج.
|
|
332
354
|
* @template TInput نوع بيانات الإدخال (الجسم أو معاملات الاستعلام).
|
|
@@ -552,7 +574,11 @@ declare const processResponse: <T>(responseOrError: AxiosResponse<any> | ApiErro
|
|
|
552
574
|
|
|
553
575
|
declare function useApi<T>(axiosInstance: AxiosInstance, config: UseApiConfig<T>): UseApiReturn<T>;
|
|
554
576
|
|
|
555
|
-
|
|
577
|
+
/**
|
|
578
|
+
* هوك متقدم يقوم ببناء مجموعة من الإجراءات القابلة للتنفيذ من إعدادات موديول API،
|
|
579
|
+
* مع فصل تام بين الدوال المستقرة والحالات المتغيرة لمنع الحلقات اللانهائية.
|
|
580
|
+
*/
|
|
581
|
+
declare function useApiModule<TModule extends ApiModuleConfig>(axiosInstance: AxiosInstance, moduleConfig: TModule, options?: UseApiModuleOptions): UseApiModuleReturn<TModule>;
|
|
556
582
|
|
|
557
583
|
type ApiResourceStatus = 'idle' | 'loading' | 'success' | 'error';
|
|
558
584
|
interface UseApiResourceState<T> {
|
|
@@ -600,4 +626,4 @@ interface UseApiResourceReturn<T, TCreate, TUpdate, TPathParams> {
|
|
|
600
626
|
setQuery: React.Dispatch<React.SetStateAction<QueryOptions>>;
|
|
601
627
|
}
|
|
602
628
|
|
|
603
|
-
export { type ActionConfig, type ActionOptions, type ActionState, type ApiClientConfig, type ApiError, type ApiModuleConfig, type ApiResourceStatus, type ApiResponse, type ExecutableAction, type LogLevel, type Logger, type Middleware, type MiddlewareContext, type ModuleActions, type PaginationMeta, type QueryOptions, type RefreshTokenConfig, type RequestConfig, type StandardResponse, type TokenManager, type Tokens, type UseApiActions, type UseApiConfig, type UseApiModuleOptions, type UseApiQuery, type UseApiResourceActions, type UseApiResourceConfig, type UseApiResourceReturn, type UseApiResourceState, type UseApiReturn, type UseApiState, type ValidationError, buildPaginateQuery, cacheManager, createApiActions, createApiClient, createApiServices, processResponse, useApi, useApiModule };
|
|
629
|
+
export { type ActionConfig, type ActionOptions, type ActionState, type ApiClientConfig, type ApiError, type ApiModuleConfig, type ApiResourceStatus, type ApiResponse, type ExecutableAction, type LogLevel, type Logger, type Middleware, type MiddlewareContext, type ModuleActions, type PaginationMeta, type QueryOptions, type RefreshTokenConfig, type RequestConfig, type StandardResponse, type TokenManager, type Tokens, type UseApiActions, type UseApiConfig, type UseApiModuleOptions, type UseApiModuleReturn, type UseApiQuery, type UseApiResourceActions, type UseApiResourceConfig, type UseApiResourceReturn, type UseApiResourceState, type UseApiReturn, type UseApiState, type ValidationError, buildPaginateQuery, cacheManager, createApiActions, createApiClient, createApiServices, processResponse, useApi, useApiModule };
|
package/dist/index.d.ts
CHANGED
|
@@ -327,6 +327,28 @@ interface UseApiReturn<T> {
|
|
|
327
327
|
query: UseApiQuery;
|
|
328
328
|
}
|
|
329
329
|
|
|
330
|
+
/**
|
|
331
|
+
* [إضافة جديدة]
|
|
332
|
+
* يمثل الكائن الكامل الذي يتم إرجاعه من الهوك `useApiModule`.
|
|
333
|
+
* يفصل بين الدوال المستقرة والحالات المتغيرة.
|
|
334
|
+
* @template TModule نوع إعدادات الموديول.
|
|
335
|
+
*/
|
|
336
|
+
interface UseApiModuleReturn<TModule extends ApiModuleConfig> {
|
|
337
|
+
/**
|
|
338
|
+
* قاموس من الإجراءات التنفيذية المستقرة.
|
|
339
|
+
* آمن للاستخدام في مصفوفات الاعتماديات مثل `useEffect`.
|
|
340
|
+
*/
|
|
341
|
+
actions: ModuleActions<TModule>;
|
|
342
|
+
/**
|
|
343
|
+
* قاموس من الحالات المتغيرة لجميع الإجراءات.
|
|
344
|
+
* استخدم هذا الكائن لعرض البيانات، وحالات التحميل، والأخطاء في واجهة المستخدم.
|
|
345
|
+
*/
|
|
346
|
+
states: Record<keyof TModule['actions'], ActionState<any>>;
|
|
347
|
+
/**
|
|
348
|
+
* قاموس من أدوات التحكم بالاستعلام لجميع الإجراءات التي تم تمييزها بـ `isList: true`.
|
|
349
|
+
*/
|
|
350
|
+
queries: Record<string, UseApiQuery | undefined>;
|
|
351
|
+
}
|
|
330
352
|
/**
|
|
331
353
|
* يصف إجراءً واحدًا داخل وحدة API، مع أنواع دقيقة للإدخال والإخراج.
|
|
332
354
|
* @template TInput نوع بيانات الإدخال (الجسم أو معاملات الاستعلام).
|
|
@@ -552,7 +574,11 @@ declare const processResponse: <T>(responseOrError: AxiosResponse<any> | ApiErro
|
|
|
552
574
|
|
|
553
575
|
declare function useApi<T>(axiosInstance: AxiosInstance, config: UseApiConfig<T>): UseApiReturn<T>;
|
|
554
576
|
|
|
555
|
-
|
|
577
|
+
/**
|
|
578
|
+
* هوك متقدم يقوم ببناء مجموعة من الإجراءات القابلة للتنفيذ من إعدادات موديول API،
|
|
579
|
+
* مع فصل تام بين الدوال المستقرة والحالات المتغيرة لمنع الحلقات اللانهائية.
|
|
580
|
+
*/
|
|
581
|
+
declare function useApiModule<TModule extends ApiModuleConfig>(axiosInstance: AxiosInstance, moduleConfig: TModule, options?: UseApiModuleOptions): UseApiModuleReturn<TModule>;
|
|
556
582
|
|
|
557
583
|
type ApiResourceStatus = 'idle' | 'loading' | 'success' | 'error';
|
|
558
584
|
interface UseApiResourceState<T> {
|
|
@@ -600,4 +626,4 @@ interface UseApiResourceReturn<T, TCreate, TUpdate, TPathParams> {
|
|
|
600
626
|
setQuery: React.Dispatch<React.SetStateAction<QueryOptions>>;
|
|
601
627
|
}
|
|
602
628
|
|
|
603
|
-
export { type ActionConfig, type ActionOptions, type ActionState, type ApiClientConfig, type ApiError, type ApiModuleConfig, type ApiResourceStatus, type ApiResponse, type ExecutableAction, type LogLevel, type Logger, type Middleware, type MiddlewareContext, type ModuleActions, type PaginationMeta, type QueryOptions, type RefreshTokenConfig, type RequestConfig, type StandardResponse, type TokenManager, type Tokens, type UseApiActions, type UseApiConfig, type UseApiModuleOptions, type UseApiQuery, type UseApiResourceActions, type UseApiResourceConfig, type UseApiResourceReturn, type UseApiResourceState, type UseApiReturn, type UseApiState, type ValidationError, buildPaginateQuery, cacheManager, createApiActions, createApiClient, createApiServices, processResponse, useApi, useApiModule };
|
|
629
|
+
export { type ActionConfig, type ActionOptions, type ActionState, type ApiClientConfig, type ApiError, type ApiModuleConfig, type ApiResourceStatus, type ApiResponse, type ExecutableAction, type LogLevel, type Logger, type Middleware, type MiddlewareContext, type ModuleActions, type PaginationMeta, type QueryOptions, type RefreshTokenConfig, type RequestConfig, type StandardResponse, type TokenManager, type Tokens, type UseApiActions, type UseApiConfig, type UseApiModuleOptions, type UseApiModuleReturn, type UseApiQuery, type UseApiResourceActions, type UseApiResourceConfig, type UseApiResourceReturn, type UseApiResourceState, type UseApiReturn, type UseApiState, type ValidationError, buildPaginateQuery, cacheManager, createApiActions, createApiClient, createApiServices, processResponse, useApi, useApiModule };
|