UNPKG

@piiano/forms

Version:
26 lines (25 loc) 1 kB
import { type ProtectedViewOptions } from '../options'; export type { Theme, Style, Variables, Field } from '../common/models'; /** * A view that handle to interact with the protected view iframe programmatically. */ export type View = { /** * Destroy the view and remove it from the DOM safely. */ destroy: () => void; /** * Update the view with new options. * Note: the dynamic flag must be true to allow updates. */ update: (options: ProtectedViewOptions) => void; /** * Copy the value of the specified field path to the clipboard. * If triggered as result of a keyboard event originated from within the view an additional trustedEventKey can be provided to prevent a confirmation dialog. */ copy: (params: { path: string; trustedEventKey?: string; }) => Promise<void>; }; export declare function createProtectedView(containerOrSelector: string | HTMLDivElement, { hooks, ...options }: ProtectedViewOptions): View;