@scm-js/plugin-api 1.33.0 → 1.34.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/index.d.ts +25 -0
  2. package/package.json +1 -1
package/index.d.ts CHANGED
@@ -4215,6 +4215,24 @@ export interface StatusItemHandle {
4215
4215
  remove(): void;
4216
4216
  isShown(): boolean;
4217
4217
  }
4218
+ /** A button on the map itself (`ui.mapButton`), in the row at its bottom-right corner. */
4219
+ export interface MapButtonSpec {
4220
+ /** A word or two; the button is as wide as it. */
4221
+ label: string;
4222
+ /** The tooltip. */
4223
+ title?: string;
4224
+ /** A count or a short mark beside the label (unread messages); nothing when absent, null, 0 or "". */
4225
+ badge?: number | string | null;
4226
+ /** Drawn pressed: what the button opens is open. */
4227
+ active?: boolean;
4228
+ onClick: () => void;
4229
+ }
4230
+ export interface MapButtonHandle {
4231
+ /** Change any of the fields; the button redraws. */
4232
+ set(patch: Partial<MapButtonSpec>): void;
4233
+ remove(): void;
4234
+ isShown(): boolean;
4235
+ }
4218
4236
  /**
4219
4237
  * The dialogs a plugin may add to (`ui.dialogSlot`), and the fields each one exposes to
4220
4238
  * the slot. A field is the dialog's *working copy* — what the person sees in the form,
@@ -4482,6 +4500,13 @@ export interface UiApi {
4482
4500
  * leaves with `remove()` or the plugin.
4483
4501
  */
4484
4502
  statusItem(spec: StatusItemSpec): StatusItemHandle;
4503
+ /**
4504
+ * A button on the map, in the row at its bottom-right corner beside the tileset, size
4505
+ * and zoom — for something that belongs to the map being worked on, such as a shared
4506
+ * map's chat. Keep it to what matters while the map is in view; everything else goes
4507
+ * in a menu or the status bar. It leaves with `remove()` or the plugin.
4508
+ */
4509
+ mapButton(spec: MapButtonSpec): MapButtonHandle;
4485
4510
  /**
4486
4511
  * Add to a built-in dialog. `mount` runs in a row at the left of the dialog's footer each
4487
4512
  * time that dialog opens, with the dialog's working-copy fields to read and fill
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@scm-js/plugin-api",
3
- "version": "1.33.0",
3
+ "version": "1.34.0",
4
4
  "description": "Type declarations for the scmJS plugin API",
5
5
  "license": "MIT",
6
6
  "types": "index.d.ts",