Skip to content

Commit

Permalink
DOCS-16: add api reference for features introduced with release 1.3.1
Browse files Browse the repository at this point in the history
  • Loading branch information
Cuh4 authored and gitbook-bot committed Jun 6, 2024
1 parent 03a56e9 commit ea749e0
Show file tree
Hide file tree
Showing 19 changed files with 555 additions and 183 deletions.
2 changes: 2 additions & 0 deletions docs/SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,12 @@
* [Services](api-reference/noir/built-ins/services/README.md)
* [PlayerService](api-reference/noir/built-ins/services/playerservice.md)
* [TaskService](api-reference/noir/built-ins/services/taskservice.md)
* [ObjectService](api-reference/noir/built-ins/services/objectservice.md)
* [Classes](api-reference/noir/classes/README.md)
* [TaskClass](api-reference/noir/classes/taskclass.md)
* [ServiceClass](api-reference/noir/classes/serviceclass.md)
* [PlayerClass](api-reference/noir/classes/playerclass.md)
* [ObjectClass](api-reference/noir/classes/objectclass.md)
* [EventClass](api-reference/noir/classes/eventclass.md)
* [ConnectionClass](api-reference/noir/classes/connectionclass.md)
* [Services](api-reference/noir/services.md)
Expand Down
12 changes: 6 additions & 6 deletions docs/api-reference/noir/bootstrapper.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
---
description: >-
An internal module of Noir that is used to initialize and start services. Do
not use this in your code.
---

# Bootstrapper

**Noir.Bootstrapper**: `table`

An internal module of Noir that is used to initialize and start services. Do not use this in your code.

***

```lua
Noir.Bootstrapper:InitializeSavedata()
```
Expand Down
10 changes: 6 additions & 4 deletions docs/api-reference/noir/built-ins/libraries/events.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
---
description: A library that allows you to create events.
---

# Events

**Noir.Libraries.Events**: `NoirLibrary`

A library that allows you to create events.

***

```lua
Noir.Libraries.Events:Create()
```
Expand Down
37 changes: 25 additions & 12 deletions docs/api-reference/noir/built-ins/libraries/logging.md
Original file line number Diff line number Diff line change
@@ -1,24 +1,33 @@
---
description: A library containing methods related to logging.
---

# Logging

**Noir.Libraries.Logging.LoggingMode**: string
**Noir.Libraries.Logging**: `NoirLibrary`

A library containing methods related to logging.

***

**Noir.Libraries.Logging.LoggingMode**: `NoirLoggingMode`

The mode to use when logging. "DebugLog": Sends logs to DebugView "Chat": Sends logs to chat
The mode to use when logging.

* "DebugLog": Sends logs to DebugView
* "Chat": Sends logs to chat

***

**Noir.Libraries.Logging.OnLog**: NoirEvent
**Noir.Libraries.Logging.OnLog**: `NoirEvent`

An event called when a log is sent.

An event called when a log is sent. Arguments: (log: string)
Arguments: (log: string)

***

**Noir.Libraries.Logging.Layout**: string
**Noir.Libraries.Logging.Layout**: `string`

Represents the logging layout.

Represents the logging layout. Requires two '%s' in the layout. First %s is the log type, the second %s is the log title. The message is then added after the layout.
Requires two '%s' in the layout. First %s is the log type, the second %s is the log title. The message is then added after the layout.

***

Expand Down Expand Up @@ -53,7 +62,9 @@ Sends a log.
Noir.Libraries.Logging:_FormatLog(logType, title, message, ...)
```

Format a log. Used internally.
Format a log.

Used internally.

#### Parameters

Expand All @@ -68,7 +79,9 @@ Format a log. Used internally.
Noir.Libraries.Logging:Error(title, message, triggerError, ...)
```

Sends an error log. Passing true to the third argument will intentionally cause an addon error to be thrown.
Sends an error log.

Passing true to the third argument will intentionally cause an addon error to be thrown.

#### Parameters

Expand Down
10 changes: 6 additions & 4 deletions docs/api-reference/noir/built-ins/libraries/number.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
---
description: A library containing helper methods relating to numbers.
---

