Interface: Template
ghostly-runtime.Template
The Ghostly Template API.
Implemented byβ
Methodsβ
ghostlyEndβ
βΈ Optional ghostlyEnd(): void | Promise<void>
This optional method is invoked when all processing of the model is done. May be used to purge caches and other resources.
Returnsβ
void | Promise<void>
Defined inβ
ghostly-runtime/src/types.ts:46
ghostlyFetchβ
βΈ Optional ghostlyFetch(attachmentInfo): void | GhostlyTypes | Promise<void | GhostlyTypes>
Asks the template to render an attachment. This call should not return or resolve until the attachment is stable and fully rendered.
Parametersβ
| Name | Type | Description |
|---|---|---|
attachmentInfo | AttachmentInfo<unknown> | The attchment to render. |
Returnsβ
void | GhostlyTypes | Promise<void | GhostlyTypes>
The attachment as raw binary data, a string, a JSON object, or nothing (in which case the Ghostly Engine will construct a response).
Defined inβ
ghostly-runtime/src/types.ts:37
ghostlyInitβ
βΈ ghostlyInit(model): void | ModelInfo | Promise<void | ModelInfo>
Used to supply the model (data) that the template should render from.
Parametersβ
| Name | Type | Description |
|---|---|---|
model | Model | The model to render. |
Returnsβ
void | ModelInfo | Promise<void | ModelInfo>
Optional metainfo about the model and the attachments that can be produced.
Defined inβ
ghostly-runtime/src/types.ts:17
ghostlyLoadβ
βΈ Optional ghostlyLoad(url): void | Promise<void>
This optional method will be invoked once the template has been loaded by the browser, or each time the fragment part (hash) changes in a cached template.
Parametersβ
| Name | Type | Description |
|---|---|---|
url | string | The template URL (including fragment). |
Returnsβ
void | Promise<void>
Defined inβ
ghostly-runtime/src/types.ts:9
ghostlyPreviewβ
βΈ Optional ghostlyPreview(command?): PreviewResult | Promise<PreviewResult>
This method is used by the PreviewDriver to print and to find out the preferred size of the IFrame.
Parametersβ
| Name | Type |
|---|---|
command? | PreviewCommand |
Returnsβ
PreviewResult | Promise<PreviewResult>
Defined inβ
ghostly-runtime/src/types.ts:40
ghostlyRenderβ
βΈ ghostlyRender(view): void | GhostlyTypes | Promise<void | GhostlyTypes>
Asks the template to render a specific view. This call should not return or resolve until the view is stable and fully rendered.
Parametersβ
| Name | Type | Description |
|---|---|---|
view | View<unknown> | The view to render. |
Returnsβ
void | GhostlyTypes | Promise<void | GhostlyTypes>
The view as raw binary data, a string, a JSON object, or nothing (in which case the Ghostly Engine will construct a response).