Describes a subject slot, its id, a label, and an optional description. Supplied at bootstrap when a slot is registered.

The generic parameter ties id to a known slot. So if you pass { id: 'user' }, the registration's provider must return a User. Passing a different type is a compile error.

Example

const userSubject: SubjectMetadata<'user'> = {
id: 'user',
label: 'Current user',
description: 'The user currently authenticated in the session.',
};

Type Parameters

Hierarchy

  • SubjectMetadata

Properties

Properties

description?: string

Longer description for tooltips or help text. Optional.

id: K

The slot id. Must be a key of SubjectRegistry.

Plugin-added slots should use namespaced ids (mypkg.foo, pluginx.bar) so two plugins can't accidentally claim the same name. The built-in slots (user, limeobject, action) are first-party and exempt from this convention.

label: string

Human-readable label. Useful for consumers that enumerate registered slots.