// Modding API version 2. Generated from crates/modding; do not edit. // Regenerate with `cargo run -p modding --example write_sdk`. type ModActionEvent = { id: string; pressed: boolean; timeUs: number; }; type ModActionDeclaration = { id: string; name: string; defaultKey: string; }; declare namespace controls { export function register(input: ModActionDeclaration): void; } type Permission = "stage" | "skinImport" | "network"; type ChartManifest = { apiVersion: number; permissions?: Permission[]; images?: string[]; }; type BpmRange = { min: number; max: number; main: number; }; type TimingPoint = { timeUs: number; bpm: number; beatUs: number; meter: number; }; type Song = { title: string; artist: string; creator: string; difficulty: string; mode: string; layout: string; keys: number; durationUs: number; noteCount: number; ratings: Record; holdCount: number; bpm?: BpmRange | null; timing: TimingPoint[]; }; type TierInfo = { index: number; id: string; name: string; color: string; gradient?: string[] | null; earlyMs?: number | null; lateMs?: number | null; weight?: number | null; breaksCombo: boolean; }; type JudgementConfig = { preset: string; tiers: TierInfo[]; }; type PlayContext = { mode: string; layout: string; layoutSkin: string; columns: number; screenWidth: number; screenHeight: number; song: Song; judgements: JudgementConfig; }; type ChartSetup = (play: PlayContext) => void | Promise; type ChartDefinition = { apiVersion: number; permissions?: Permission[]; images?: string[]; setup?: ChartSetup; }; declare function defineChart(input: ChartDefinition): ChartManifest; type DependencySpec = { version: string; required?: boolean; feature?: string | null; }; type Dependency = string | DependencySpec; type OptionKind = "number" | "integer" | "boolean" | "string" | "color" | "enum" | "colors"; type ElementOption = { type: OptionKind; min?: number | null; max?: number | null; values?: string[]; maxLength?: number | null; default?: unknown | null; label?: string | null; player?: boolean; }; type ElementDeclaration = { root?: string | null; options?: Record; }; type Provides = { elements?: Record; }; type ModManifest = { id: string; name: string; version: string; apiVersion: number; author?: string | null; description?: string | null; homepage?: string | null; fonts?: Record; uses?: Record; provides?: Provides; permissions?: Permission[]; images?: string[]; loadOrder?: number; }; type ModSetup = (mod: ModManifest) => void | Promise; type ModDefinition = { id: string; name: string; version: string; apiVersion: number; author?: string | null; description?: string | null; homepage?: string | null; fonts?: Record; uses?: Record; provides?: Provides; permissions?: Permission[]; images?: string[]; loadOrder?: number; setup?: ModSetup; }; declare function defineMod(input: ModDefinition): ModManifest; type SkinManifest = { id: string; name: string; version: string; apiVersion: number; author?: string | null; description?: string | null; homepage?: string | null; fonts?: Record; uses?: Record; provides?: Provides; permissions?: Permission[]; images?: string[]; }; type SkinSetup = (play: PlayContext) => void | Promise; type SkinDefinition = { id: string; name: string; version: string; apiVersion: number; author?: string | null; description?: string | null; homepage?: string | null; fonts?: Record; uses?: Record; provides?: Provides; permissions?: Permission[]; images?: string[]; setup?: SkinSetup; }; declare function defineSkin(input: SkinDefinition): SkinManifest; type DownloadKind = "mirror" | "source"; type DownloadTarget = "osu"; type AuthKind = "none" | "token"; type AuthScope = "download" | "all"; type DownloadAuth = { kind: AuthKind; header?: string | null; scheme?: string | null; scope?: AuthScope | null; }; type PagingKind = "offset" | "page" | "cursor"; type PagingSpec = { kind: PagingKind; size: number; first?: number | null; }; type ResponseFormat = "osu" | "mapped"; type OnlySpec = { path: string; equals: string; }; type DifficultySpec = { path: string; name?: string | null; keys: string; stars?: string | null; length?: string | null; only?: OnlySpec | null; }; type ItemSpec = { id: string; title: string; artist?: string | null; creator?: string | null; status?: string | null; bpm?: string | null; playCount?: string | null; favourites?: string | null; cover?: string | null; difficulties?: DifficultySpec | null; }; type ResponseSpec = { format: ResponseFormat; results?: string | null; total?: string | null; nextCursor?: string | null; item?: ItemSpec | null; }; type SearchSpec = { url: string; params?: Record; sorts?: Record; statuses?: Record; paging?: PagingSpec | null; response: ResponseSpec; }; type DownloadSpec = { url?: string | null; urlField?: string | null; }; type DownloadDeclaration = { id: string; name: string; description?: string | null; site?: string | null; kind: DownloadKind; target?: DownloadTarget | null; hosts: string[]; rateLimit?: number | null; auth?: DownloadAuth | null; search?: SearchSpec | null; download: DownloadSpec; }; declare namespace downloads { export function register(input: DownloadDeclaration): void; } type BridgeDeclaration = { id: string; name: string; description?: string | null; site?: string | null; hosts: string[]; rateLimit?: number | null; auth?: DownloadAuth | null; }; type BridgeMethod = "GET" | "POST"; type BridgeExpect = "json" | "text" | "xml" | "html"; type BridgeRequest = { url: string; method?: BridgeMethod | null; headers?: Record | null; body?: string | null; form?: Record | null; json?: unknown | null; expect?: BridgeExpect | null; }; type ResultDetail = { label: string; value: string; }; type ResultAction = { id: string; label: string; }; type BridgeResult = { id: unknown; title: string; artist: string; creator?: string | null; coverUrl?: string | null; tags?: string[] | null; size?: string | null; keyCount?: number | null; details?: ResultDetail[] | null; actions?: ResultAction[] | null; data?: string | null; }; type BridgeFormat = "zip" | "osz" | "qp"; type BridgeDownload = { url: string; method?: BridgeMethod | null; headers?: Record | null; body?: string | null; form?: Record | null; json?: unknown | null; filename?: string | null; format: BridgeFormat; }; type BridgeStep = { request?: BridgeRequest | null; results?: BridgeResult[] | null; download?: BridgeDownload | null; error?: string | null; nextPage?: unknown | null; state?: unknown | null; }; type BridgeResponse = { status: number; headers: Record; text: string; }; type BridgeActionResult = { id: string; title: string; artist: string; data?: string | null; }; type BridgeSearch = (query: string, page: unknown, state: unknown) => BridgeStep; type BridgeOnResponse = (response: BridgeResponse, state: unknown) => BridgeStep; type BridgeAction = (result: BridgeActionResult, actionId: string, state: unknown) => BridgeStep; type BridgeDefinition = { id: string; name: string; description?: string | null; site?: string | null; hosts: string[]; rateLimit?: number | null; auth?: DownloadAuth | null; search: BridgeSearch; onResponse?: BridgeOnResponse; action?: BridgeAction; }; declare namespace downloads { export function registerBridge(input: BridgeDefinition): void; } type ElementConfigure = { element: string; from: string; options: unknown; }; type Beat = { index: number; timeUs: number; bpm: number; meterBeat: number; }; type HitQuery = { limit?: number | null; }; type Hit = { offsetMs: number; tier: number; }; type HitList = Hit[]; declare namespace game { export function hits(input: HitQuery): HitList; } type TierRef = { index: number; id: string; name: string; color: string; }; type JudgementEvent = { column: number; timeUs: number; offsetUs: number; tier: TierRef; combo: number; counts: number[]; accuracy: number; }; declare namespace game { export function judgements(input: void): JudgementConfig | null; } type NoteQuery = { fromUs: number; toUs: number; column?: number | null; cursor?: number | null; limit?: number | null; }; type Note = { index: number; column: number; timeUs: number; endUs?: number | null; }; type NotePage = { notes: Note[]; next?: number | null; }; declare namespace game { export function notes(input: NoteQuery): NotePage; } type SongTime = { timeUs: number; }; type PlayerState = { playing: boolean; paused: boolean; timeUs: number; combo: number; maxCombo: number; counts: number[]; judged: number; accuracy: number; }; declare namespace game { export function player(input: void): PlayerState; } declare namespace game { export function playfield(input: void): Playfield | null; } type Lane = { column: number; x: number; width: number; }; type Playfield = { keys: number; lanes: Lane[]; hitY: number; spawnY: number; scrollTimeUs: number; }; declare namespace game { export function settings(input: void): ModSettings | null; } type ModSettings = { volume: number; showFps: boolean; scrollTimeMs: number; audioOffsetMs: number; ratingSystem: string; }; declare namespace game { export function song(input: void): Song | null; } type SongEndEvent = { counts: number[]; maxCombo: number; accuracy: number; aborted: boolean; }; type SongStartEvent = { song: Song; judgements: JudgementConfig; timeUs: number; }; type TickEvent = { timeUs: number; hitCount: number; }; type GameplayModifierKind = "auto" | "ghost" | "mirror" | "random" | "noLn" | "fullLn"; type GameplayModifierDeclaration = { id: string; name: string; description: string; kind: GameplayModifierKind; group?: string | null; icon?: string | null; conflictsWith?: string[]; }; declare namespace gameplay { export function register(input: GameplayModifierDeclaration): void; } type Fill = { kind: "songProgress"; } | { kind: "accuracy"; } | { kind: "tierShare"; tier: number; }; type Anchor = "topLeft" | "top" | "topRight" | "left" | "center" | "right" | "bottomLeft" | "bottom" | "bottomRight"; type Layout = { x?: number | null; y?: number | null; width?: number | null; height?: number | null; anchor?: Anchor | null; }; type GradientStop = { color: string; at: number; }; type Gradient = { angle: number; stops: GradientStop[]; }; type Border = { width: number; color: string; }; type TextAlign = "start" | "center" | "end"; type Shadow = { x: number; y: number; blur: number; color: string; }; type Transform = { x?: number | null; y?: number | null; scale?: number | null; rotate?: number | null; }; type Style = { color?: string | null; background?: string | null; gradient?: Gradient | null; border?: Border | null; radius?: number | null; padding?: number | null; opacity?: number | null; font?: string | null; size?: number | null; weight?: number | null; italic?: boolean | null; align?: TextAlign | null; shadow?: Shadow | null; transform?: Transform | null; transitionMs?: number | null; }; type ShowWhen = "paused" | "running" | "showFps" | "judged" | "ghost"; type AnimateOn = "judgement" | "miss" | "hit"; type AnimateKind = "pop" | "popFade" | "flash"; type Animate = { on: AnimateOn; kind: AnimateKind; durationMs: number; }; type HudElement = "fps" | "accuracy" | "hits" | "misses" | "combo" | "timer" | "remaining" | "status" | "judgement" | "judgementCounts"; type BoxNode = { id: string; parent?: string | null; fill?: Fill | null; visible?: boolean | null; layout?: Layout | null; style?: Style | null; showWhen?: ShowWhen | null; animate?: Animate | null; element?: HudElement | null; }; declare namespace hud { export function box(input: BoxNode): string; } declare namespace hud { export function clear(input: void): void; } type FlowDirection = "row" | "column"; type FlowAlign = "start" | "center" | "end" | "stretch"; type FlowJustify = "start" | "center" | "end" | "spaceBetween"; type Flow = { direction: FlowDirection; gap?: number | null; align?: FlowAlign | null; justify?: FlowJustify | null; }; type GroupNode = { id: string; parent?: string | null; flow?: Flow | null; visible?: boolean | null; layout?: Layout | null; style?: Style | null; showWhen?: ShowWhen | null; animate?: Animate | null; element?: HudElement | null; }; declare namespace hud { export function group(input: GroupNode): string; } type ImageFit = "contain" | "cover" | "fill"; type ImageNode = { id: string; parent?: string | null; src: string; fit?: ImageFit | null; visible?: boolean | null; layout?: Layout | null; style?: Style | null; showWhen?: ShowWhen | null; animate?: Animate | null; element?: HudElement | null; }; declare namespace hud { export function image(input: ImageNode): string; } declare namespace hud { export function remove(input: string): void; } type HudLabel = "hits" | "misses" | "combo" | "accuracy" | "paused" | "remaining" | "fps" | "early" | "late" | "ghost" | "difference"; type HudAction = "skipIntro"; type TextBinding = { kind: "combo"; } | { kind: "maxCombo"; } | { kind: "hits"; } | { kind: "misses"; } | { kind: "judged"; } | { kind: "remaining"; } | { kind: "accuracy"; decimals?: number | null; } | { kind: "ghostAccuracy"; decimals?: number | null; } | { kind: "ghostDelta"; decimals?: number | null; } | { kind: "ghostCombo"; } | { kind: "ghostName"; } | { kind: "tierCount"; tier: number; } | { kind: "tierName"; tier: number; } | { kind: "lastJudgement"; colors?: Record; } | { kind: "elapsed"; } | { kind: "total"; } | { kind: "timer"; } | { kind: "fps"; } | { kind: "label"; label: HudLabel; } | { kind: "action"; action: HudAction; }; type TextNode = { id: string; parent?: string | null; text: string; bind?: TextBinding | null; visible?: boolean | null; layout?: Layout | null; style?: Style | null; showWhen?: ShowWhen | null; animate?: Animate | null; element?: HudElement | null; }; declare namespace hud { export function text(input: TextNode): string; } type NodePatch = { id: string; text?: string | null; bind?: TextBinding | null; fill?: Fill | null; src?: string | null; fit?: ImageFit | null; flow?: Flow | null; visible?: boolean | null; layout?: Layout | null; style?: Style | null; showWhen?: ShowWhen | null; animate?: Animate | null; element?: HudElement | null; }; declare namespace hud { export function update(input: NodePatch): void; } type JudgementParam = { label: string; min: number; max: number; step: number; default: number; short?: string | null; }; type SetAccuracy = "osuScoreV1" | "wife3" | "weights" | "continuous"; type SetHolds = "osuCombined" | "etterna" | "head" | "separate"; type SetDeclaration = { id: string; name: string; params?: Record; accuracy: SetAccuracy; holds: SetHolds; }; type JudgementTier = { id: string; name: string; color: string; gradient?: string[] | null; windowMs?: number | null; earlyMs?: number | null; lateMs?: number | null; weight?: number | null; breaksCombo?: boolean; }; type JudgementTiers = (params: Record) => JudgementTier[]; type JudgementSetDefinition = { id: string; name: string; params?: Record; accuracy: SetAccuracy; holds: SetHolds; tiers: JudgementTiers; }; declare namespace judgements { export function register(input: JudgementSetDefinition): void; } type SpriteSize = { width: number; height: number; }; type HoldMissedStyle = "hide" | "tint"; type LaneSpec = { note?: string | null; receptor?: string | null; receptorPressed?: string | null; holdBody?: string | null; holdEnd?: string | null; stageLight?: string | null; stageLightColor?: string | null; stageLightSize?: SpriteSize | null; stageLightOffsetY?: number | null; stageLightOn?: boolean | null; stageLightOpacity?: number | null; stageLightScale?: number | null; stageLightFadeMs?: number | null; keyLightOn?: boolean | null; keyLightOpacity?: number | null; keyLightScale?: number | null; keyLightFadeMs?: number | null; noteOffsetY?: number | null; holdEndOffset?: number | null; holdMatchNoteWidth?: boolean | null; holdWidthScale?: number | null; holdEndSize?: SpriteSize | null; holdEndScale?: number | null; holdEndFlip?: boolean | null; holdMissedStyle?: HoldMissedStyle | null; holdMissedColor?: string | null; holdMissedOpacity?: number | null; laneImage?: string | null; laneColor?: string | null; noteColor?: string | null; receptorColor?: string | null; pressedColor?: string | null; holdBodyColor?: string | null; holdEndColor?: string | null; offsetX?: number | null; offsetY?: number | null; width?: number | null; noteSize?: SpriteSize | null; receptorSize?: SpriteSize | null; }; type Easing = "linear" | "easeIn" | "easeOut" | "easeInOut"; type LaneUpdate = { column: number; lane: LaneSpec; transitionMs?: number | null; easing?: Easing | null; }; declare namespace lanes { export function set(input: LaneUpdate): void; } type LeaderboardBestQuery = { chartId: number; }; declare namespace leaderboard { export function best(input: LeaderboardBestQuery): number | null; } type LeaderboardQuery = { chartId: number; limit?: number | null; offset?: number | null; }; declare namespace leaderboard { export function query(input: LeaderboardQuery): number | null; } type TierCount = { name: string; count: number; }; type LeaderboardEntry = { rank: number; replayId: string; playerName?: string | null; received: boolean; accuracy: number; performance?: number | null; performanceNonstandard: boolean; maxCombo: number; misses: number; tiers: TierCount[]; rate: number; modified: boolean; playedAtMs: number; }; type LeaderboardPerformance = { calculator: string; unit: string; }; type LeaderboardResult = { requestId: number; chartId: number; offset: number; total: number; entries: LeaderboardEntry[]; judgement: string; performance?: LeaderboardPerformance | null; unavailableReplays: number; error?: string | null; }; type ChartAdded = { chartId: number; }; type ChartsAdded = { chartIds: number[]; truncated: boolean; }; type LibraryFilterDeclaration = { id: string; name: string; table: string; column: string; version: number; unit?: string; }; declare namespace library { namespace filters { export function register(input: LibraryFilterDeclaration): void; } } type LibraryReady = {}; declare namespace log { export function info(input: string): void; } declare namespace log { export function warn(input: string): void; } type MetronCalculator = { id: string; performance: boolean; version: number; }; type MetronCatalog = { calculators: MetronCalculator[]; }; declare namespace metron { export function catalog(input: void): MetronCatalog; } type CalculatorRequest = { calculator: string; }; declare namespace metron { export function difficulty(input: CalculatorRequest): number | null; } type PerformanceRequest = { calculator: string; accuracy: number; }; declare namespace metron { export function performance(input: PerformanceRequest): number | null; } type PerformanceResult = { requestId: number; calculator: string; value?: number | null; unit: string; error?: string | null; }; type PlayfieldAnchor = "topLeft" | "top" | "topRight" | "left" | "center" | "right" | "bottomLeft" | "bottom" | "bottomRight"; type ScrollDirection = "down" | "up"; type HitLightOn = "all" | "off"; type TextureFilter = "linear" | "nearest"; type MeasureLineLength = "playfield" | "lanes"; type JudgementLineAt = "center" | "top" | "bottom"; type PlayfieldSpec = { x?: number | null; y?: number | null; anchor?: PlayfieldAnchor | null; rotation?: number | null; zoom?: number | null; laneWidth?: number | null; width?: number | null; laneGap?: number | null; laneHeight?: number | null; receptorY?: number | null; scroll?: ScrollDirection | null; noteSize?: SpriteSize | null; receptorSize?: SpriteSize | null; holdWidth?: number | null; holdEndSize?: SpriteSize | null; holdEndOffset?: number | null; holdMatchNoteWidth?: boolean | null; holdWidthScale?: number | null; holdEndScale?: number | null; holdEndFlip?: boolean | null; noteOffsetY?: number | null; stageLightSize?: SpriteSize | null; stageLightOffsetY?: number | null; hitLight?: string | null; hitLightOn?: HitLightOn | null; hitLightFollowJudgement?: boolean | null; stageLightOn?: boolean | null; stageLightOpacity?: number | null; stageLightScale?: number | null; stageLightFadeMs?: number | null; keyLightOn?: boolean | null; keyLightOpacity?: number | null; keyLightScale?: number | null; keyLightFadeMs?: number | null; hitLightOpacity?: number | null; hitLightScale?: number | null; holdLightOpacity?: number | null; holdLightScale?: number | null; hitLightFrames?: number | null; hitLightFps?: number | null; hitLightSize?: SpriteSize | null; hitLightOffsetY?: number | null; hitLightColor?: string | null; holdLight?: string | null; holdLightFrames?: number | null; holdLightFps?: number | null; holdLightSize?: SpriteSize | null; holdLightOffsetY?: number | null; holdLightColor?: string | null; textureFilter?: TextureFilter | null; holdMissedStyle?: HoldMissedStyle | null; holdMissedColor?: string | null; holdMissedOpacity?: number | null; laneCover?: boolean | null; laneCoverColor?: string | null; laneCoverOpacity?: number | null; laneCoverSize?: number | null; laneCoverFeather?: number | null; measureLines?: boolean | null; measureLineColor?: string | null; measureLineOpacity?: number | null; measureLineThickness?: number | null; measureLineLength?: MeasureLineLength | null; measureLineOvershoot?: number | null; measureLineEvery?: number | null; beatLines?: boolean | null; beatLineColor?: string | null; beatLineOpacity?: number | null; beatLineThickness?: number | null; borderWidth?: number | null; borderColor?: string | null; judgementLine?: boolean | null; judgementLineColor?: string | null; judgementLineThickness?: number | null; judgementLineAt?: JudgementLineAt | null; backgroundColor?: string | null; backgroundImage?: string | null; backgroundTint?: string | null; laneColor?: string | null; noteColor?: string | null; receptorColor?: string | null; pressedColor?: string | null; holdBodyColor?: string | null; holdEndColor?: string | null; note?: string | null; receptor?: string | null; receptorPressed?: string | null; holdBody?: string | null; holdEnd?: string | null; laneImage?: string | null; stageLight?: string | null; stageLightColor?: string | null; lanes?: LaneSpec[] | null; }; declare namespace playfield { export function set(input: PlayfieldSpec): void; } type PlayfieldUpdate = { patch: PlayfieldSpec; transitionMs?: number | null; easing?: Easing | null; }; declare namespace playfield { export function update(input: PlayfieldUpdate): void; } type BackfillRequest = { id: string; charts?: number[] | null; }; declare namespace ratings { export function backfill(input: BackfillRequest): number | null; } type RatingProgress = { requestId: number; id: string; done: number; total: number; failed: number; finished: boolean; error?: string | null; ahead: number; }; type ChartMetric = "notes" | "holds" | "holdPercent" | "averageNps" | "peakNps" | "bpmMin" | "bpmMax" | "duration"; type RatingFieldSource = { kind: "column"; column: string; } | { kind: "chart"; metric: ChartMetric; }; type RatingField = { label: string; source: RatingFieldSource; unit?: string; decimals?: number; }; type RatingSeriesSource = "density" | "bpm"; type RatingSeries = { label: string; source: RatingSeriesSource; unit: string; }; type RatingPanel = { kind: "metrics"; title: string; fields: RatingField[]; } | { kind: "bars"; title: string; fields: RatingField[]; max?: number | null; } | { kind: "radar"; title: string; fields: RatingField[]; max?: number | null; } | { kind: "timeline"; title: string; series: RatingSeries[]; }; type RatingDeclaration = { id: string; name: string; calculator: string; unit: string; table: string; column: string; version: number; panels?: RatingPanel[]; }; declare namespace ratings { export function register(input: RatingDeclaration): void; } type ScrollSpeedParam = { label: string; min: number; max: number; step: number; default: number; short?: string | null; }; type ScrollSpeedDeclaration = { id: string; name: string; param: ScrollSpeedParam; }; type ScrollSpeedContext = { travel: number; }; type ScrollSpeedToMs = (value: number, context: ScrollSpeedContext) => number; type ScrollSpeedDefinition = { id: string; name: string; param: ScrollSpeedParam; toMs: ScrollSpeedToMs; }; declare namespace scrollSpeed { export function register(input: ScrollSpeedDefinition): void; } type SkinImportAction = { id: string; }; declare namespace skinImport { export function close(input: void): void; } type SkinImportCreate = { stageId: number; }; declare namespace skinImport { export function create(input: SkinImportCreate): number | null; } type SkinImportCreated = { requestId: number; id?: string | null; error?: string | null; }; type SourceKind = "folder" | "archive"; type IniGeneral = { name?: string | null; author?: string | null; version?: string | null; }; type ManiaColumn = { noteImage?: string | null; noteImageH?: string | null; noteImageL?: string | null; noteImageT?: string | null; keyImage?: string | null; keyImageD?: string | null; colour?: string | null; colourLight?: string | null; }; type ManiaSection = { keys: number; columnStart?: number | null; columnWidth: number[]; columnSpacing: number[]; columnLineWidth: number[]; hitPosition?: number | null; lightPosition?: number | null; scorePosition?: number | null; comboPosition?: number | null; judgementLine?: boolean | null; upsideDown?: boolean | null; noteBodyStyle?: number | null; lightFramePerSecond?: number | null; barlineHeight?: number | null; colourColumnLine?: string | null; colourBarline?: string | null; colourJudgementLine?: string | null; colourHold?: string | null; stageLeft?: string | null; stageRight?: string | null; stageBottom?: string | null; stageHint?: string | null; stageLight?: string | null; lightingN?: string | null; lightingL?: string | null; columns: ManiaColumn[]; ignored: string[]; }; type SkinIni = { general: IniGeneral; mania: ManiaSection[]; fontsUsed: boolean; problems: string[]; }; type SourceImage = { name: string; frames: number; hasStill: boolean; scale: number; width: number; height: number; bytes: number; blank?: boolean | null; peakColor?: string | null; peakWidth?: number | null; }; type SkinSource = { sourceId: number; label: string; kind: SourceKind; ini?: SkinIni | null; images: SourceImage[]; truncated: boolean; totalBytes: number; problems: string[]; }; type SkinImportOpened = { importerId: string; locale: string; source?: SkinSource | null; error?: string | null; }; type PanelStatus = "working" | "ready" | "done" | "error"; type PanelRow = { label: string; value: string; }; type PanelSection = { heading: string; rows: PanelRow[]; }; type NoteLevel = "info" | "warning" | "error"; type PanelNote = { level: NoteLevel; text: string; }; type PanelAction = { id: string; label: string; primary?: boolean | null; editSkin?: string | null; }; type ImportPanelDefinition = { title: string; status: PanelStatus; detail?: string | null; sections?: PanelSection[]; notes?: PanelNote[]; actions?: PanelAction[]; }; declare namespace skinImport { export function panel(input: ImportPanelDefinition): void; } type ImporterText = { name: string; description?: string | null; }; type ImporterDeclaration = { id: string; name: string; description?: string | null; localized?: Record; sources: SourceKind[]; }; declare namespace skinImport { export function register(input: ImporterDeclaration): void; } type SkinLayout = { keys: number; playfield?: PlayfieldSpec; lanes: LaneSpec[]; }; type SkinHud = { judgementY?: number | null; comboY?: number | null; }; type SkinDescription = { id: string; name: string; version?: string | null; author?: string | null; description?: string | null; playfield?: PlayfieldSpec; layouts: SkinLayout[]; hud?: SkinHud; }; type ImageBox = { maxWidth: number; maxHeight: number; }; type ImageSize = { width: number; height: number; }; type ImageOp = { source: string; dest: string; animation?: boolean; frame?: number | null; padTop?: number; padBottom?: number; fit?: ImageBox | null; stretch?: ImageSize | null; }; type StageRequest = { sourceId: number; skin: SkinDescription; images: ImageOp[]; }; declare namespace skinImport { export function stage(input: StageRequest): number | null; } type StagedFile = { path: string; bytes: number; width: number; height: number; }; type Report = { files: StagedFile[]; totalBytes: number; budgetBytes: number; overBudget: boolean; problems: string[]; }; type SkinImportStaged = { requestId: number; stageId?: number | null; report?: Report | null; error?: string | null; }; declare namespace stage { export function clear(input: void): void; } type StageLayer = "below" | "lanes" | "above"; type StageSpace = "screen" | "playfield" | "lane" | "receptor"; type StagePoint = { space?: StageSpace | null; column?: number | null; x?: number | null; y?: number | null; }; type StageEmitter = { id: string; layer?: StageLayer | null; at: StagePoint; image?: string | null; size: number; color?: string | null; endColor?: string | null; lifetimeMs: number; speed?: number | null; speedJitter?: number | null; direction?: number | null; spread?: number | null; gravity?: number | null; burst?: number | null; rate?: number | null; maxParticles: number; fade?: boolean | null; shrink?: boolean | null; }; declare namespace stage { export function emitter(input: StageEmitter): string; } type StageCue = { target: string; animation: string; }; declare namespace stage { export function play(input: StageCue): void; } type StageSize = { width: number; height: number; }; type StageProps = { x?: number | null; y?: number | null; scale?: number | null; rotation?: number | null; opacity?: number | null; color?: string | null; }; type StageAnimation = { durationMs: number; easing?: Easing | null; repeat?: boolean | null; from?: StageProps; to?: StageProps; }; type StageRect = { id: string; layer?: StageLayer | null; at: StagePoint; size: StageSize; color?: string | null; radius?: number | null; opacity?: number | null; rotation?: number | null; scale?: number | null; animations?: Record | null; }; declare namespace stage { export function rect(input: StageRect): string; } declare namespace stage { export function remove(input: string): boolean; } type StageSprite = { id: string; layer?: StageLayer | null; at: StagePoint; image: string; size: StageSize; color?: string | null; opacity?: number | null; rotation?: number | null; scale?: number | null; animations?: Record | null; }; declare namespace stage { export function sprite(input: StageSprite): string; } declare namespace stage { export function stop(input: StageCue): void; } type StageAlign = "start" | "center" | "end"; type StageText = { id: string; layer?: StageLayer | null; at: StagePoint; text: string; size: number; color?: string | null; align?: StageAlign | null; opacity?: number | null; rotation?: number | null; scale?: number | null; animations?: Record | null; }; declare namespace stage { export function text(input: StageText): string; } type StageJudgementFilter = { tier?: number | null; column?: number | null; miss?: boolean | null; }; type StageColumn = { column?: number | null; }; type StageEvent = { judgement?: StageJudgementFilter | null; press?: StageColumn | null; release?: StageColumn | null; holdStart?: StageColumn | null; holdEnd?: StageColumn | null; }; type StageTrigger = { id: string; on: StageEvent; target: string; play?: string | null; stop?: string | null; }; declare namespace stage { export function trigger(input: StageTrigger): string; } declare namespace storage { export function clear(input: void): void; } declare namespace storage { export function get(input: string): unknown | null; } declare namespace storage { export function keys(input: void): string[]; } declare namespace storage { export function remove(input: string): void; } type StorageEntry = { key: string; value: unknown; }; declare namespace storage { export function set(input: StorageEntry): void; } type ColumnKind = "number" | "text"; type ColumnDefinition = { name: string; kind: ColumnKind; indexed?: boolean; }; type TableDefinition = { id: string; columns: ColumnDefinition[]; }; declare namespace tables { export function register(input: TableDefinition): void; } type ExtendableTab = "info" | "leaderboard" | "mods"; type TabSlot = "top" | "bottom"; type LeaderboardStat = "plays" | "bestPerformance" | "bestAccuracy"; type TabFieldSource = { kind: "column"; rating: string; column: string; } | { kind: "chart"; metric: ChartMetric; } | { kind: "leaderboard"; stat: LeaderboardStat; }; type TabField = { label: string; source: TabFieldSource; unit?: string; decimals?: number; }; type TabPanel = { kind: "metrics"; title: string; fields: TabField[]; } | { kind: "bars"; title: string; fields: TabField[]; max?: number | null; } | { kind: "radar"; title: string; fields: TabField[]; max?: number | null; } | { kind: "timeline"; title: string; series: RatingSeries[]; } | { kind: "leaderboard"; title: string; limit: number; } | { kind: "text"; title?: string | null; text: string; }; type TabExtensionDeclaration = { tab: ExtendableTab; slot: TabSlot; order?: number; panels: TabPanel[]; }; declare namespace tabs { export function extend(input: TabExtensionDeclaration): void; } type TabDeclaration = { id: string; title: string; icon?: string | null; order?: number; panels: TabPanel[]; }; declare namespace tabs { export function register(input: TabDeclaration): void; } type PopupActionEvent = { id: string; }; declare namespace ui { export function dismiss(input: void): void; } type PopupAction = { id: string; label: string; }; type PopupDefinition = { title: string; detail: string; done: number; total: number; actions?: PopupAction[]; }; declare namespace ui { export function popup(input: PopupDefinition): void; } type HostEvents = { "controls.action": ModActionEvent; "elements.configure": ElementConfigure; "game.beat": Beat; "game.judgement": JudgementEvent; "game.pause": SongTime; "game.playfieldChange": Playfield; "game.resume": SongTime; "game.settingsChange": ModSettings; "game.songEnd": SongEndEvent; "game.songStart": SongStartEvent; "game.tick": TickEvent; "leaderboard.result": LeaderboardResult; "library.chartAdd": ChartAdded; "library.chartsAdded": ChartsAdded; "library.ready": LibraryReady; "metron.performanceResult": PerformanceResult; "ratings.progress": RatingProgress; "skinImport.action": SkinImportAction; "skinImport.created": SkinImportCreated; "skinImport.opened": SkinImportOpened; "skinImport.staged": SkinImportStaged; "ui.action": PopupActionEvent; }; declare const ctx: { on(event: K, handler: (payload: HostEvents[K]) => void | Promise): void; /** A package this one `uses` is present, compatible and running. */ has(id: string): boolean; /** An element another package `provides`, named `"/"`: its options are checked against the provider's declaration and handed to the provider. */ element(id: string): { configure(options: Record): void }; };