Saltearse al contenido

componentRegistry/runtime

Esta página aún no está disponible en tu idioma.

const componentProps: ComponentRegistryEntry[];

Defined in: studiocms/packages/studiocms/src/virtual.d.ts:214^

List of component properties that are registered in the component registry.

Each entry in the array is an object with a name and props property. The props property is an array of objects representing the properties of the component.

function createRenderer(
result: SSRResult,
sanitizeOpts?: SanitizeOptions,
preRenderer?: (content: string) => Promise<string>): Promise<(content: string) => Promise<string>>

Defined in: studiocms/packages/studiocms/src/componentRegistry/runtime.ts:90^

Creates a renderer function that transforms HTML content using the provided components and sanitization options.

SSRResult

The SSRResult object from Astro.

SanitizeOptions

Optional sanitization options for the HTML content.

(content: string) => Promise<string>

An optional function to preprocess the HTML content before rendering.

Promise<(content: string) => Promise<string>>

A function that takes HTML content as input and returns the transformed HTML.


function getRegistryComponents(): ComponentRegistryEntry[]

Defined in: studiocms/packages/studiocms/src/componentRegistry/runtime.ts:21^

Returns the component registry entries.

ComponentRegistryEntry[]

An object mapping safe component names to their registry entries.


function getRendererComponents(): Promise<Record<string, any>>

Defined in: studiocms/packages/studiocms/src/componentRegistry/runtime.ts:28^

Promise<Record<string, any>>

A promise that resolves to an object containing the imported components.


function importComponentsKeys(): Promise<Record<string, any>>

Defined in: studiocms/packages/studiocms/src/componentRegistry/runtime.ts:66^

Imports components by their keys from the ‘studiocms:markdown-remark/user-components’ module.

Promise<Record<string, any>>

A promise that resolves to an object containing the imported components.

If any component fails to import, an error is thrown with a prefixed message.


function setupRendererComponentProxy(result: SSRResult): Promise<ComponentType>

Defined in: studiocms/packages/studiocms/src/componentRegistry/runtime.ts:77^

Sets up a component proxy for the renderer.

SSRResult

The SSRResult object from Astro.

Promise<ComponentType>

A promise that resolves to a component proxy containing the components.

If there is an error during setup, it will be prefixed and logged.

Re-exports ComponentRegistryEntry


Re-exports convertHyphensToUnderscores


Re-exports convertUnderscoresToHyphens