import { BuilderStatefulWidget, StatefulWidget, WidgetTree } from "../app"; /** * Renders a complete page with its widgets and properties. * * Fetches page data, applies page-level properties (meta tags, styles), and renders * the page body widget. Adds fspage class for styling. * * @param pageId - The page concept ID to render * @param attachNode - DOM element to attach the page to * @param props - Optional properties to pass to the page widget * @param showDocumentation - Whether to show documentation button */ export declare function renderPage(pageId: number, attachNode: HTMLElement, props?: any, showDocumentation?: boolean): Promise; /** * Imports the latest version of a widget into cache for later rendering. * * Fetches widget data, builds widget tree, and stores in DataCache. * Used for pre-loading widgets before rendering. * * @param widgetId - The widget origin ID to import * @param attachNode - Optional DOM element (for future use) * @param props - Optional properties to pass to the widget * @param showDocumentation - Whether to show documentation button * @returns Promise resolving to the widget tree */ export declare function importLatestWidget(widgetId: number, attachNode?: HTMLElement, props?: any, showDocumentation?: boolean): Promise; /** * Imports the latest version of a widget into cache for later rendering. * * Fetches widget data, builds widget tree, and stores in DataCache. * Used for pre-loading widgets before rendering. * * @param widgetId - The widget origin ID to import * @param attachNode - Optional DOM element (for future use) * @param props - Optional properties to pass to the widget * @param showDocumentation - Whether to show documentation button * @returns Promise resolving to the widget tree */ export declare function importRecentWidget(widgetId: number, attachNode?: HTMLElement, props?: any, showDocumentation?: boolean): Promise; /** * Renders a previously imported widget from cache. * * Retrieves widget tree from DataCache and renders it to the DOM. * Must call importLatestWidget() first to populate cache. * * @param widgetId - The widget origin ID to render * @param attachNode - DOM element to attach the widget to * @param props - Optional properties to pass to the widget * @param showDocumentation - Whether to show documentation button * @returns Promise resolving to the rendered widget instance */ export declare function renderImportedWidget(widgetId: number, attachNode: HTMLElement, props?: any, showDocumentation?: boolean): Promise; /** * Renders the latest published version of a widget. * * Fetches and renders the most recent version of a widget by origin ID. * Automatically handles "use latest" flag for child widgets. * * @param widgetId - The widget origin ID to render * @param attachNode - DOM element to attach the widget to * @param props - Optional properties to pass to the widget * @param showDocumentation - Whether to show documentation button */ export declare function renderLatestWidget(widgetId: number, attachNode: HTMLElement, props?: any, showDocumentation?: boolean): Promise; /** * Renders a specific widget by ID. * * Fetches widget data and renders the exact version specified (not latest). * * @param widgetId - The specific widget ID to render * @param attachNode - DOM element to attach the widget to * @param props - Optional properties to pass to the widget * @param showDocumentation - Whether to show documentation button * @returns Promise resolving to the rendered widget instance */ export declare function renderWidget(widgetId: number, attachNode: HTMLElement, props?: any, showDocumentation?: boolean): Promise; /** * Materializes a widget tree into DOM elements with styles and scripts. * * Core rendering logic that converts widget data into live DOM, applies styles, * initializes libraries, and attaches documentation if enabled. * * @param widgetId - The widget ID being materialized * @param bulkWidget - Bulk widget data from backend * @param attachNode - DOM element to attach the widget to * @param props - Optional properties to pass to the widget * @param showDocumentation - Whether to show documentation button (default: true) * @returns Promise resolving to the rendered widget instance */ export declare function materializeWidget(widgetId: number, bulkWidget: any, attachNode: HTMLElement, props?: any, showDocumentation?: boolean): Promise; /** * Fetches and builds a complete widget tree from a widget ID. * * @param widgetId - The widget ID to fetch * @param visitedWidgets - Array to track visited widgets (prevents cycles) * @param token - Optional authentication token * @returns Promise resolving to the widget tree */ export declare function getWidgetFromId(widgetId: number, visitedWidgets?: number[], token?: string): Promise; /** * Builds a complete widget tree from bulk widget data. * * Recursively processes widget hierarchy including children, custom functions, * libraries, and lifecycle hooks to create a full WidgetTree structure. * * @param widgetId - The widget ID to build tree for * @param visitedWidgets - Array tracking visited widgets to prevent cycles * @param bulkWidget - Bulk widget data from backend * @param token - Optional authentication token * @returns Promise resolving to the complete widget tree */ export declare function getWidgetBulkFromId(widgetId: number, visitedWidgets: number[] | undefined, bulkWidget: any, token?: string): Promise; /** * Converts a widget tree structure into live widget instances and mounts to DOM. * * Recursively instantiates widgets from tree data, sets up parent-child relationships, * applies styles, and mounts to the specified parent element. * * @param tree - The widget tree to convert * @param parentElement - DOM element to mount the widget to * @param isMain - Whether this is the main/root widget * @param props - Optional properties to pass to the widget * @param state - Optional state data to pass to the widget * @param parentWidget - Parent widget instance for context * @returns Promise resolving to the instantiated widget */ export declare function convertWidgetTreeToWidget(tree: WidgetTree, parentElement: HTMLElement, isMain?: boolean, props?: any, state?: any, parentWidget?: StatefulWidget | null): Promise; /** * Creates a shallow copy of an object, excluding arrays and nested objects. * * @param input - Object to create shallow copy from * @returns Shallow copy with only primitive and null values */ export declare function makeShallow(input: any): any; /** * Converts widget tree to widget instances with development mode wrapper support. * * Similar to convertWidgetTreeToWidget but includes development mode features * like visual editing and type selection. * * @param tree - The widget tree to convert * @param parentElement - DOM element to mount the widget to * @param isMain - Whether this is the main/root widget * @param state - Optional state data to pass to the widget * @param isInDevelopment - Enable development mode features * @param parentWidget - Parent widget instance for context * @returns Promise resolving to the instantiated widget */ export declare function convertWidgetTreeToWidgetWithWrapper(tree: WidgetTree, parentElement: HTMLElement, isMain?: boolean, state?: object, isInDevelopment?: boolean, parentWidget?: StatefulWidget | null): Promise; /** * Recursively unwraps all matching container elements within a parent. * * @param parentElement - Parent element to search within * @param selector - CSS selector for containers to unwrap */ export declare function unwrapContainers(parentElement: HTMLElement, selector: string): Promise; /** * Opens the documentation preview modal for a widget. * * Fetches and displays widget documentation including API specs, code examples, * images, videos, and links. * * @param widgetId - The widget ID to show documentation for */ export declare function openDocumentationPreviewModal(widgetId: number): Promise; /** * Renders widget documentation content into the documentation view. * * Formats and displays documentation data including text, API details, * code examples, and media attachments. * * @param widgetDocumentData - Documentation data to display * @param widgetId - The widget ID being documented */ export declare function showWidgetDocumentation(widgetDocumentData: any, widgetId: number): Promise; /** * Opens a modal dialog by ID. * * @param modalId - The ID of the modal element to open */ export declare function openModal(modalId: string): Promise; /** * Closes a modal dialog by ID and resets its form if present. * * @param modalId - The ID of the modal element to close */ export declare function closeModal(modalId: string): Promise;