UNPKG

@finapi/finapi-js-loader

Version:

finAPI JS Loader

110 lines (109 loc) 4.45 kB
import { Widget } from '../Widget'; import { ModBaseWidgetCallbacks, ModBaseWidgetProperties } from '../mods/modBaseWidget'; import { ModLanguageProperties } from '../mods/modLanguage'; /** @internal */ export type DemoConfig = { /** * Custom bundle file name used to fetch the demo widget JS source. It allows * to set 'main.js` which is produced when Widget Library runs in the * development mode. */ customBundleFileName?: string; /** * Configuration of external services used by demo widgets. */ servers?: { /** * Server URL from where the JS bundles are fetched from for demoable * widgets. * * @default https://widget-library-finapi-general-sandbox.finapi.io */ widgetLibraryServer?: string; /** * Server URL of the Process Controller API. * * @default https://widget-library-finapi-general-sandbox.finapi.io */ processctlServer?: string; /** * Server URL of the Process Controller Solutions API. * * @default https://di-processctl-finapi-general-sandbox.finapi.io */ processctlSolutionsServer?: string; /** * Server URL of the JS Static Resources. * * @default https://js-static-resources-finapi-general-sandbox.finapi.io */ jsStaticResourcesServer?: string; }; /** * Configuration of mandators used by demo widgets. */ mandatorIds?: { /** * MandatorId used for Kreditcheck Loan demo * * @default 08e2937f-f316-4598-8e61-5bb62e9a6868 */ creditcheckLoanMandatorId?: string; /** * MandatorId used for Kreditcheck Account demo * * @default ebbfd6e8-e432-4979-a6bf-25120784e115 */ creditcheckAccountMandatorId?: string; /** * MandatorId used for Giroident demo * * @default aa752409-e8db-4967-9257-94e0b11c4dfd */ giroidentMandatorId?: string; /** * MandatorId used for Dac B2C demo * * @default 07afc894-0270-4f67-aaf1-7602b6377a0d */ digitalAccountCheckMandatorId?: string; }; }; /** @internal */ export interface WidgetGalleryProperties extends ModBaseWidgetProperties, ModLanguageProperties { /** * Configuration used for the demo widgets */ demoConfig?: string | DemoConfig; /** * This limits the Widget Gallery to only show widgets that have a defined use * case that can be demonstrated. */ onlyWidgetsWithDemo?: boolean; /** * The filter method affects how the widget grid is filtered by utilizing the * use cases. The "toggle" method enables the toggling of individual use cases * and creating a filter that can consist of any combination. The "switch" * method allows for the selection of either one or all use cases, and is best * suited for situations where there are not a large number of widgets and * use cases. */ filterMethod?: 'toggle' | 'switch'; } /** @internal */ export type WidgetGalleryCallbacks = ModBaseWidgetCallbacks; /** @internal */ export declare class WidgetGallery extends Widget<WidgetGalleryProperties, WidgetGalleryCallbacks> { /** * # Widget Gallery * Widget Gallery is a widget in Widget Library which allows customers to * browse, try, and order Widgets offered by finAPI. It will be embedded on * the company’s homepage. * * @param container - parent HTML element where the widget will be injected * @param target - URL of the environment from which the widget's JS bundle will be fetched. Use this, for example, when testing features that are only released to the sandbox environment. By default, `https://widget-library-finapi-general-live.finapi.io` is used. * @param ownerDocument - parent Document where the widget will be injected. For example, shadow root or document fragment. By default, the default top-level document is used. * @param customBundleFileName - allows modifying the filename of the widget's JS bundle that will be fetched. This property is useful during dev mode when widgets are generated together into one `main.js` file. */ constructor(container: HTMLElement, target?: string, ownerDocument?: Document, customBundleFileName?: string); }