import { AnyDoEntity, Event, EventHandler, EventListener, EventMapOf, Extension, Form, HybridActionContextElements, HybridManagerEventMap, InitModelOf, ObjectOrChildModel, Session, Widget } from '../../index'; /** * A utility to invoke remote Java actions to simplify the interaction of Scout JS and Scout Classic code * to facilitate the creation of hybrid applications. */ export declare class HybridManager extends Widget { eventMap: HybridManagerEventMap; self: HybridManager; widgets: Record; /** * Set of {@link HybridManagerWidget}s that will be disposed in the next batch. * See {@link #_callDisposeWidgets} for more information. */ protected _widgetsToBeDisposed: Set; /** * Set of ids that were scheduled in former batches. * See {@link #_callDisposeWidgets} for more information. */ protected _widgetIdsBeingDisposed: Set; constructor(); static get(session?: Session, wait?: false): HybridManager; static get(session?: Session, wait?: true): JQuery.Promise; protected _init(model: InitModelOf): void; protected _setWidgets(widgets: Record>): void; protected _ensureWidgets(modelsOrWidgets: Record>): Record; protected _installHybridManagerWidget(widget: HybridManagerWidget, remoteId: string): void; protected _uninstallHybridManagerWidget(widget: HybridManagerWidget): void; protected _triggerWidgetAdd(id: string, widget: Widget): void; protected _triggerWidgetRemove(id: string, widget: Widget): void; /** @internal */ onHybridEvent(id: string, eventType: string, data: AnyDoEntity, contextElements: HybridActionContextElements): void; /** @internal */ onHybridWidgetEvent(id: string, eventType: string, data: AnyDoEntity): void; protected _onHybridWidgetEvent(widget: Widget, eventType: string, data: AnyDoEntity): void; protected _onHybridFormEvent(form: HybridManagerForm, eventType: string, data: AnyDoEntity): void; protected _createEventId(): string; /** * Calls the hybrid action that matches the given action type. * * @returns the id of the triggered hybrid action * @see IHybridAction.java */ callAction(actionType: string, data?: AnyDoEntity, contextElements?: HybridActionContextElements): string; /** * Calls the hybrid action that matches the given action type and returns a promise that will be resolved once the corresponding hybridActionEnd event arrives. * The resolved value consist of the `data` value sent back from the server. To access the `contextElements`, use {@link callActionAndWaitWithContext} instead. * * @returns a promise that will be resolved with the result `data` once the corresponding hybridActionEnd event arrives. * @see IHybridAction * @see AbstractHybridAction.fireHybridActionEndEvent */ callActionAndWait(actionType: string, data?: AnyDoEntity, contextElements?: HybridActionContextElements): JQuery.Promise; /** * Calls the hybrid action that matches the given action type and returns a promise that will be resolved once the corresponding hybridActionEnd event arrives. * The resolved value is an object with the `data` and `contextElements` values sent back from the user. {@link callActionAndWait} can be used instead if only * the content of the `data` attribute is relevant. * * @returns a promise that will be resolved with the entire result object once the corresponding hybridActionEnd event arrives. * @see IHybridAction * @see AbstractHybridAction.fireHybridActionEndEvent */ callActionAndWaitWithContext(actionType: string, data?: AnyDoEntity, contextElements?: HybridActionContextElements): JQuery.Promise; /** * Calls the form hybrid action with the action type `openForm:${modelVariant}` to create, start and show the requested form. * * @param modelVariant the suffix for the actionType so the correct hybrid action can be resolved * @param data a data object that will be passed to the hybrid action * @returns a promise that will be resolved once the form has been created */ openForm(modelVariant: string, data?: AnyDoEntity, contextElements?: HybridActionContextElements): JQuery.Promise
; /** * Calls the form hybrid action with the action type `createForm:${modelVariant}` to create and start the requested form without showing it. * * @param modelVariant the suffix for the actionType so the correct hybrid action can be resolved * @param data a data object that will be passed to the hybrid action * @returns a promise that will be resolved once the form has been created */ createForm(modelVariant: string, data?: AnyDoEntity, contextElements?: HybridActionContextElements): JQuery.Promise; protected _onFormAdd(form: HybridManagerForm): HybridManagerForm; /** * Calls the hybrid action with the action type 'scout.DisposeWidgets' to dispose the given widgets on the UI server. */ disposeWidgets(widgets: Widget | Widget[]): void; /** * Calls the hybrid action with the action type 'scout.DisposeWidgets' to dispose the given widgets on the UI server. * The given widgets are collected in {@link #_widgetsToBeDisposed} and sent in one hybrid action. * After the hybrid action is called the ids of the {@link HybridManagerWidget}s in {@link #_widgetsToBeDisposed} are transferred to {@link #_widgetIdsBeingDisposed} and {@link #_widgetsToBeDisposed} is reset. */ protected _callDisposeWidgets(widgets: HybridManagerWidget | HybridManagerWidget[]): void; one>(type: K | `${K}:${string}`, handler: EventHandler[K] & Event>): void; on>(type: K | `${K}:${string}`, handler: EventHandler[K] & Event>): EventListener; off>(type: K | `${K}:${string}`, handler?: EventHandler[K] & Event>): void; when>(type: K | `${K}:${string}`): JQuery.Promise[K] & Event>; } export interface HybridManagerActionEndEventResult { data: AnyDoEntity; contextElements?: HybridActionContextElements; } interface HybridManagerForm extends Form { /** * @returns true if {@link FormEventMap.close} event was triggered at least once for this form. */ __closeTriggered?: boolean; } export interface HybridManagerWidget extends Widget { __remoteId?: string; } export declare class HybridManagerWidgetExtension extends Extension { init(): void; destroy(): void; } export {}; //# sourceMappingURL=HybridManager.d.ts.map