interface
TopMenuItemA single registered top-menu entry (an admin command surfaced in the adminmenu).
id: stringname: stringflags: numberonSelect: (adminSlot: number) => voidDocs / API / Modules / topmenu
@s2script/sdk/topmenu
the extensible admin/top menu registry.
import { TopMenuItem } from "@s2script/sdk/topmenu";Author-time types ship in the npm package; the engine injects the runtime at plugin load. Add @s2script/sdk to your plugin's dependencies.
Generated from the shipped type definitions.
TopMenuItemA single registered top-menu entry (an admin command surfaced in the adminmenu).
id: stringname: stringflags: numberonSelect: (adminSlot: number) => voidTopMenuSnapshotA handler-free copy of the whole registry — what a menu renderer reads to build the display.
categories: string[]items: { id: string; category: string; name: string; flags: number }[]onSelect), tagged with its category.TopMenuThe shared admin/top-menu registry — renderers read TopMenu.snapshot and dispatch picks through TopMenu.select; items are contributed by plugins via their own ctx.topmenu.
import { TopMenu } from "@s2script/sdk/topmenu";
const snap = TopMenu.snapshot();
for (const cat of snap.categories) renderCategory(cat);
// when the admin picks an item id, dispatch it back to its owner plugin:
m.onSelect(e => { TopMenu.select(e.info, slot); });snapshot(): TopMenuSnapshotselect(id: string, slot: number): void