@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
22 lines (21 loc) • 801 B
TypeScript
import React from 'react';
import { ApiClientConfig, Application, Middleware } from './types';
export type ReactComponent<P> = React.FunctionComponent<P> | React.ComponentClass<P>;
export interface Context {
appBridgeMiddleware: Middleware;
}
export interface DispatchToProps {
(app: Application): any;
}
export interface WithAppProps<Store> {
app: Application;
store: Store;
}
export interface RequiredProps {
config: ApiClientConfig;
}
export interface State {
mounted: boolean;
}
export type StoreToProps<Store> = (obj: any) => Store;
export declare function withApp<Store>(storeToProps?: StoreToProps<Store>, dispatchToProps?: DispatchToProps): <OwnProps>(WrappedComponent: ReactComponent<OwnProps>) => React.ComponentClass<OwnProps & RequiredProps & WithAppProps<Store>>;