Overview
@alias gives a type expression a name. Use it for long types or types you reuse across your addon.
Syntax
Simple aliases
Union aliases
String literal enumerations
Use---| to list allowed string values:
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
Create named type aliases for use across your codebase.
@alias gives a type expression a name. Use it for long types or types you reuse across your addon.
---@alias AliasName TypeExpression
---@alias AliasName
---| "value1" # description
---| "value2" # description
---@alias ID number
---@alias PlayerName string
---@alias Callback fun(result: any): nil
---@param id ID
---@return PlayerName
function GetPlayerName(id) end
---@alias StringOrNumber string | number
---@alias MaybePlayer Player | nil
---| to list allowed string values:
---@alias Realm
---| "client" # Runs on clients only
---| "server" # Runs on the server only
---| "shared" # Runs on both server and clients
---@param realm Realm
function SetDefaultRealm(realm) end
---@alias Callback<T> fun(result: T, err: string?): nil
---@alias Pair<K, V> { key: K, value: V }
---@alias HookName string -- or a union of known hook name literals
---@alias NetMessageName string
---@alias ConVarCallback fun(cv: ConVar, oldVal: string, newVal: string): nil
Was this page helpful?