# Number

**Noir.Libraries.Number**: `NoirLibrary`

A library containing helper methods relating to numbers.

***

```lua
Noir.Libraries.Number:IsWithin(number, start, stop)
```
Expand Down
10 changes: 6 additions & 4 deletions docs/api-reference/noir/built-ins/libraries/string.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
---
description: A library containing helper methods relating to strings.
---

# String

**Noir.Libraries.String**: `NoirLibrary`

A library containing helper methods relating to strings.

***

```lua
Noir.Libraries.String:Split(str, separator)
```
Expand Down
34 changes: 18 additions & 16 deletions docs/api-reference/noir/built-ins/libraries/table.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
---
description: A library containing helper methods relating to tables.
---

# Table

**Noir.Libraries.Table**: `NoirLibrary`

A library containing helper methods relating to tables.

***

```lua
Noir.Libraries.Table:Length(tbl)
```
Expand All @@ -16,7 +18,7 @@ Returns the length of the provided table.

#### Returns

* `number`
* `integer`

***

Expand Down Expand Up @@ -48,7 +50,7 @@ Return the keys of the provided table.

#### Returns

* `table<integer, any>`
* `tbl`

***

Expand All @@ -60,11 +62,11 @@ Return the values of the provided table.

#### Parameters

* `tbl`: table
* `tbl`: tbl

#### Returns

* `table<integer, any>`
* `tbl`

***

Expand All @@ -76,13 +78,13 @@ Get a portion of a table between two points.

#### Parameters

* `tbl`: table
* `tbl`: tbl
* `start`: number
* `finish`: number

#### Returns

* `table`
* `tbl`

***

Expand Down Expand Up @@ -143,12 +145,12 @@ Merge two tables together (unforced).

#### Parameters

* `tbl`: tbl
* `other`: tbl
* `tbl`: table
* `other`: table

#### Returns

* `tbl`
* `table`

***

Expand All @@ -160,12 +162,12 @@ Merge two tables together (forced).

#### Parameters

* `tbl`: tbl
* `other`: tbl
* `tbl`: table
* `other`: table

#### Returns

* `tbl`
* `table`

***

Expand Down
117 changes: 117 additions & 0 deletions docs/api-reference/noir/built-ins/services/objectservice.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
# ObjectService

**Noir.Services.ObjectService**: `NoirService`

A service for wrapping SW objects in classes.

***

```lua
Noir.Services.ObjectService:_SaveObjects(objects)
```

Overwrite saved objects.

Used internally. Do not use in your code.

#### Parameters

* `objects`: table\<integer, NoirSerializedObject>

***

```lua
Noir.Services.ObjectService:_GetSavedObjects()
```

Get saved objects.

Used internally. Do not use in your code.

#### Returns

* `table<integer, NoirSerializedObject>`

***

```lua
Noir.Services.ObjectService:GetObjects()
```

Get all objects.

#### Returns

* `table<integer, NoirObject>`

***

```lua
Noir.Services.ObjectService:_SaveObjectSavedata(object)
```

Save an object to g\_savedata.

Used internally. Do not use in your code.

#### Parameters

* `object`: NoirObject

***

```lua
Noir.Services.ObjectService:_RemoveObjectSavedata(object_id)
```

Remove an object from g\_savedata.

Used internally. Do not use in your code.

#### Parameters

* `object_id`: integer

***

```lua
Noir.Services.ObjectService:RegisterObject(object_id)
```

Registers an object by ID.

#### Parameters

* `object_id`: integer

#### Returns

* `NoirObject|nil`

***

```lua
Noir.Services.ObjectService:GetObject(object_id)
```

Returns the object with the given ID.

#### Parameters

* `object_id`: integer

#### Returns

* `NoirObject|nil`

***

```lua
Noir.Services.ObjectService:RemoveObject(object_id)
```

Removes the object with the given ID.

#### Parameters

* `object_id`: integer
Loading

0 comments on commit ea749e0

Please sign in to comment.