import { SimpleTopicsAPI } from './core/topics-plugin/simple-topics/model'; /** * Record of Services */ export declare type Services = Record; /** * Record of Functions */ export declare type Functions = Record; /** * A context is described by a Description object. It can consist of three parts, * describing the capabilities, behaviour and identity of an fragment. * * @property services - the services, provided by a fragment. Services can contain pure service functions, * nested services and / or services mixed with topic services * @property functions - the functions, provided from this fragment to its arrangement. * @property config - allows an arrangement to overwrite a default configuration of its embe fragments */ export declare type FrontendDescription = { services?: Services; functions?: Functions; fragmentsConfig?: Record; }; export declare type GenericPluginAPI = { context: { _plugins: Record; functions: Functions; }; description: FrontendDescription; frameId: string; functions: Functions; callback: CallableFunction; }; /** * Functions to enhance the expose and updateContext Functions by a plugin */ export declare type PluginFunctions = { enhanceExpose: (description: D, context: C) => Promise | E | void; enhanceUpdateContext?: (context: C) => Promise | E | void; reservedWords?: Array; enhanceExtractContextAsArrangement?: (data: GenericPluginAPI) => unknown; enhanceExtractContextAsFragment?: (data: GenericPluginAPI) => unknown; enhanceExtractFragmentDescription?: (data: GenericPluginAPI) => unknown; }; /** * extractContextAsArrangement: Extracts the important information from a context, needed by a fragment from its * arrangement */ export declare type Collage = { expose: (description: D) => Promise; updateContext: (context: C) => Promise; reservedWords: Array; extractContextAsArrangement: (data: GenericPluginAPI) => unknown; extractContextAsFragment: (data: GenericPluginAPI) => unknown; extractFragmentDescription: (data: GenericPluginAPI) => unknown; }; /** * Enhances collage with additional features */ export declare type Plugin = (previous: Collage) => Collage; /** * Record of Fragments */ export declare type Fragments = Record void; }>; /** * Represents the state of a Fragment at runtime */ export declare type Context = FrontendDescription & { id?: string; fragments?: Fragments; _plugins?: Record; }; /** * The ContextApi object is returned from the expose function. * @property id - context id of the fragment * @property services - services exposed by this context * @property topics - topics exposed by this context * @property fragments - all contained named fragments * @property config - our own overwriten config */ export declare type ContextApi = { id: string; services: Services; fragments: Fragments; config: Record; topics: SimpleTopicsAPI & Record; };