Skip to content

@vttforge/core / InjectOptions

Interface: InjectOptions<App>

Type Parameters

App

App = unknown

Properties

hook

readonly hook: string

The render hook, such as renderActorDirectory or renderActorSheetV2. Render hooks fire once per class in the chain, so the base class name catches every sheet and the exact class name catches one.


id

readonly id: string

Package id. Namespaces the marker, so two packages cannot fight.


into?

readonly optional into?: string

CSS selector for the node to insert around, searched inside the rendered element. Left out, the rendered element itself is used, and position is then limited to 'append' and 'prepend'.


name

readonly name: string

Name for this injection, unique within the package. It is half the marker, and what a second render looks for before inserting again.


position?

readonly optional position?: InjectPosition

Default 'append'. 'before', 'after' and 'replace' need into: without it they would put the node outside the application.


render

readonly render: (app, element) => HTMLElement | null

Build what to insert. Return null to insert nothing, which still removes anything a previous render left.

Parameters

app

App

element

HTMLElement

Returns

HTMLElement | null


when?

readonly optional when?: (app, element) => boolean

Skip the injection entirely when this returns false.

Parameters

app

App

element

HTMLElement

Returns

boolean

MIT licensed.