@scm-js/plugin-api 1.24.0 → 1.25.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 +21 -0
- package/package.json +1 -1
package/index.d.ts
CHANGED
|
@@ -1141,6 +1141,15 @@ export interface MapImageOptions {
|
|
|
1141
1141
|
*/
|
|
1142
1142
|
rect?: Rect | null;
|
|
1143
1143
|
}
|
|
1144
|
+
export type TestRoute = "desktop" | "folder" | "download";
|
|
1145
|
+
export interface TestMapOutcome {
|
|
1146
|
+
route: TestRoute;
|
|
1147
|
+
/** The file's name, or its full path when the desktop wrote it. */
|
|
1148
|
+
path: string;
|
|
1149
|
+
launched: boolean;
|
|
1150
|
+
/** Why the game did not start, when it was asked to. */
|
|
1151
|
+
message?: string;
|
|
1152
|
+
}
|
|
1144
1153
|
/** What the registry knows about a section name, sized for one map. */
|
|
1145
1154
|
export interface SectionKnowledge {
|
|
1146
1155
|
name: string;
|
|
@@ -2309,6 +2318,18 @@ export interface DocumentApi {
|
|
|
2309
2318
|
* a map, null.
|
|
2310
2319
|
*/
|
|
2311
2320
|
renderImage(options?: Partial<MapImageOptions>): Promise<Blob | null>;
|
|
2321
|
+
/**
|
|
2322
|
+
* Tools ▸ Test Map for bytes of the plugin's own — a built map that is not the open
|
|
2323
|
+
* one. On the desktop the file is written into the game's `Maps\scmJS` folder and, with
|
|
2324
|
+
* `launch` (the preference when omitted), the game is started; in a browser it is
|
|
2325
|
+
* written into the test folder the user picked once. It never downloads: a browser
|
|
2326
|
+
* with no folder answers null, so a plugin that has already saved the file says "open
|
|
2327
|
+
* it with Test Map" instead of handing out a second copy. `fileName` gets an archive's
|
|
2328
|
+
* extension if it lacks one.
|
|
2329
|
+
*/
|
|
2330
|
+
test(bytes: Uint8Array, fileName: string, options?: {
|
|
2331
|
+
launch?: boolean;
|
|
2332
|
+
}): Promise<TestMapOutcome | null>;
|
|
2312
2333
|
/**
|
|
2313
2334
|
* Scenario ▸ Resize / Crop Map: a transaction outside the undo model that drops both
|
|
2314
2335
|
* history stacks (as the dialog does). Content keeps its place relative to `anchor`
|