import { InitModelOf, ObjectWithType, Outline, Page, PageParamDo, SomeRequired, Table, TableRowsInsertedEvent, TreeAllChildNodesDeletedEvent, TreeNodesDeletedEvent, TreeNodesInsertedEvent, TreeNodesUpdatedEvent } from '../../../../index'; /** * This helper can be used to create child pages for a JsPage on the UI server. * The child pages are created using an id or a {@link PageParamDo}. * The child pages are created by the Java equivalent of the JsPage (see AbstractJsPage.createChildPage) when {@link #callLoadChildPages} is called. * After the returned {@link Promise} is resolved the child pages are available by {@link #findChildPage}. * * To create child pages for a {@link PageWithTable}: * - Call and await {@link #callLoadChildPages} in {@link PageWithTable#_loadTableData} using ids or {@link PageParamDo}s created from the loaded data. * - Implement {@link PageWithTable#_createChildPage} and return the result of {@link #findChildPage} using an id or {@link PageParamDo} created for the given {@link TableRow}. * * To create child pages for a {@link PageWithNodes}: * - Implement {@link PageWithNodes#_createChildPages} and call {@link #callLoadChildPages} using ids or {@link PageParamDo}s. * - After the {@link Promise} is resolved use the same ids or {@link PageParamDo}s to call {@link #findChildPages} and return the resulting child pages. */ export declare class JsPageHelper implements JsPageHelperModel, ObjectWithType { model: JsPageHelperModel; initModel: SomeRequired; objectType: string; page: Page; protected _replaceChildPages: boolean; /** * Child pages by id (see {@link #_createChildPageId}). */ protected _childPagesById: Map; protected _nodesUpdatedHandler: (event: TreeNodesUpdatedEvent) => void; protected _nodesDeletedHandler: (event: TreeNodesDeletedEvent) => void; protected _allChildNodesDeletedHandler: (event: TreeAllChildNodesDeletedEvent) => void; protected _nodesInsertedHandler: (event: TreeNodesInsertedEvent) => void; protected _tableRowsInsertHandler: (event: TableRowsInsertedEvent) => void; init(model: InitModelOf): void; destroy(): void; protected _installOutlineListeners(): void; protected _uninstallOutlineListeners(): void; protected _onNodesUpdated(event: TreeNodesUpdatedEvent): void; protected _onNodesDeleted(event: TreeNodesDeletedEvent): void; protected _onAllChildNodesDeleted(event: TreeAllChildNodesDeletedEvent): void; protected _installPageWithTableListeners(): void; protected _uninstallPageWithTableListeners(): void; protected _onNodesInserted(event: TreeNodesInsertedEvent): void; protected _installPageWithTableDetailTableListeners(detailTable: Table): void; protected _uninstallPageWithTableDetailTableListeners(detailTable: Table): void; protected _onTableRowsInserted(event: TableRowsInsertedEvent): void; get outline(): Outline; /** * Calls loadChildPages on the UI server for the given ids or {@link PageParamDo}s. The pages are created by the Java equivalent of the JsPage (see AbstractJsPage.createChildPage). * The returned {@link Promise} is resolved when all child pages are created on the UI server. * * @param idsOrPageParams ids or {@link PageParamDo}s that are used to create child pages on the UI server. * @param replace Whether existing child pages shall be replaced or reused. If not specified, the child pages will always be replaced except for the first call in order to keep existing child pages after a browser reload. */ callLoadChildPages(idsOrPageParams: (string | PageParamDo)[], replace?: boolean): Promise; /** * Loads the child page for the given id or {@link PageParamDo}. */ loadChildPage(idOrPageParam: string | PageParamDo, replace?: boolean): Promise; /** * Loads the child pages for the given ids or {@link PageParamDo}s and returns them in the order of the given ids or {@link PageParamDo}s. */ loadChildPages(idsOrPageParams: (string | PageParamDo)[], replace?: boolean): Promise; /** * Finds the child page for the given id or {@link PageParamDo}. */ findChildPage(idOrPageParam: string | PageParamDo): Page; /** * Finds the child pages for the given ids or {@link PageParamDo}s and returns them in the order of the given ids or {@link PageParamDo}s. */ findChildPages(idsOrPageParams: string | PageParamDo | (string | PageParamDo)[]): Page[]; /** * Adds all given child pages to the {@link #_childPagesById}-map. If no child pages are given the child pages of {@link #page} are taken. */ protected _addChildPagesToIdMap(childPages?: JsPageChildPage[]): void; /** * Removes all given child pages from the {@link #_childPagesById}-map. If no child pages are given the child pages of {@link #page} are taken. */ protected _removeChildPagesFromIdMap(childPages?: JsPageChildPage[]): void; /** * Creates a {@link PageParamDo} from the given id or {@link PageParamDo}. * If the given id or param is an id, this id is wrapped in an {@link IdPageParamDo}. * If the given id or param is a {@link PageParamDo} already, it is simply returned. */ protected _createChildPageParam(idOrPageParam?: string | PageParamDo): PageParamDo; /** * Creates a child page id for the given id or {@link PageParamDo}. * If the given id or param is an id already, it is simply returned. * If the given id or param is a {@link PageParamDo} it is stringified (see {@link dataObjects#stringify}) in order to create a child page id. */ protected _createChildPageId(idOrPageParam?: string | PageParamDo): string; /** * Gets the child page param from the given {@link JsPageChildPage}. */ protected _getChildPageParam(childPage?: JsPageChildPage): PageParamDo; /** * Gets the child page id from the given {@link JsPageChildPage}. */ protected _getChildPageId(childPage?: JsPageChildPage): string; /** * Ensures the given {@link JsPageChildPage}, i.e. ensures that its properties are of the correct type. */ protected _ensureJsPageChildPage(childPage?: JsPageChildPage): void; } export interface JsPageHelperModel { page?: Page; } /** * Page param that is used by {@link JsPageHelper} to create child pages if only an id is provided. */ export declare class IdPageParamDo extends PageParamDo { id: string; } interface JsPageChildPage extends Page { /** * The {@link PageParamDo} sent to the server by the {@link JsPageHelper} in order to create this child page. */ __jsPageChildPageParam?: PageParamDo; } export {}; //# sourceMappingURL=JsPageHelper.d.ts.map