[API reference](https://jsprismarine.dev/api/index.md) / [@jsprismarine/script-host](https://jsprismarine.dev/api/@jsprismarine/script-host/index.md) / shape/binding

# shape/binding

## Classes

- [ScriptApiContext](https://jsprismarine.dev/api/@jsprismarine/script-host/shape/binding/classes/ScriptApiContext.md)

## Interfaces

### HostInstance

Defined in: [script-host/src/shape/binding.ts:23](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/script-host/src/shape/binding.ts#L23)

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](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/script-host/src/shape/binding.ts#L27)

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](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/script-host/src/shape/binding.ts#L25)

The instance's `ScriptCall.tag`.

***

### ScriptApiContextOptions

Defined in: [script-host/src/shape/binding.ts:31](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/script-host/src/shape/binding.ts#L31)

How a [ScriptApiContext](https://jsprismarine.dev/api/@jsprismarine/script-host/shape/binding/classes/ScriptApiContext.md) binds.

#### Properties

##### histories?

> `readonly` `optional` **histories?**: `Readonly`\<`Record`\<`string`, [`ModuleHistory`](https://jsprismarine.dev/api/@jsprismarine/script-host/shape/format/index.md#modulehistory)\>\>

Defined in: [script-host/src/shape/binding.ts:42](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/script-host/src/shape/binding.ts#L42)

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

##### implementations

> `readonly` **implementations**: [`ScriptApiImplementations`](https://jsprismarine.dev/api/@jsprismarine/script-host/shape/implementations/classes/ScriptApiImplementations.md)

Defined in: [script-host/src/shape/binding.ts:39](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/script-host/src/shape/binding.ts#L39)

##### logger

> `readonly` **logger**: [`ScriptApiLogger`](#scriptapilogger)

Defined in: [script-host/src/shape/binding.ts:40](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/script-host/src/shape/binding.ts#L40)

##### pack

> `readonly` **pack**: `string`

Defined in: [script-host/src/shape/binding.ts:33](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/script-host/src/shape/binding.ts#L33)

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](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/script-host/src/shape/binding.ts#L38)

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`](https://jsprismarine.dev/api/@jsprismarine/script-host/shape/format/index.md#privilege-4)

Defined in: [script-host/src/shape/binding.ts:47](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/script-host/src/shape/binding.ts#L47)

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`](https://jsprismarine.dev/api/@jsprismarine/script-host/shape/format/index.md#privilege-4)

***

### ScriptApiLogger

Defined in: [script-host/src/shape/binding.ts:18](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/script-host/src/shape/binding.ts#L18)

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](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/script-host/src/shape/binding.ts#L19)

###### Parameters

###### message

`string`

###### Returns

`void`
