Sign in

    #proton/manifest

    moonbit-community/proton/manifest defines the runtime manifest types shared by bootstrap, native handoff, and the root facade.

    It is a data package. Parsing belongs in bootstrap; application lifecycle belongs in the root proton facade.

    AppEntry

    pub(all) enum AppEntry {
    Html(String)
    Url(String)
    File(String)
    Asset(String)
    } derive(Eq,
    Debug
    )

    Declarative entry content loaded into a Proton application window.
    impl Show for AppEntry

    AppManifest

    pub struct AppManifest {
    window : WindowManifest
    entry : AppEntry
    windows : Array[AppWindowManifest]
    debug : Int
    extensions : Map[String, ExtensionSetting]
    permissions : Array[PermissionGrant]
    }

    Declarative application manifest consumed by the runtime.

    AppManifest::extension_setting

    fn AppManifest::extension_setting(self : AppManifest, name : String) -> ExtensionSetting?

    Returns one configured extension setting, if present in the manifest. It returns None when the manifest does not mention the extension key at all.

    AppManifest::extension_settings

    fn AppManifest::extension_settings(self : AppManifest) -> Array[(String, ExtensionSetting)]

    Returns the configured extension entries as name/setting pairs. Each pair contains the manifest key together with its normalized declarative enablement state.

    AppManifest::new

    fn AppManifest::new(window : WindowManifest, entry : AppEntry, debug? : Int, windows? : Array[AppWindowManifest], extensions? : Map[String, ExtensionSetting], permissions? : Array[PermissionGrant]) -> AppManifest

    Builds an app manifest. The defaults match the minimal declarative shape accepted by bootstrap so callers can opt into debug, extra windows, or extensions incrementally.

    AppManifest::permission_grants

    fn AppManifest::permission_grants(self : AppManifest) -> Array[PermissionGrant]

    AppWindowManifest

    pub struct AppWindowManifest {
    id : String
    window : WindowManifest
    entry : AppEntry
    open_on_start : Bool
    } derive(Eq,
    Debug
    )

    Declarative secondary window entry consumed by runtime manifests.

    AppWindowManifest::new

    fn AppWindowManifest::new(id : String, window : WindowManifest, entry : AppEntry, open_on_start? : Bool) -> AppWindowManifest

    Builds a declarative secondary window entry. Secondary windows keep their own id, window settings, and entry payload in the manifest document.

    ExtensionSetting

    pub(all) enum ExtensionSetting {
    Disabled
    Enabled
    } derive(Eq,
    Debug
    )

    Runtime extension setting produced from MoonBit app code.

    Extension-specific configuration is carried by the permission scope, which is validated at configuration time through resolve_permission and read per request through AppCommandRequestContext::permission_scope. This type only records whether an extension is active.

    ExtensionSetting::disabled

    Builds a disabled extension setting. Use this when the manifest should preserve an explicit opt-out entry.

    ExtensionSetting::enabled

    Builds an enabled extension setting.

    ExtensionSetting::is_enabled

    fn ExtensionSetting::is_enabled(self : ExtensionSetting) -> Bool

    Returns whether this setting enables an extension.

    PermissionGrant

    pub struct PermissionGrant {
    window : String
    origin : PermissionOrigin
    extension : String
    scope : Json
    }

    Grants one extension to one trusted source in one application window.

    Extension registration and permission grants are deliberately separate: registering an extension makes its backend implementation available, while a grant decides which renderer may invoke it. scope is interpreted by the extension and is always copied at the manifest boundary.

    PermissionGrant::extension

    fn PermissionGrant::extension(self : PermissionGrant) -> String

    PermissionGrant::new

    fn PermissionGrant::new(window : String, origin : PermissionOrigin, extension : String, scope? : Json) -> PermissionGrant

    PermissionGrant::origin

    PermissionGrant::scope

    fn PermissionGrant::scope(self : PermissionGrant) -> Json

    PermissionGrant::window

    fn PermissionGrant::window(self : PermissionGrant) -> String

    PermissionOrigin

    pub(all) enum PermissionOrigin {
    App
    Entry
    } derive(Eq,
    Debug
    )

    Selects the trusted page source covered by a permission grant.

    TitlebarStyle

    pub(all) enum TitlebarStyle {
    Default
    Overlay
    } derive(Eq,
    Debug
    )

    Controls whether web content remains below or extends beneath the native titlebar. Platforms without overlay support keep the default titlebar.

    WindowManifest

    pub struct WindowManifest {
    title : String
    width : Int
    height : Int
    size_hint : WindowSizeHint
    titlebar_style : TitlebarStyle
    } derive(Eq,
    Debug
    )

    Declarative window settings consumed by runtime manifests.

    WindowManifest::new

    fn WindowManifest::new(title : String, width : Int, height : Int, size_hint? : WindowSizeHint, titlebar_style? : TitlebarStyle) -> WindowManifest

    Builds a manifest window configuration. This is the declarative window shape consumed by bootstrap and later turned into runtime WindowConfig values.

    WindowSizeHint

    pub(all) enum WindowSizeHint {
    None
    Fixed
    Min
    Max
    } derive(Eq,
    Debug
    )

    Declarative sizing hint used by manifest windows.

    Powered by MoonBit

    Site sourceReport issuePackagesBuild queueSkillsStatistics

    © 2026 mooncakes.io