Prometheus Entity Management API
    Preparing search index...

    The state model for a single UI surface.

    A surface is the root container for a set of components and their associated data. It coordinates data binding, component state, and action dispatching.

    Type Parameters

    • T extends ComponentApi = ComponentApi

      The concrete type of the ComponentApi from the catalog.

    Index
    • Creates a new surface model.

      Type Parameters

      • T extends ComponentApi<ZodTypeAny> = ComponentApi<ZodTypeAny>

        The concrete type of the ComponentApi from the catalog.

      Parameters

      • id: string

        The unique identifier for this surface.

      • catalog: Catalog<T>

        The component catalog used by this surface.

      • Optionaltheme: any

        The theme to apply to this surface.

      • OptionalsendDataModel: boolean

        If true, the client will send the full data model.

      Returns SurfaceModel<T>

    catalog: Catalog<T>
    componentsModel: SurfaceComponentsModel

    The collection of component models for this surface.

    dataModel: DataModel

    The data model for this surface.

    id: string
    onAction: EventSource<
        {
            context: Record<string, any>;
            name: string;
            sourceComponentId: string;
            surfaceId: string;
            timestamp: string;
        },
    >

    Fires whenever an action is dispatched from this surface.

    onError: EventSource<any>

    Fires whenever an error occurs on this surface.

    sendDataModel: boolean
    theme: any
    • Dispatches an action from this surface to listeners.

      Parameters

      • payload: any

        The action payload (name and context) to dispatch.

      • sourceComponentId: string

        The ID of the component that triggered the action.

      Returns Promise<void>

    • Dispatches an error from this surface to listeners.

      Parameters

      • error: { code: string; message: string; [key: string]: any }

        The error object to dispatch, conforming to client_to_server schema.

      Returns Promise<void>

    • Disposes of the surface and its resources.

      Returns void