# Client Functions

Client-side functions are accessed via exports from `nova_core`.

## Callbacks

### `exports['nova_core']:TriggerCallback(name, callback, ...)`

Triggers a server callback and receives the response.

```lua
exports['nova_core']:TriggerCallback('bank:getBalance', function(data)
    print('Cash: $' .. data.cash)
    print('Bank: $' .. data.bank)
end)
```

| Parameter  | Type       | Description                          |
| ---------- | ---------- | ------------------------------------ |
| `name`     | `string`   | Callback name (registered on server) |
| `callback` | `function` | Function to receive the response     |
| `...`      | `any`      | Additional arguments sent to server  |

**Example with arguments:**

```lua
exports['nova_core']:TriggerCallback('shop:getPrice', function(price)
    if price then
        print('Price: $' .. price)
    end
end, 'bread', 5)  -- item name and quantity sent to server
```

***

## Player Data

### `exports['nova_core']:GetPlayerData()`

Gets the local player's cached data.

```lua
local data = exports['nova_core']:GetPlayerData()
if data then
    print('Name: ' .. data.fullname)
    print('Job: ' .. data.job)
    print('Money: $' .. data.money)
end
```

**Returns:** `table` with player properties or `nil` if not loaded

***

## Configuration

### `exports['nova_core']:GetConfig()`

Gets the framework configuration.

```lua
local config = exports['nova_core']:GetConfig()
print('Locale: ' .. config.Locale)
print('Server: ' .. config.ServerName)
```

**Returns:** `table` - Config object

***

## Notifications

### `exports['nova_notify']:ShowNotification(message, type, duration)`

Shows a notification on screen (requires nova\_notify).

```lua
exports['nova_notify']:ShowNotification('Hello!', 'success', 5000)
```

| Parameter  | Type     | Default  | Description                                   |
| ---------- | -------- | -------- | --------------------------------------------- |
| `message`  | `string` | required | Text to display                               |
| `type`     | `string` | `'info'` | `'success'`, `'error'`, `'info'`, `'warning'` |
| `duration` | `number` | `5000`   | Duration in milliseconds                      |

***

## HUD Progress Bar

### `exports['nova_hud']:ProgressBar(label, duration, callback)`

Shows a progress bar on the HUD.

```lua
exports['nova_hud']:ProgressBar('Eating...', 3000, function()
    -- Called when progress completes
    print('Finished eating!')
end)
```

| Parameter  | Type       | Description                |
| ---------- | ---------- | -------------------------- |
| `label`    | `string`   | Text shown on progress bar |
| `duration` | `number`   | Duration in milliseconds   |
| `callback` | `function` | Called on completion       |

***

## Events

### Client-side Events

```lua
-- Player finished loading
AddEventHandler('Nova:PlayerLoaded', function(playerData)
    print('Loaded as: ' .. playerData.fullname)
end)
```
