> For the complete documentation index, see [llms.txt](https://docs.17movement.net/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.17movement.net/complete-interface-system/api/server-exports.md).

# Server Exports

All server exports are available through the `17mov_Interface` resource.

```lua
local interface = exports['17mov_Interface']
```

***

### `showNotification(source, data)`

Displays a notification for a player.

**Arguments**

* `source` `number` - Player server ID.
* `data` `NotificationData | string` - Uses the same notification data as the client export.

**Example**

```lua
interface:showNotification(source, {
    type = 'success',
    title = 'Payment received',
    description = 'You received $500',
    duration = 4000,
    icon = 'banknote'
})
```

***

### `startProgress(source, data)`

Starts a non-blocking progress bar for a player.

**Arguments**

* `source` `number` - Player server ID.
* `data` `ProgressData` - Uses the same progress data as the client export.

**Example**

```lua
interface:startProgress(source, {
    duration = 5000,
    label = 'Repairing vehicle',
    canCancel = true
})
```

***

### `stopProgress(source)`

Stops the active progress bar for a player and marks it as completed.

**Arguments**

* `source` `number` - Player server ID.

```lua
interface:stopProgress(source)
```

***

### `toggleDisplay(source, state)`

Shows or hides the HUD for a player.

**Arguments**

* `source` `number` - Player server ID.
* `state` `boolean` - `true` to show the HUD, `false` to hide it.

```lua
interface:toggleDisplay(source, false)
```

***

### `addStress(source, amount)`

Adds stress to a player.

**Arguments**

* `source` `number` - Player server ID.
* `amount` `number` - Amount of stress to add.

```lua
interface:addStress(source, 10)
```

***

### `removeStress(source, amount)`

Removes stress from a player.

**Arguments**

* `source` `number` - Player server ID.
* `amount` `number` - Amount of stress to remove.

```lua
interface:removeStress(source, 10)
```

***

### `getDefaultPositions()`

Returns the default positions configured for HUD elements.

**Returns**

```lua
table
```

**Example**

```lua
local positions = interface:getDefaultPositions()
```

***

### `setDefaultPositions(positions)`

Updates the default HUD element positions and applies them to all players.

**Arguments**

* `positions` `table` - New default positions.

**Returns**

```lua
boolean
```

**Example**

```lua
local success = interface:setDefaultPositions(positions)
```

***

### `getDefaultLayout()`

Returns the default HUD layout saved by the admin editor.

**Returns**

```lua
string|nil
```

**Example**

```lua
local layout = interface:getDefaultLayout()
```

***

### `setDefaultLayout(code)`

Sets or clears the default HUD layout and applies the change to all players.

**Arguments**

* `code` `string | nil` - Layout code. Pass `nil` to clear the current default layout.

**Returns**

```lua
boolean
```

**Example**

```lua
local success = interface:setDefaultLayout(layoutCode)
```

To clear the current layout:

```lua
interface:setDefaultLayout(nil)
```

***

### `SoundFile`

Represents a sound available in the sound library.

* `file` `string` - Sound file name.
* `title` `string` - Display name.
* `type` `string` - Sound file type.

### `getSoundLibrary()`

Returns all currently available sounds.

**Returns**

```lua
SoundFile[]
```

**Example**

```lua
local sounds = interface:getSoundLibrary()

for _, sound in ipairs(sounds) do
    print(sound.file, sound.title, sound.type)
end
```

***

### `refreshSoundLibrary()`

Re-scans the sounds directory and returns the updated sound library.

**Returns**

```lua
SoundFile[]
```

**Example**

```lua
local sounds = interface:refreshSoundLibrary()
```
