@apia/util 0.1.0 → 0.1.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.ts CHANGED
@@ -3,7 +3,8 @@ import React__default, { EffectCallback, Dispatch, SetStateAction, MutableRefObj
3
3
  import { AxiosResponse } from 'axios';
4
4
  import * as theme_ui_jsx_runtime from 'theme-ui/jsx-runtime';
5
5
  import { TIconName, TIconType } from '@apia/icons';
6
- import { TId as TId$1 } from '@apia/util';
6
+
7
+ declare function animate(duration: number, callback: (progress: number) => unknown, onFinish?: () => unknown): () => void;
7
8
 
8
9
  declare function arrayOrArray<T>(o: T | T[] | undefined): T[];
9
10
 
@@ -946,7 +947,10 @@ type TEventsMap<OriginalEvents extends TMap> = {
946
947
  [Name in keyof OriginalEvents]: (args: OriginalEvents[Name]) => unknown;
947
948
  };
948
949
  type TEventsHandlers<OriginalEvents extends TMap> = Record<TId, {
949
- [Name in keyof OriginalEvents]?: ((args?: OriginalEvents[Name]) => unknown)[];
950
+ [Name in keyof OriginalEvents]?: {
951
+ cb: (args?: OriginalEvents[Name]) => unknown;
952
+ uniqueHookId: string;
953
+ }[];
950
954
  }>;
951
955
  type TMap = Record<string, any>;
952
956
  type TStateManager<State> = (newState: Partial<State>) => void;
@@ -1007,7 +1011,7 @@ declare function makeSingleImperativeComponent<ComponentProps extends TMap, Even
1007
1011
  Component: FC<Omit<ComponentProps, "id"> & State>;
1008
1012
  }) => [TSingleMethodsMap<Methods, TMethodsMap<Methods>>, <K extends keyof Events>(ev: K, args: Events[K]) => void, FC<ComponentProps>];
1009
1013
 
1010
- declare const useImperativeComponentEvents: <Events extends TMap = TMap>(handlers: Partial<TEventsMap<Events>>) => void;
1014
+ declare const useImperativeComponentEvents: <Events extends TMap = TMap>(handlers: Partial<TEventsMap<Events>>) => string;
1011
1015
 
1012
1016
  /**
1013
1017
  * Permite el uso de eventos en herederos directos o no del imperativeComponent
@@ -1276,31 +1280,31 @@ interface IPropsStoreConf {
1276
1280
  propsLog?: string;
1277
1281
  };
1278
1282
  }
1279
- declare class PropsStore<PropsType extends Record<TId$1, unknown> = Record<TId$1, unknown>> {
1283
+ declare class PropsStore<PropsType extends Record<TId, unknown> = Record<TId, unknown>> {
1280
1284
  private configuration?;
1281
1285
  log: unknown;
1282
- fields: Record<TId$1, PropsType>;
1283
- suscriptors: Record<TId$1, TPropsSuscriptor<PropsType>[]>;
1286
+ fields: Record<TId, PropsType>;
1287
+ suscriptors: Record<TId, TPropsSuscriptor<PropsType>[]>;
1284
1288
  loggers: Record<string, (props: unknown[]) => void>;
1285
1289
  constructor(configuration?: IPropsStoreConf | undefined);
1286
1290
  destructor(): void;
1287
- getAllFields(): Record<TId$1, PropsType>;
1291
+ getAllFields(): Record<TId, PropsType>;
1288
1292
  /**
1289
1293
  * Devuelve los props actuales de un campo.
1290
1294
  */
1291
- getFieldProps<ParsedPropsType = PropsType>(fieldId: TId$1): ParsedPropsType;
1292
- removeField(fieldId: TId$1): void;
1295
+ getFieldProps<ParsedPropsType = PropsType>(fieldId: TId): ParsedPropsType;
1296
+ removeField(fieldId: TId): void;
1293
1297
  /**
1294
1298
  * Permite establecer un suscriptor que será llamado
1295
1299
  * cada vez que las props del campo especificado cambien.
1296
1300
  */
