@scm-js/plugin-api 1.22.0 → 1.24.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.
- package/index.d.ts +52 -1
- package/package.json +1 -1
package/index.d.ts
CHANGED
|
@@ -1957,6 +1957,20 @@ export interface PluginManifest {
|
|
|
1957
1957
|
icon?: string;
|
|
1958
1958
|
/** The `PLUGIN_API_VERSION` the plugin was written against. */
|
|
1959
1959
|
api?: number;
|
|
1960
|
+
/**
|
|
1961
|
+
* Plugins this one needs running, as the specs Manage Plugins takes
|
|
1962
|
+
* (`"github:owner/repo"`, `"github:owner/repo@v1.2.0"`, a URL to a `plugin.json`,
|
|
1963
|
+
* `"builtin:name"`). Adding this plugin installs them first, enabling it enables them,
|
|
1964
|
+
* and the editor starts them before it; a required plugin cannot be turned off or
|
|
1965
|
+
* removed while something enabled needs it.
|
|
1966
|
+
*
|
|
1967
|
+
* Which *version* of the required plugin is enough is not said here. The two plugins
|
|
1968
|
+
* meet through `api.services`: the required one provides a service with a `version`
|
|
1969
|
+
* (`ServiceOptions`), and this one checks `ServiceInfo.version` in its `watch` and says
|
|
1970
|
+
* so in its own words when it is too old. A version range in the manifest would have
|
|
1971
|
+
* the editor arbitrate a contract it never reads.
|
|
1972
|
+
*/
|
|
1973
|
+
requires?: string[];
|
|
1960
1974
|
}
|
|
1961
1975
|
/** What `activate` may hand back: nothing, a cleanup function, or a Disposable. */
|
|
1962
1976
|
export type Deactivate = void | (() => void) | Disposable;
|
|
@@ -2804,6 +2818,36 @@ export interface TriggersApi {
|
|
|
2804
2818
|
};
|
|
2805
2819
|
/** A trigger's `Comment` action text, when it has one. */
|
|
2806
2820
|
comment(trigger: TriggerRecord): string | null;
|
|
2821
|
+
/**
|
|
2822
|
+
* EUD: the player value that reaches a memory address through the deaths table
|
|
2823
|
+
* (`(address − consts.triggers.deathsTable) / 4`, the address rounded down to a dword)
|
|
2824
|
+
* — what a Deaths condition or Set Deaths action stores in `player` with `unitId` 0 to
|
|
2825
|
+
* read or write that dword.
|
|
2826
|
+
*/
|
|
2827
|
+
epd(address: number): number;
|
|
2828
|
+
/** EUD: the address a record's `player` and `unitId` reach through the deaths table — `epd`'s inverse, and a plain death counter's cell as an address. */
|
|
2829
|
+
addressOf(player: number, unitId?: number): number;
|
|
2830
|
+
/**
|
|
2831
|
+
* A content fingerprint of a trigger: the same wherever it sits in the list and
|
|
2832
|
+
* whatever the game's bookkeeping bits say. What a plugin that generates triggers
|
|
2833
|
+
* finds its run by (`TriggerClaimSpec.locate`), and what an editor keeps a selection
|
|
2834
|
+
* by across a list that changed under it.
|
|
2835
|
+
*/
|
|
2836
|
+
fingerprint(trigger: TriggerRecord): string;
|
|
2837
|
+
/**
|
|
2838
|
+
* Every death-counter cell (`[player, unit]`) and switch the triggers read or write —
|
|
2839
|
+
* TRIG when `list` is omitted. A player group counts as every slot it can resolve to
|
|
2840
|
+
* (`Current Player` as the trigger's owners); a class unit (*Any unit*, *Men*, …)
|
|
2841
|
+
* counts for nothing, and an EUD player is an address, not a cell. What a plugin that
|
|
2842
|
+
* allocates counters or switches of its own must keep clear of.
|
|
2843
|
+
*/
|
|
2844
|
+
usage(list?: TriggerRecord[]): {
|
|
2845
|
+
cells: [
|
|
2846
|
+
player: number,
|
|
2847
|
+
unit: number
|
|
2848
|
+
][];
|
|
2849
|
+
switches: number[];
|
|
2850
|
+
};
|
|
2807
2851
|
/**
|
|
2808
2852
|
* Tell the editor that a run of the trigger list is generated by this plugin. The
|
|
2809
2853
|
* Trigger Editor badges those rows, locks them and offers the plugin's own editor in
|
|
@@ -3382,9 +3426,16 @@ export interface TriggerConsts {
|
|
|
3382
3426
|
readonly triggerFlags: typeof TriggerFlag;
|
|
3383
3427
|
/**
|
|
3384
3428
|
* The address of the game's death table, which is the base an EUD player value is
|
|
3385
|
-
* counted from: `epd = (address - deathsTable) / 4
|
|
3429
|
+
* counted from: `epd = (address - deathsTable) / 4` (`triggers.epd` does the sum).
|
|
3386
3430
|
*/
|
|
3387
3431
|
readonly deathsTable: number;
|
|
3432
|
+
/**
|
|
3433
|
+
* The value of a condition's or action's trailing `mask` word that makes it a *masked*
|
|
3434
|
+
* record: the game then reads or writes only the bits set in the record's `location`
|
|
3435
|
+
* field, which is how one byte, one word or one bit of a dword is reached. StarCraft:
|
|
3436
|
+
* Remastered only; 1.16.1 ignores the word.
|
|
3437
|
+
*/
|
|
3438
|
+
readonly maskedRecord: 17235;
|
|
3388
3439
|
}
|
|
3389
3440
|
export interface ActiveBrush {
|
|
3390
3441
|
mode: TerrainMode;
|