@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
47 lines (46 loc) • 1.97 kB
TypeScript
import { AnyAction, ActionCreatorsMapObject } from 'redux';
import * as ContextualSaveBar from '@shopify/app-bridge-core/actions/ContextualSaveBar';
import type { FeatureWithApi } from '../../../../withFeature';
export interface ContextualSaveBarActionCreatorsMap extends ActionCreatorsMapObject {
discard: typeof ContextualSaveBar.discard;
hide: typeof ContextualSaveBar.hide;
save: typeof ContextualSaveBar.save;
show: typeof ContextualSaveBar.show;
update: typeof ContextualSaveBar.update;
}
export declare const contextualSaveBarActionCreatorsMap: ContextualSaveBarActionCreatorsMap;
export interface NormalizedStore {
id: string;
fullWidth: boolean;
saveAction: {
disabled: boolean;
loading: boolean;
};
discardAction: {
disabled: boolean;
loading: boolean;
discardConfirmationModal: boolean;
};
leaveConfirmationDisable: boolean;
}
export type ContextualSaveBarStore = NormalizedStore | null;
export declare const defaultContextualSaveBarStore: null;
export default function contextualSaveBarReducer(state: ContextualSaveBarStore | undefined, action: ContextualSaveBar.ContextualSaveBarAction | AnyAction): ContextualSaveBarStore;
/**
* The interface props that are passed down to the Loading component
* as a the result of calling the `withFeature` decorator
* @public
* */
export interface WithFeature {
store: ContextualSaveBarStore;
actions: ContextualSaveBarActionCreatorsMap;
api: ContextualSaveBar.ContextualSaveBarApi;
}
export type ContextualSaveBarFeature = FeatureWithApi<WithFeature['store'], WithFeature['actions'], WithFeature['api']>;
/**
* An object containing the key, actions, initial state and reducer of the Loading feature
* Can be used with the `withFeature` decorator to add the reducer
* and then make its actions and store available to the wrapped component
* @public
* */
export declare const feature: ContextualSaveBarFeature;