1297
- suscribe(fieldId: TId$1, callback: TPropsSuscriptor<PropsType>): () => void;
1301
+ suscribe(fieldId: TId, callback: TPropsSuscriptor<PropsType>): () => void;
1298
1302
  /**
1299
1303
  * Actualiza o crea las props de un campo.
1300
1304
  *
1301
1305
  * La tercera prop está relacionada
1302
1306
  */
1303
- updateField<NewPropsType extends Record<TId$1, unknown> = Partial<PropsType>>(fieldId: TId$1, props: Partial<NewPropsType>, conf?: TUpdateFieldConfiguration): void;
1307
+ updateField<NewPropsType extends Record<TId, unknown> = Partial<PropsType>>(fieldId: TId, props: Partial<NewPropsType>, conf?: TUpdateFieldConfiguration): void;
1304
1308
  }
1305
1309
  declare const propsStore: PropsStore<TProperties>;
1306
1310
 
@@ -1338,7 +1342,7 @@ declare function isPropsConfigurationObject<Selected, PropsType extends Record<s
1338
1342
  * en el store.
1339
1343
  * @returns
1340
1344
  */
1341
- declare function usePropsSelector<Selected = TProperties, PropsType extends Record<string, unknown> = TProperties>(fieldId: TId$1, configuration?: TPropsConfiguration<Selected, PropsType>): Selected;
1345
+ declare function usePropsSelector<Selected = TProperties, PropsType extends Record<string, unknown> = TProperties>(fieldId: TId, configuration?: TPropsConfiguration<Selected, PropsType>): Selected;
1342
1346
  /**
1343
1347
  *
1344
1348
  * Este hook permite escuchar los cambios en las propiedades
@@ -1364,7 +1368,7 @@ declare function usePropsSelector<Selected = TProperties, PropsType extends Reco
1364
1368
  *
1365
1369
  * @returns
1366
1370
  */
1367
- declare function usePropsSelector<Selected = TProperties, PropsType extends Record<string, unknown> = TProperties>(fieldId: TId$1, selector?: TPropsSelector<Selected, PropsType> | TPropsConfiguration<Selected, PropsType>, comparator?: TPropsComparator<Selected>, anotherPropsStore?: PropsStore<PropsType>): Selected;
1371
+ declare function usePropsSelector<Selected = TProperties, PropsType extends Record<string, unknown> = TProperties>(fieldId: TId, selector?: TPropsSelector<Selected, PropsType> | TPropsConfiguration<Selected, PropsType>, comparator?: TPropsComparator<Selected>, anotherPropsStore?: PropsStore<PropsType>): Selected;
1368
1372
 
