rednode API - v0.50.0
    Preparing search index...

    Variable apiConst

    api: GameApi & ApiExtras = ...

    The game API: every global function, and every class's static functions under its script name, typed from the game's type data.

    Arguments and results:

    Game type In JavaScript
    Bool, Int8 to Int32, Uint8 to Uint32, Float, Double boolean, number
    Int64, Uint64, CRUID string, because numbers lose precision above 2^53
    CName, String string
    TweakDBID "0x..."; a record path such as "Items.money" also works as an argument
    enums the member's name, such as "Health"
    structs plain objects; as arguments, missing properties keep their default, and null is the default value
    objects (handles) GameRef proxies; null only where the game marks the parameter optional, otherwise api.$null
    arrays arrays
    resource references (rRef, raRef, ResRef) a depot path such as "base\...\crate_a.mesh", or its hash as a string; read back as the hash

    Functions with out parameters return { result, out }, and so does a call with api.$out in place of an argument. Objects a call makes that nothing in the game holds yet stay alive while you hold their reference.

    import { api, game } from "rednode";

    const player = await api.GetPlayer(game.instance);
    const id = await player!.GetEntityID();
    const statsId = await api.$call("Cast;EntityID;StatsObjectID", id);
    const stats = await api.GameInstance.GetStatsSystem(game.instance);
    const level = await stats!.GetStatValue(statsId as never, "Level");