PlacementTypeRegistry
Registry for placement slot types.
Manages built-in and custom placement renderers. The registry resolves a PlacementOutput to the best matching slot type based on surface type and template, then provides the component and resolved props for rendering.
Methods
Section titled “Methods”get(
id):PlacementSlotType<PlacementSlotProps<ResolvedContent>> |undefined
Look up a slot type by its id.
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”PlacementSlotType<PlacementSlotProps<ResolvedContent>> | undefined
has(
id):boolean
Check if a slot type id is registered.
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”boolean
listAll()
Section titled “listAll()”listAll():
PlacementSlotType<PlacementSlotProps<ResolvedContent>>[]
List all registered slot types.
Returns
Section titled “Returns”PlacementSlotType<PlacementSlotProps<ResolvedContent>>[]
listBySurfaceType()
Section titled “listBySurfaceType()”listBySurfaceType(
surfaceType):PlacementSlotType<PlacementSlotProps<ResolvedContent>>[]
List slot types for a specific surface type.
Parameters
Section titled “Parameters”surfaceType
Section titled “surfaceType”"custom" | "inline" | "banner" | "modal" | "tooltip" | "sidebar" | "toast" | "fullscreen" | "email" | "sms" | "push" | "in_page" | "button" | "full_page" | "agent" | "cli"
Returns
Section titled “Returns”PlacementSlotType<PlacementSlotProps<ResolvedContent>>[]
register()
Section titled “register()”register<
P>(options):void
Register a placement slot type. If a type with the same id already exists, it is replaced (allows customer overrides of built-in types).
Type Parameters
Section titled “Type Parameters”P extends PlacementSlotProps<ResolvedContent>
Parameters
Section titled “Parameters”options
Section titled “options”RegisterPlacementSlotTypeOptions<P>
Returns
Section titled “Returns”void
resolve()
Section titled “resolve()”resolve(
output):PlacementSlotType<PlacementSlotProps<ResolvedContent>> |undefined
Resolve the best matching slot type for a placement output.
Resolution order:
- If the output’s surface.template matches a registered type id, use it
- Find all types for the output’s surface.type, sort by priority descending,
and pick the first whose
accepts()returns true - Fall back to a ‘custom’ type if registered
- Return undefined if no match
Parameters
Section titled “Parameters”output
Section titled “output”Returns
Section titled “Returns”PlacementSlotType<PlacementSlotProps<ResolvedContent>> | undefined
unregister()
Section titled “unregister()”unregister(
id):boolean
Unregister a placement slot type by id. Returns true if the type was found and removed.
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”boolean