> For the complete documentation index, see [llms.txt](https://laot7490.gitbook.io/ltbridge/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://laot7490.gitbook.io/ltbridge/for-contributors/ltbridge-annotations.md).

# @ltbridge Annotations

When building modules for LTBridge, use `--- @ltbridge` comments to tell the compiler how to export your functions. These comments are **removed from the final build** — they never ship to production.

## Common annotations

| Annotation                         | Effect                                                          |
| ---------------------------------- | --------------------------------------------------------------- |
| `--- @ltbridge export: CustomName` | Export as `LT.Category.CustomName` instead of the function name |
| `--- @ltbridge alias: OtherName`   | Create an alternative name for the same function                |
| `--- @ltbridge global`             | Expose on the root `LT` object (e.g. `LT.GetBridgeVersion`)     |
| `--- @ltbridge internal`           | Hide from public API and docs                                   |
| `--- @ltbridge return:list:nil`    | Document return type as a union list                            |
| `--- @ltbridge params:list:name`   | Document param as a union list                                  |

## Examples

### Rename export

```lua
--- @ltbridge export: Send
function SendNotify(title, message, variant, length)
```

Becomes `LT.Notify.Send(...)` instead of `LT.Notify.SendNotify(...)`.

### Global export

```lua
--- @ltbridge global
function GetBridgeVersion()
```

Becomes `LT.GetBridgeVersion()`.

### Hide internal helper

```lua
--- @ltbridge internal
function AddZone(name)
```

Not included in `api.lua` or documentation.

## Standard EmmyLua

Always pair annotations with normal EmmyLua comments:

```lua
--- Add item to player.
--- @param source number Player source
--- @param item string Item name
--- @return boolean
function AddItem(source, item)
```

These drive IDE stubs and the generated docs.

Back to: [Creating Modules](/ltbridge/for-contributors/creating-modules.md)
