Skip to content

API reference / @jsprismarine/script-host / shape/binding

shape/binding ​

Classes ​

Interfaces ​

HostInstance ​

Defined in: script-host/src/shape/binding.ts:23

What the host gave an instance it made, which every call of the instance's members receives.

Properties ​

state ​

readonly state: string

Defined in: script-host/src/shape/binding.ts:27

The instance's ScriptCall.state, or an empty string when it has none.

tag ​

readonly tag: number

Defined in: script-host/src/shape/binding.ts:25

The instance's ScriptCall.tag.


ScriptApiContextOptions ​

Defined in: script-host/src/shape/binding.ts:31

How a ScriptApiContext binds.

Properties ​

histories? ​

readonly optional histories?: Readonly<Record<string, ModuleHistory>>

Defined in: script-host/src/shape/binding.ts:42

The histories a module's dependencies resolve against. The generated ones when absent.

implementations ​

readonly implementations: ScriptApiImplementations

Defined in: script-host/src/shape/binding.ts:39

logger ​

readonly logger: ScriptApiLogger

Defined in: script-host/src/shape/binding.ts:40

pack ​

readonly pack: string

Defined in: script-host/src/shape/binding.ts:33

The pack whose scripts the context serves, as BDS's log names it, such as my pack - 1.0.0.

packId? ​

readonly optional packId?: string

Defined in: script-host/src/shape/binding.ts:38

A stable identity for the pack, which two packs with one display name do not share. The engine's context id serves when the caller has one.

privilege? ​

readonly optional privilege?: () => Privilege

Defined in: script-host/src/shape/binding.ts:47

The privilege the script running now has. A member whose metadata does not list it throws BDS's error before its implementation runs. default when absent.

Returns ​

Privilege


ScriptApiLogger ​

Defined in: script-host/src/shape/binding.ts:18

Where the binding reports a member a pack used that has no implementation.

Methods ​

warn() ​

warn(message): void

Defined in: script-host/src/shape/binding.ts:19

Parameters ​
message ​

string

Returns ​

void