@finapi/web-form
Version:
Library for integrating the finAPI Web Form
24 lines (23 loc) • 1.12 kB
TypeScript
import { WebFormHandlers, WebFormProps } from "./props.types";
/**
* Injects Web Component into the target HTMLElement. When this function is
* called for the first time, it will also create a new script tag that will
* fetch the Web Component source js file. Before the new Web Component, any
* previous instance will be first automatically unloaded.
*
* @param {HTMLElement} target - a target element into which the Web Form will
* be appended as a child
* @param {WebFormProps} properties - Web Form properties
* @param {WebFormHandlers} handlers - Web Form event handlers
* @param {Document} ownerDocument - a document into which body a script tag
* that loads Web Component source is injected. If undefined, the
* globally-scoped document is selected.
*/
export declare function load(target: HTMLElement, properties: WebFormProps, handlers?: WebFormHandlers, ownerDocument?: Document): void;
/**
* Removes Web Component from the document.
*
* @param {Document} ownerDocument - a document in which the web component was
* injected
*/
export declare function unload(ownerDocument?: Document): void;