GPUI.Schema.Registry (gpui v0.2.0-rc.1)

Copy Markdown View Source

Immutable composition of explicitly selected declarative schema modules.

A registry is assembled by the framework or maintainer tooling from known modules. It is not a runtime plugin registry and does not accept renderer callbacks or opaque native payloads.

Summary

Functions

Returns one component from the composed registry.

Returns the composed components in declaration order.

Returns provider/component entries in composed declaration order.

Includes one explicit schema module and rejects duplicate tags.

Returns all composed native tags in declaration order.

Creates an empty immutable schema registry.

Orders a complete registry by an explicit canonical tag manifest.

Returns the explicit provider module for one composed component.

Returns the stateful components in declaration order.

Types

provider_entry()

@type provider_entry() :: %{
  provider: schema_module(),
  component: GPUI.Schema.Component.t()
}

schema_module()

@type schema_module() :: module()

t()

@type t() :: %GPUI.Schema.Registry{
  components: [GPUI.Schema.Component.t()],
  modules: [schema_module()]
}

Functions

component!(registry, tag)

@spec component!(t(), atom()) :: GPUI.Schema.Component.t()

Returns one component from the composed registry.

components(registry)

@spec components(t()) :: [GPUI.Schema.Component.t()]

Returns the composed components in declaration order.

entries(registry)

@spec entries(t()) :: [provider_entry()]

Returns provider/component entries in composed declaration order.

include(registry, module)

@spec include(t(), schema_module()) :: t()

Includes one explicit schema module and rejects duplicate tags.

native_tags(registry)

@spec native_tags(t()) :: [atom()]

Returns all composed native tags in declaration order.

new()

@spec new() :: t()

Creates an empty immutable schema registry.

order(registry, tags)

@spec order(t(), [atom()]) :: t()

Orders a complete registry by an explicit canonical tag manifest.

provider!(registry, tag)

@spec provider!(t(), atom()) :: schema_module()

Returns the explicit provider module for one composed component.

stateful_components(registry)

@spec stateful_components(t()) :: [GPUI.Schema.Component.t()]

Returns the stateful components in declaration order.