import { MyopMessageKey } from "../../common/MyopMessages"; import { BaseMyopMessage, Ref } from "../../messages"; import { CleanupHandler, IComponentDefinitionConfig } from "../../common"; import { loaderOptions } from "../hostSDK.ts"; /** * Result returned by observeAutoSize callback */ export interface AutoSizeResult { /** Current width (from content) */ width: number; /** Current height (from content) */ height: number; /** Whether width is being auto-sized */ autoSizingWidth: boolean; /** Whether height is being auto-sized */ autoSizingHeight: boolean; } /** * Options for observeAutoSize method */ export interface AutoSizeOptions { /** Callback called with size info whenever size changes */ onSizeChange?: (result: AutoSizeResult) => void; /** Minimum width constraint */ minWidth?: number | string; /** Maximum width constraint */ maxWidth?: number | string; /** Minimum height constraint */ minHeight?: number | string; /** Maximum height constraint */ maxHeight?: number | string; /** Explicit width set by host - if defined, don't auto-size width */ explicitWidth?: string | number; /** Explicit height set by host - if defined, don't auto-size height */ explicitHeight?: string | number; /** Force auto-size even if container has dimensions */ forceAutoSize?: boolean; /** Min height used by loader to detect collapse (default: 50) */ loaderMinHeight?: number; } type RefTypes = { [key: string]: IMyopComponent | Ref; }; export interface IMyopComponent

{ id: string; isInitiated: boolean; markedForDisposed: boolean; setInitiated: () => void; componentDefinition: IComponentDefinitionConfig; container: HTMLElement; element?: HTMLElement; send: (msg: BaseMyopMessage) => CleanupHandler; bind(messageType: MyopMessageKey, handler: () => boolean): void; bind(messageType: MyopMessageKey, handler: (message: T) => boolean): void; onMessageReceived: (msg: BaseMyopMessage) => boolean; initiated: () => Promise; dispose: () => void; hide(): void; show(): void; inspect(): void; /** * Observes the iframe content size and automatically syncs it to the iframe element. * Only available for iframe-based components. Uses direct contentDocument access. * @param options - Configuration options including size change callback and min/max constraints * @returns Cleanup function to stop observing */ observeAutoSize?: (options?: AutoSizeOptions) => CleanupHandler; /** * Parsed myop:size meta tag from the component HTML. * Set by HTMLComponentLoader before iframe creation. * Used by the React host to determine sizing mode (fill vs content). */ sizeMeta?: { width?: string | number; height?: string | number; minWidth?: number; maxWidth?: number; minHeight?: number; maxHeight?: number; } | null; parent?: IMyopComponent; props: P; refs: R; } type messageHandler = (message: T) => boolean; export declare abstract class BaseMyopComponent

implements IMyopComponent

{ componentDefinition: IComponentDefinitionConfig; container: HTMLElement; id: string; messageHandlers: Record[]>; element?: HTMLElement; protected constructor(componentDefinition: IComponentDefinitionConfig, container: HTMLElement, options?: loaderOptions); _markedForDisposed: boolean; get markedForDisposed(): boolean; set markedForDisposed(value: boolean); abstract hide(): void; abstract show(): void; abstract inspect(): CleanupHandler; bind: (messageType: string, handler: (message: T) => boolean) => void; bindWhen: (messageType: string, predicate: (message: T) => boolean, handler: (message: T) => void) => CleanupHandler; onMessageReceived(incomeMessage: BaseMyopMessage): boolean; setInitiated: () => void; isInitiated: boolean; _whenInitiatedResolve?: (value?: any) => any; _whenInitiatedReject?: (value?: any) => any; _whenInitiated: Promise; initiated: () => Promise; private sendCleanupMessage; send(message: BaseMyopMessage): CleanupHandler; dispose(): void; props: P; refs: R; } export {};