[API reference](https://jsprismarine.dev/api/index.md) / [@jsprismarine/prismarine](https://jsprismarine.dev/api/@jsprismarine/prismarine/index.md) / inventory/workstationWindow

# inventory/workstationWindow

## Interfaces

### WorkstationLayout

Defined in: [packages/prismarine/src/inventory/workstationWindow.ts:19](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/prismarine/src/inventory/workstationWindow.ts#L19)

The player's slots of a workstation window: where they start, where the hotbar starts, and their end.

#### Properties

##### end

> `readonly` **end**: `number`

Defined in: [packages/prismarine/src/inventory/workstationWindow.ts:27](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/prismarine/src/inventory/workstationWindow.ts#L27)

One past the last hotbar slot.

##### firstHotbar

> `readonly` **firstHotbar**: `number`

Defined in: [packages/prismarine/src/inventory/workstationWindow.ts:25](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/prismarine/src/inventory/workstationWindow.ts#L25)

The first hotbar slot.

##### firstOwn

> `readonly` **firstOwn**: `number`

Defined in: [packages/prismarine/src/inventory/workstationWindow.ts:23](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/prismarine/src/inventory/workstationWindow.ts#L23)

The first of the player's main inventory slots.

##### ownFromEnd

> `readonly` **ownFromEnd**: `QuickMoveRange`

Defined in: [packages/prismarine/src/inventory/workstationWindow.ts:29](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/prismarine/src/inventory/workstationWindow.ts#L29)

Every player slot, which a shift-clicked result fills from the hotbar's end.

##### result

> `readonly` **result**: `number`

Defined in: [packages/prismarine/src/inventory/workstationWindow.ts:21](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/prismarine/src/inventory/workstationWindow.ts#L21)

The window slot of the result, which follows the inputs.

***

### WorkstationRules

Defined in: [packages/prismarine/src/inventory/workstationWindow.ts:74](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/prismarine/src/inventory/workstationWindow.ts#L74)

The rules a workstation's window adds to the shared layout.

#### Methods

##### capacity()

> **capacity**(`slot`, `item`): `number`

Defined in: [packages/prismarine/src/inventory/workstationWindow.ts:76](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/prismarine/src/inventory/workstationWindow.ts#L76)

How many of `item` an input slot holds at most: 0 for a slot that does not take it.

###### Parameters

###### slot

`number`

###### item

[`Item`](https://jsprismarine.dev/api/@jsprismarine/prismarine/item/Item/classes/Item.md)

###### Returns

`number`

##### quickMove()

> **quickMove**(`index`, `item`): readonly `QuickMoveRange`[]

Defined in: [packages/prismarine/src/inventory/workstationWindow.ts:78](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/prismarine/src/inventory/workstationWindow.ts#L78)

Where a shift-click moves the stack in an input slot or a player slot.

###### Parameters

###### index

`number`

###### item

[`Item`](https://jsprismarine.dev/api/@jsprismarine/prismarine/item/Item/classes/Item.md)

###### Returns

readonly `QuickMoveRange`[]

## Variables

### CARTOGRAPHY\_LAYOUT

> `const` **CARTOGRAPHY\_LAYOUT**: [`WorkstationLayout`](#workstationlayout)

Defined in: [packages/prismarine/src/inventory/workstationWindow.ts:50](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/prismarine/src/inventory/workstationWindow.ts#L50)

The cartography table's window: the map and the paper, empty map or glass pane before the result.

***

### SMITHING\_LAYOUT

> `const` **SMITHING\_LAYOUT**: [`WorkstationLayout`](#workstationlayout)

Defined in: [packages/prismarine/src/inventory/workstationWindow.ts:47](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/prismarine/src/inventory/workstationWindow.ts#L47)

The smithing table's window: the template, the base and the addition before the result.

***

### STONECUTTER\_LAYOUT

> `const` **STONECUTTER\_LAYOUT**: [`WorkstationLayout`](#workstationlayout)

Defined in: [packages/prismarine/src/inventory/workstationWindow.ts:44](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/prismarine/src/inventory/workstationWindow.ts#L44)

The stonecutter's window: the input before the result.

***

### WORKSTATION\_LAYOUTS

> `const` **WORKSTATION\_LAYOUTS**: `Partial`\<`Record`\<[`WindowTypes`](https://jsprismarine.dev/api/@jsprismarine/minecraft/index.md#windowtypes), [`WorkstationLayout`](#workstationlayout)\>\>

Defined in: [packages/prismarine/src/inventory/workstationWindow.ts:53](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/prismarine/src/inventory/workstationWindow.ts#L53)

The layout of each workstation screen laid out this way, by the screen.

## Functions

### betweenOwnSlots()

> **betweenOwnSlots**(`layout`, `index`): readonly `QuickMoveRange`[]

Defined in: [packages/prismarine/src/inventory/workstationWindow.ts:68](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/prismarine/src/inventory/workstationWindow.ts#L68)

Where a shift-click moves a stack of the player's own when the workstation takes it nowhere:
from the main inventory to the hotbar, and from the hotbar to the main inventory.

#### Parameters

##### layout

[`WorkstationLayout`](#workstationlayout)

The window's layout.

##### index

`number`

The window slot clicked, one of the player's.

#### Returns

readonly `QuickMoveRange`[]

***

### inputsGrid()

> **inputsGrid**(`open`): `WindowGrid`

Defined in: [packages/prismarine/src/inventory/workstationWindow.ts:127](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/prismarine/src/inventory/workstationWindow.ts#L127)

The open window's input slots as a grid a window reads and writes.

#### Parameters

##### open

The open workstation.

###### inputs

([`Item`](https://jsprismarine.dev/api/@jsprismarine/prismarine/item/Item/classes/Item.md) \| `null`)[]

Its input slots.

#### Returns

`WindowGrid`

***

### slotRange()

> **slotRange**(`start`, `end`, `reverse?`): `QuickMoveRange`

Defined in: [packages/prismarine/src/inventory/workstationWindow.ts:60](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/prismarine/src/inventory/workstationWindow.ts#L60)

A range of window slots a shift-click fills in order.

#### Parameters

##### start

`number`

##### end

`number`

##### reverse?

`boolean` = `false`

#### Returns

`QuickMoveRange`

***

### workstationLayout()

> **workstationLayout**(`inputs`): [`WorkstationLayout`](#workstationlayout)

Defined in: [packages/prismarine/src/inventory/workstationWindow.ts:36](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/prismarine/src/inventory/workstationWindow.ts#L36)

The layout of a workstation window with `inputs` input slots.

#### Parameters

##### inputs

`number`

How many input slots come before the result.

#### Returns

[`WorkstationLayout`](#workstationlayout)

***

### workstationWindow()

> **workstationWindow**(`layout`, `inventory`, `inputs`, `rules`): `ClickWindow`\<`InventorySlot`\>

Defined in: [packages/prismarine/src/inventory/workstationWindow.ts:88](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/prismarine/src/inventory/workstationWindow.ts#L88)

A workstation's screen as a window a click is carried out in.

#### Parameters

##### layout

[`WorkstationLayout`](#workstationlayout)

The window's layout, from [workstationLayout](#workstationlayout-1).

##### inventory

`Pick`\<[`HumanInventory`](https://jsprismarine.dev/api/@jsprismarine/prismarine/inventory/HumanInventory/classes/HumanInventory.md), `"container"`\>

The player's inventory.

##### inputs

`WindowGrid`

The workstation's input slots, as the open window keeps them.

##### rules

[`WorkstationRules`](#workstationrules)

What each input slot takes and where a shift-click moves a stack.

#### Returns

`ClickWindow`\<`InventorySlot`\>
