@shopify/app-bridge-host
Version:
App Bridge Host contains components and middleware to be consumed by the app's host, as well as the host itself. The middleware and `Frame` component are responsible for facilitating communication between the client and host, and used to act on actions se
49 lines (48 loc) • 1.68 kB
TypeScript
import type { ApiClientConfig, HostFeatures } from './types';
export declare const API_CLIENT_LOAD = "APICLIENT::LOAD";
export declare const API_CLIENT_UNLOAD = "APICLIENT::UNLOAD";
export declare const REDUCER_LOAD = "REDUCER::LOAD";
export declare const REDUCER_LOAD_COMPLETE = "REDUCER::LOAD_COMPLETE";
export interface ApiClientLoadAction {
type: typeof API_CLIENT_LOAD;
payload: ApiClientConfig;
}
export interface ApiClientUnloadAction {
type: typeof API_CLIENT_UNLOAD;
payload: ApiClientConfig;
}
export interface LoadReducerAction {
type: typeof REDUCER_LOAD;
payload: {
feature: HostFeatures;
};
}
export interface LoadCompleteReducerAction {
type: typeof REDUCER_LOAD_COMPLETE;
payload: {
feature: HostFeatures;
};
}
export declare function apiClientLoad(payload: ApiClientConfig): ApiClientLoadAction;
export declare function apiClientUnload(payload: ApiClientConfig): ApiClientUnloadAction;
/**
* Creates an load reducer action
* @internal
*/
export declare function hostLoadReducer(feature: HostFeatures): LoadReducerAction;
/**
* Creates an add reducer action
* @internal
*/
export declare function hostLoadCompleteReducer(feature: HostFeatures): LoadCompleteReducerAction;
/**
* Predicate to determine if an action is an load reducer action
* @internal
*/
export declare function isLoadReducerAction(action: any): action is LoadReducerAction;
/**
* Predicate to determine if an action is an load reducer complete action
* @internal
*/
export declare function isLoadReducerCompleteAction(action: any): action is LoadCompleteReducerAction;
export declare function actionWrapper(action: any): any;