# Task List

## Exports

### Toggle UI

```lua
exports.ls_tasklist:toggleUI(state)
params:[
    state: 'boolean'
]

Only set the state to false if everything is done, because that resets everything.
```

### Toggle Number Of Tasks

```lua
exports.ls_tasklist:toggleNumberOfTask(state)
params:[
    state: 'boolean'
]
```

### Update Task Amount

```lua
exports.ls_tasklist:updateTaskAmount(taskAmount)
params:[
    taskAmount: 'number'
]

If you use bigger amount that the maximum amount the script is ignore it!
```

### Update Stage Amount

```lua
exports.ls_tasklist:updateStageAmount(index, currentStage)
params:[
    index: 'number',
    currentStage: 'number'
]

if you use bigger amount that the maximum amount the script is ignore it!
```

### Complete Task By Index

```lua
exports.ls_tasklist:setCompleteByIndex(index)
params:[
    index: 'number'
]

If the task is completed and run one more time, then set it to false. 
This works like a boolean value.
```

### Set Task Data

```lua
exports.ls_tasklist:setTaskData(data)
params: [
    data: table [
        title: 'string',
        maximumTask: 'number'
        currentTaskAmount: 'number',
        showNumberOfTask: 'boolean',
        dynamicBar: 'boolean',
        tasks : 'table' [
            index: 'number',
            icon: 'string',
            text: 'string',
            completed: 'boolean'
            currentStage: 'number',
            totalStage 'number',
        ]
    ]
]

Example:
exports.ls_tasklist:setTaskData(
{
        title = 'Example',
        maximumTask = 10,
        currentTaskAmount = 0,
        showNumberOfTask = true,
        dynamicBar = false,
        tasks = {
            { index = 1, icon = 'fa-solid fa-car', text = 'Example text', currentStage = 0, totalStage = 10 },
        }
    })

currentTaskAmount, showNumberOfTask, dynamicBar, currentStage not required.
Now every parameter have default value so you dont need to define it anymore.

Everything work same as before, but if the maximumTask or totalStage not setted,
then cant use the not required paramteres.
```

### Reset Tasks Completes

```lua
exports.ls_tasklist:resetCompletes()
```
