@scml/sc2-verlnir

TypeScript type definitions for SugarCube 2 API (based on verlnir). This package uses type declarations from src/ directly; no download or build required.

Installation

npm
yarn
pnpm
bun
deno
npm install -D @scml/sc2-verlnir

Quick Start

Add type reference

/// <reference types="@scml/sc2-verlnir" />

Use global APIs

SugarCube 2 exposes APIs globally via declare global, e.g. Story, Config, State, Passage.

Global Types global

Main entry ./src/global.d.ts declares SugarCube 2 global APIs via declare global. global Common global APIs:

APITypeDescription
StoryStoryAPIStory and passage access
ConfigConfigAPIEngine configuration
StateStateAPIGame state, history, temp variables
PassagePassageConstructorCurrent passage
SaveSaveAPISave/load
DialogDialogAPIDialog system
EngineEngineAPIEngine control
MacroMacroAPIMacro definitions
ScriptingScriptingAPIScript evaluation
TemplateTemplateAPITemplate engine
UI / UIBarUIAPI / UIBarAPIUI components
versionVersionInfoVersion info
session / storageSimpleStoreInstanceAPI | nullSession and storage
settings / setupRecord<string, unknown>Settings and init
window.SugarCubeobjectContains all above APIs for detection and debugging
Main entry
/// <reference types="@scml/sc2-verlnir" />

Subpath Exports

SubpathDescription
.Main entry, SugarCube 2 global types

Type Definition Source

INFO
  • Source: SugarCube 2 type declarations based on verlnir
  • This package has no download/build steps; uses src directory directly