Skip to main content

Interface: PreviewAttachment

ghostly-runtime.PreviewAttachment

An object that holds metainfo and the attachment response. Returned by renderPreview.

Hierarchy​

Properties​

contentType​

β€’ contentType: string

The view's type (for instance, text/html or application/pdf).

Inherited from​

AttachmentInfo.contentType

Defined in​

ghostly-runtime/src/types.ts:73


data​

β€’ data: GhostlyTypes

The unpacked response to the ghostlyFetch request. Will be null if the template returned nothing.

Defined in​

ghostly-runtime/src/driver.ts:75


description​

β€’ Optional description: string

An optional description of the attachment.

Inherited from​

AttachmentInfo.description

Defined in​

ghostly-runtime/src/types.ts:99


dpi​

β€’ Optional dpi: number

The resolution be used when rendering the view. Used for viewport size calculations.

Inherited from​

AttachmentInfo.dpi

Defined in​

ghostly-runtime/src/types.ts:79


htmlTransforms​

β€’ Optional htmlTransforms: HTMLTransform[]

An array of transformations to apply when producing HTML results. Defaults to [ 'inline', 'noscript', 'minimize' ].

Inherited from​

AttachmentInfo.htmlTransforms

Defined in​

ghostly-runtime/src/types.ts:90


name​

β€’ name: string

The name of the attachment (including file extension).

Inherited from​

AttachmentInfo.name

Defined in​

ghostly-runtime/src/types.ts:96


paperSize​

β€’ Optional paperSize: PaperSize

The paper size to be used when rendering documents.

Inherited from​

AttachmentInfo.paperSize

Defined in​

ghostly-runtime/src/types.ts:82


params​

β€’ Optional params: unknown

Optional view params.

Inherited from​

AttachmentInfo.params

Defined in​

ghostly-runtime/src/types.ts:76


viewportSize​

β€’ Optional viewportSize: ViewportSize

The size of the viewport to use, in pixels. Will be calculated from dpi and paperSize, if not provided.

Inherited from​

AttachmentInfo.viewportSize

Defined in​

ghostly-runtime/src/types.ts:85