@foris/avocado-not-front 8.7.1 → 8.7.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.
@@ -1,3 +1,3 @@
1
1
  import type { AxiosResponse } from 'axios';
2
- import { ApiConfig } from '../../types';
3
- export declare const nextUIService: (apiConfig: ApiConfig, userFlow: string, hash?: string, data?: {}, params?: {}) => Promise<AxiosResponse<any, any>>;
2
+ import type { ApiConfig, NextUIResponseData } from '../../types';
3
+ export declare const nextUIService: (apiConfig: ApiConfig, userFlow: string, hash?: string, data?: {}, params?: {}) => Promise<AxiosResponse<NextUIResponseData>>;
@@ -0,0 +1,11 @@
1
+ interface UIRequest {
2
+ order: number;
3
+ finished: Promise<void>;
4
+ finish: () => void;
5
+ }
6
+ export declare const beginUIRequest: (flow: string) => UIRequest;
7
+ export declare const finishUIRequest: (flow: string, request: UIRequest) => void;
8
+ export declare const registerUIResponse: (flow: string, request: UIRequest, response: unknown) => void;
9
+ /** Keep the final eligibility check and mutation together so newer requests cannot interleave. */
10
+ export declare const applyUIResponse: (flow: string, response: unknown, apply: () => void) => void | Promise<void>;
11
+ export {};
@@ -14,7 +14,7 @@ export type UserFlow = {
14
14
  isDrawerOpen?: boolean;
15
15
  };
16
16
  export declare const useStore: import("zustand").UseBoundStore<import("zustand").StoreApi<NotFrontStore>>;
17
- export declare const setNotFrontStore: (userFlowId: string, apiConfig: ApiConfig, page: PageContent, sessionState?: Record<string, unknown>, sessionId?: string) => void;
17
+ export declare const setNotFrontStore: (userFlowId: string, apiConfig: ApiConfig, page: PageContent, sessionState?: Record<string, unknown>, sessionId?: string) => void | Promise<void>;
18
18
  /**
19
19
  * Clears the overlay for a specific userFlow.
20
20
  * Useful for closing toasts, modals, or other overlay components.
@@ -29,7 +29,7 @@ export declare const clearOverlay: (userFlow: string) => void;
29
29
  * @returns The current overlay content or null if no overlay is active
30
30
  */
31
31
  export declare const getOverlay: (userFlow: string) => OverlayContent | null;
32
- export declare const setPage: (userFlow: string, response: NextUIResponseData) => void;
32
+ export declare const setPage: (userFlow: string, response: NextUIResponseData) => void | Promise<void>;
33
33
  /**
34
34
  * Updates the `entries` object of a specific userFlow in the store.
35
35
  *