Type Overview

ALLOW_MISSING_EVENTS

Whether to throw type errors when trying to register an event handler with an event that's not documented in TypeScript.

ALLOW_MISSING_EVENTS = false

ALLOW_MISSING_PANELS

Whether to throw type errors when trying to use $.CreatePanel or other API methods taking a panel name, when that panel name is not documented in TypeScript.

ALLOW_MISSING_PANELS = false

Brand

Make a type incompatible with types that'd otherwise be compatible.

Brand = Type & { __brand: Brand; }

color

rgba, hex etc. color string

color = string

double

No description provided.

double = number

duration

A duration in seconds.

duration = number

float

No description provided.

float = number

Func

No description provided.

Func = { (...args: Args): Return; }

int16

No description provided.

int16 = number

int32

No description provided.

int32 = number

int64_num

No description provided.

int64_num = number

int64_str

A STRING representing an int64.

JavaScript numbers are IEEE floats and lose precision when used for values greater than 2^53. Most of Panorama was implemented before native JS BigInts were a thing, and not worth the refactoring work to use them.

In C++, when a C++ method/events exposed to JS have a int64/uint64 param, either a number or string can be passed from JS, and both will be converted to the corresponding 64-bit integer. If precision is a concern (e.g. SteamIDs), use a string.

For methods/events that return a int64/uint64, Panorama will return a JS string!

To be super explicit this, we have separate type aliases for both numbers and strings. When typing C++ methods, those taking int64 params in C++ should have TS params with type int64_str | int64_num, whilst methods returning int64s from C++ should return only int64_str in TS.

int64_str = string

int8

No description provided.

int8 = number

JsonArray

No description provided.

JsonArray = JsonValue[] | readonly JsonValue[]

See also: JsonValue

JsonObject

No description provided.

JsonObject = { [Key in string]: JsonValue } & { [Key in string]?: JsonValue }

See also: JsonValue

JsonPrimitive

No description provided.

JsonPrimitive = string | number | boolean | null

JsonValue

No description provided.

JsonValue = JsonPrimitive | JsonObject | JsonArray

Keyframes

Represents a keyframes animation return.

Keyframes = unknown

Primitive

No description provided.

Primitive = null | undefined | string | number | boolean | symbol | bigint

rgbaColor

rgba color string

rgbaColor = string

Simplify

Encourages IDEs to flatten types when displaying.

Simplify = { [Key in keyof T]: T[Key] } & { }

steamID

String of a SteamID64. Might look like a uint64 in C++ but it's always a string in JS!

steamID = string

uint16

No description provided.

uint16 = number

uint32

No description provided.

uint32 = number

uint64_num

No description provided.

uint64_num = number

uint64_str

No description provided.

uint64_str = string

uint8

No description provided.

uint8 = number

uuid

Represents a unique id return.

uuid = int32

See also: int32

ValueOf

No description provided.

ValueOf = T[keyof T]

vec2

No description provided.

vec2 = { x: number; y: number; }

vec3

No description provided.

vec3 = { x: number; y: number; z: number; }

QueryOutput

No description provided.

QueryOutput = T extends `.${string}` ? E[] : E

ClockType

No description provided.

ClockType = ValueOf<ClockTypeEnum>

GenericPanel

Some kind of panel, containing at minimum the properties of Panel. Use paneltype === 'panel name' to narrow!

GenericPanel = PanelTagNameMap[keyof PanelTagNameMap]

SettingsPanel

No description provided.

SettingsPanel = SettingsSlider | SettingsKeyBinder | SettingsToggle | SettingsEnum | SettingsEnumDropDown | ConVarColorDisplay