@apia/api 0.1.3 → 0.2.4
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.ts +14 -10
- package/dist/index.js +1700 -1
- package/dist/index.js.map +1 -1
- package/package.json +8 -9
package/dist/index.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import * as theme_ui_jsx_runtime from 'theme-ui/jsx-runtime';
|
|
2
1
|
import * as React from 'react';
|
|
3
2
|
import { AxiosResponse, AxiosRequestConfig } from 'axios';
|
|
4
3
|
import { TModify, TApiaLoad } from '@apia/util';
|
|
5
4
|
import { TNotificationMessage, notify } from '@apia/notifications';
|
|
5
|
+
import { TModal } from '@apia/components';
|
|
6
6
|
import QueryString from 'qs';
|
|
7
7
|
|
|
8
8
|
declare function getConfig<LoadType>(outerBehaveConfig?: IApiaApiRequestConfig<LoadType>): IApiaApiRequestConfig<unknown> & IApiaApiRequestConfig<LoadType> & Partial<IApiaApiRequestConfig<unknown>>;
|
|
@@ -145,7 +145,14 @@ declare function makeApiaUrl(props?: {
|
|
|
145
145
|
preventAsXmlParameter?: boolean;
|
|
146
146
|
avoidTabId?: boolean;
|
|
147
147
|
[key: string]: unknown;
|
|
148
|
-
}): string;
|
|
148
|
+
}): string;
|
|
149
|
+
declare global {
|
|
150
|
+
interface Window {
|
|
151
|
+
TAB_ID_REQUEST: string;
|
|
152
|
+
CONTEXT: string;
|
|
153
|
+
URL_REQUEST_AJAX: string;
|
|
154
|
+
}
|
|
155
|
+
}
|
|
149
156
|
|
|
150
157
|
interface TColors {
|
|
151
158
|
exception?: string;
|
|
@@ -157,10 +164,12 @@ interface IApiaApiConsoleConfig {
|
|
|
157
164
|
colors?: TColors;
|
|
158
165
|
debug?: boolean;
|
|
159
166
|
}
|
|
167
|
+
type TSetModalProps = (configuration: THandleConfiguration, formDefinition?: TApiaLoad) => TModal | null;
|
|
160
168
|
interface IApiaApiRequestConfig<DataType> extends IApiaApiConsoleConfig {
|
|
161
169
|
axiosConfig?: AxiosRequestConfig;
|
|
162
170
|
modalConfiguration?: IModalConfig;
|
|
163
171
|
handleLoad?: boolean;
|
|
172
|
+
setModalProps?: TSetModalProps;
|
|
164
173
|
/**
|
|
165
174
|
* Algunas veces las funciones llamadas por una acción en el servidor
|
|
166
175
|
* tienen el mismo nombre siendo en realidad funciones distintas. Para
|
|
@@ -189,6 +198,7 @@ type TApiaApiMethodHandler = {
|
|
|
189
198
|
close: () => void;
|
|
190
199
|
configuration?: THandleConfiguration;
|
|
191
200
|
formDefinition: TApiaLoad;
|
|
201
|
+
setModalProps?: (configuration: THandleConfiguration, formDefinition?: TApiaLoad) => TModal | null;
|
|
192
202
|
reset: () => void;
|
|
193
203
|
setError: typeof notify;
|
|
194
204
|
setMessage: (message: Record<string, unknown>) => unknown;
|
|
@@ -204,7 +214,7 @@ interface IModalConfig {
|
|
|
204
214
|
onMessageClose?: () => unknown;
|
|
205
215
|
onSubmitted?: (handler: TApiaApiMethodHandler, response: AxiosResponse<Record<string, unknown> | null> | null) => unknown;
|
|
206
216
|
}
|
|
207
|
-
type THandleConfiguration = Partial<Pick<IApiaApiRequestConfig<unknown>, 'modalConfiguration' | 'methodsPath'>>;
|
|
217
|
+
type THandleConfiguration = Partial<Pick<IApiaApiRequestConfig<unknown>, 'modalConfiguration' | 'methodsPath' | 'setModalProps'>>;
|
|
208
218
|
interface IApiaApiHandlerState {
|
|
209
219
|
disabled: boolean;
|
|
210
220
|
isLoading: boolean;
|
|
@@ -213,12 +223,6 @@ interface IApiaApiHandlerState {
|
|
|
213
223
|
errors: Record<string, string>;
|
|
214
224
|
windowIndex: number;
|
|
215
225
|
}
|
|
216
|
-
declare const ApiaApiHandler: React.MemoExoticComponent<() =>
|
|
217
|
-
|
|
218
|
-
declare global {
|
|
219
|
-
interface Window {
|
|
220
|
-
[key: string]: string;
|
|
221
|
-
}
|
|
222
|
-
}
|
|
226
|
+
declare const ApiaApiHandler: React.MemoExoticComponent<() => React.JSX.Element>;
|
|
223
227
|
|
|
224
228
|
export { ApiaApi, ApiaApiHandler, IApiaApiRequestConfig, TApiaApiAxiosResponse, TApiaApiMethod, TApiaApiResult, makeApiaUrl };
|