@shopgate/engage
Version:
Shopgate's ENGAGE library.
43 lines (38 loc) • 829 B
TypeScript
import { type Context } from 'react';
import {
type WidgetDefinitionLayout,
type WidgetDefinitionVisibility,
type WidgetDefinition,
} from './types'
export { WidgetDefinition } from './types';
export interface WidgetContextType<C = Record<string, any>> {
/**
* The unique code of the widget instance
*/
code: string;
/**
* The name of the widget
*/
name: string;
/**
* The widget configuration
*/
config: C;
/**
* The widget layout settings
*/
layout: WidgetDefinitionLayout;
/**
* The widget visibility settings
*/
visibility: WidgetDefinitionVisibility;
/**
* Whether the widget is rendered in preview mode
*/
isPreview: boolean;
}
/**
* React context for widgets.
*/
declare const WidgetContext: Context<WidgetContextType>;
export default WidgetContext;