Skip to content

Runtime Services

Picard.js comes with a set of services that can be extended to provide more or augmented functionality.

Service Definitions

Right now the following extensible services exist:

Service Key StructureExampleInterfaceNotes
framework.{type}framework.reactConverterService
format.{name}format.moduleContainerService
slotRel.{name}slotRel.routerSlotBehaviorService
part.{name}part.stylePartServiceSSR only

Interfaces

ts
interface ConverterService {
  convert(component: any, opts: any): ComponentLifecycle;
}

For an explanation of the ComponentLifecycle see Generic component Lifecycle.

ts
interface ContainerService {
  createContainer(details: any): Promise<ComponentGetter>;
}
ts
interface SlotBehaviorService {
  apply(attribs: Record<string, string>): [name: string, data: any];
}
ts
interface PartService {
  getReplacement(document: Document, attribs: Record<string, string>): Promise<string>;
}

Released under the MIT License.