/** * A service for handling plugins for picasso charts. * * @param {object} params Parameters object. * @param {object} params.picassoInstance Picasso.js instance (used to register custom components). * @param {object} params.plugins The array of plugins passed in to the chart. * @param {object} params.pluginArgs Object containing values that will be passed as arguments to the plugins. */ export default function createPluginService({ picassoInstance, plugins, pluginArgs }: { picassoInstance: object; plugins: object; pluginArgs: object; }): { /** * Registers custom components and extends or adds component definitions. * @returns {Promise} Promise object that either resolves with undefined or rejects with reason. */ initialize(): Promise; /** * Extends component if keys are matching, otherwise appends it. * Brush consumers are extended by matching "context" - otherwise appended. * @param {PicassoComponentDef[]} originalDefinitions Original array of component definitions * @returns {PicassoComponentDef[]} The original component definitions extended with the new definitions */ extendComponents(originalDefinitions: PicassoComponentDef[]): PicassoComponentDef[]; };