1369
1373
  /**
1370
1374
  * El hook useDomState permite aplicar propiedades a un
@@ -1639,5 +1643,4 @@ declare global {
1639
1643
  }
1640
1644
  }
1641
1645
 
1642
- export { AriaLiveEmitter, EventEmitter, IOnFocusConfiguration, IParameter, ISetBoundary, ITabsController, LiveRegion, PropsSelectorUndefinedObject, PropsStore, TApiaAction, TApiaActions, TApiaCellDefinition, TApiaComplexCell, TApiaFieldPropsObj, TApiaFilter, TApiaFilterOption, TApiaFilterValue, TApiaFormButton, TApiaFormElement, TApiaFormElementOption, TApiaFunction, TApiaFunctionPageInfo, TApiaLoad, TApiaLoadForm, TApiaLoadText, TApiaMessage, TApiaMultiplePossibleValue, TApiaPossibleValue, TApiaRadioPossibleValue, TApiaRowDefinition, TApiaSelectPossibleValue, TApiaSystemMessageObj, TApiaTableFunction, TCallback, TDateFormat, TDispatchCallback, TFieldEvent, TFieldScriptEvent, TFieldScriptEvents, TFieldServerEvent, TFieldServerEvents, TFncParams, TFocusRetriever, TId, TKey, TMap$1 as TMap, TMessage, TModify, TNotificationMessage, TPropsComparator, TPropsConfiguration, TPropsSelector, TRequireOnlyOne, TShortcutBranch, TUpdateFieldConfiguration, Url, WithEventsValue, addBoundary, apiaDateToStandarFormat, arrayOrArray, autoDisconnectMutationObserver, cantFocusSelector, customEvents, dateToApiaFormat, debugDispatcher, decrypt, disableChildrenFocus, downloadUrl, enableChildrenFocus, enableDebugDispatcher, encrypt, findOffsetRelativeToScrollParent, findScrollContainer, focus, focusSelector, formatMessage, getDateFormat, getFocusSelector, getIndex, getLabel, getSpecificParent, getValueByPath, globalFocus, isChild, isDebugDispatcherEnabled, isPropsConfigurationObject, makeImperativeComponent, makeSingleImperativeComponent, noNaN, notificationsSelector, parseAsSize, parseXmlAsync, persistentStorage, propsStore, screenLocker, scrollParentIntoElement, setValueByPath, shortcutController, toBoolean, ucfirst, useCombinedRefs, useDebouncedCallback, useDebouncedState, useDomState, useImperativeComponentContext, useImperativeComponentEvents, useLatest, useLocalStorage, useMount, usePanAndZoom, usePrevious, usePropsSelector, useStateRef, useUnmount, useUpdateEffect };
1643
- //# sourceMappingURL=index.d.ts.map
1646
+ export { AriaLiveEmitter, EventEmitter, IOnFocusConfiguration, IParameter, ISetBoundary, ITabsController, LiveRegion, PropsSelectorUndefinedObject, PropsStore, TApiaAction, TApiaActions, TApiaCellDefinition, TApiaComplexCell, TApiaFieldPropsObj, TApiaFilter, TApiaFilterOption, TApiaFilterValue, TApiaFormButton, TApiaFormElement, TApiaFormElementOption, TApiaFunction, TApiaFunctionPageInfo, TApiaLoad, TApiaLoadForm, TApiaLoadText, TApiaMessage, TApiaMultiplePossibleValue, TApiaPossibleValue, TApiaRadioPossibleValue, TApiaRowDefinition, TApiaSelectPossibleValue, TApiaSystemMessageObj, TApiaTableFunction, TCallback, TDateFormat, TDispatchCallback, TFieldEvent, TFieldScriptEvent, TFieldScriptEvents, TFieldServerEvent, TFieldServerEvents, TFncParams, TFocusRetriever, TId, TKey, TMap$1 as TMap, TMessage, TModify, TNotificationMessage, TPropsComparator, TPropsConfiguration, TPropsSelector, TRequireOnlyOne, TShortcutBranch, TUpdateFieldConfiguration, Url, WithEventsValue, addBoundary, animate, apiaDateToStandarFormat, arrayOrArray, autoDisconnectMutationObserver, cantFocusSelector, customEvents, dateToApiaFormat, debugDispatcher, decrypt, disableChildrenFocus, downloadUrl, enableChildrenFocus, enableDebugDispatcher, encrypt, findOffsetRelativeToScrollParent, findScrollContainer, focus, focusSelector, formatMessage, getDateFormat, getFocusSelector, getIndex, getLabel, getSpecificParent, getValueByPath, globalFocus, isChild, isDebugDispatcherEnabled, isPropsConfigurationObject, makeImperativeComponent, makeSingleImperativeComponent, noNaN, notificationsSelector, parseAsSize, parseXmlAsync, persistentStorage, propsStore, screenLocker, scrollParentIntoElement, setValueByPath, shortcutController, toBoolean, ucfirst, useCombinedRefs, useDebouncedCallback, useDebouncedState, useDomState, useImperativeComponentContext, useImperativeComponentEvents, useLatest, useLocalStorage, useMount, usePanAndZoom, usePrevious, usePropsSelector, useStateRef, useUnmount, useUpdateEffect };