@vttforge/cli 0.18.1 → 0.18.2
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/CHANGELOG.md +9 -0
- package/dist/bin.mjs +1 -1
- package/dist/index.mjs +1 -1
- package/dist/{src-BjAKmth4.mjs → src-DCGqFefY.mjs} +2 -2
- package/dist/{src-BjAKmth4.mjs.map → src-DCGqFefY.mjs.map} +1 -1
- package/package.json +1 -1
- package/templates/module-ts/package.json +1 -1
- package/templates/module-ts/scripts/foundry-globals.d.ts +15 -33
- package/templates/system-ts/package.json +1 -1
- package/templates/system-ts/scripts/foundry-globals.d.ts +15 -33
package/package.json
CHANGED
|
@@ -4,51 +4,33 @@
|
|
|
4
4
|
* An ambient declaration, so it lives in a `.d.ts` and `include` picks it up.
|
|
5
5
|
* Nothing imports it.
|
|
6
6
|
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
* declaration `@vttforge/testing` ships, and `tsc` stops with TS2451.
|
|
7
|
+
* Two `declare global` blocks naming one global have to agree on two things,
|
|
8
|
+
* and both matter here because `@vttforge/testing` declares the same ones.
|
|
10
9
|
*
|
|
11
|
-
*
|
|
12
|
-
* and
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
10
|
+
* `var`, not `const`. `const` is block-scoped, so a second one is a
|
|
11
|
+
* redeclaration and `tsc` stops with TS2451.
|
|
12
|
+
*
|
|
13
|
+
* The same type, from the same package. Two structurally identical interfaces
|
|
14
|
+
* are still two types, and `tsc` stops with TS2403 saying a variable "must be
|
|
15
|
+
* of type 'FoundryNamespace', but here has type 'FoundryNamespace'", which
|
|
16
|
+
* reads like a riddle. So `FoundryNamespace` is imported rather than written
|
|
17
|
+
* out here.
|
|
18
|
+
*
|
|
19
|
+
* Reaching a member it does not describe is a cast. Write the cast rather than
|
|
20
|
+
* widening the global to `any`: a typo in a namespaced path only shows up at
|
|
21
|
+
* runtime, in front of a player.
|
|
17
22
|
*/
|
|
18
23
|
import type {
|
|
19
24
|
ChatMessageConstructor,
|
|
20
25
|
FoundryConfig,
|
|
21
26
|
FoundryConstants,
|
|
27
|
+
FoundryNamespace,
|
|
22
28
|
Game,
|
|
23
29
|
HooksApi,
|
|
24
30
|
RollConstructor,
|
|
25
31
|
UiApi,
|
|
26
32
|
} from '@vttforge/types';
|
|
27
33
|
|
|
28
|
-
interface TextEditorImplementation {
|
|
29
|
-
enrichHTML(content: string, options?: Record<string, unknown>): Promise<string>;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
interface FoundryNamespace {
|
|
33
|
-
readonly applications: {
|
|
34
|
-
readonly api: {
|
|
35
|
-
readonly DialogV2: {
|
|
36
|
-
confirm(options: Record<string, unknown>): Promise<boolean>;
|
|
37
|
-
};
|
|
38
|
-
};
|
|
39
|
-
readonly handlebars: {
|
|
40
|
-
renderTemplate(path: string, context: unknown): Promise<string>;
|
|
41
|
-
};
|
|
42
|
-
readonly ux: {
|
|
43
|
-
readonly TextEditor: { readonly implementation: TextEditorImplementation };
|
|
44
|
-
};
|
|
45
|
-
};
|
|
46
|
-
readonly utils: {
|
|
47
|
-
mergeObject<T>(original: T, other?: object, options?: object): T;
|
|
48
|
-
randomID(length?: number): string;
|
|
49
|
-
};
|
|
50
|
-
}
|
|
51
|
-
|
|
52
34
|
declare global {
|
|
53
35
|
var game: Game;
|
|
54
36
|
var CONFIG: FoundryConfig;
|
|
@@ -4,51 +4,33 @@
|
|
|
4
4
|
* An ambient declaration, so it lives in a `.d.ts` and `include` picks it up.
|
|
5
5
|
* Nothing imports it.
|
|
6
6
|
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
* declaration `@vttforge/testing` ships, and `tsc` stops with TS2451.
|
|
7
|
+
* Two `declare global` blocks naming one global have to agree on two things,
|
|
8
|
+
* and both matter here because `@vttforge/testing` declares the same ones.
|
|
10
9
|
*
|
|
11
|
-
*
|
|
12
|
-
* and
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
10
|
+
* `var`, not `const`. `const` is block-scoped, so a second one is a
|
|
11
|
+
* redeclaration and `tsc` stops with TS2451.
|
|
12
|
+
*
|
|
13
|
+
* The same type, from the same package. Two structurally identical interfaces
|
|
14
|
+
* are still two types, and `tsc` stops with TS2403 saying a variable "must be
|
|
15
|
+
* of type 'FoundryNamespace', but here has type 'FoundryNamespace'", which
|
|
16
|
+
* reads like a riddle. So `FoundryNamespace` is imported rather than written
|
|
17
|
+
* out here.
|
|
18
|
+
*
|
|
19
|
+
* Reaching a member it does not describe is a cast. Write the cast rather than
|
|
20
|
+
* widening the global to `any`: a typo in a namespaced path only shows up at
|
|
21
|
+
* runtime, in front of a player.
|
|
17
22
|
*/
|
|
18
23
|
import type {
|
|
19
24
|
ChatMessageConstructor,
|
|
20
25
|
FoundryConfig,
|
|
21
26
|
FoundryConstants,
|
|
27
|
+
FoundryNamespace,
|
|
22
28
|
Game,
|
|
23
29
|
HooksApi,
|
|
24
30
|
RollConstructor,
|
|
25
31
|
UiApi,
|
|
26
32
|
} from '@vttforge/types';
|
|
27
33
|
|
|
28
|
-
interface TextEditorImplementation {
|
|
29
|
-
enrichHTML(content: string, options?: Record<string, unknown>): Promise<string>;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
interface FoundryNamespace {
|
|
33
|
-
readonly applications: {
|
|
34
|
-
readonly api: {
|
|
35
|
-
readonly DialogV2: {
|
|
36
|
-
confirm(options: Record<string, unknown>): Promise<boolean>;
|
|
37
|
-
};
|
|
38
|
-
};
|
|
39
|
-
readonly handlebars: {
|
|
40
|
-
renderTemplate(path: string, context: unknown): Promise<string>;
|
|
41
|
-
};
|
|
42
|
-
readonly ux: {
|
|
43
|
-
readonly TextEditor: { readonly implementation: TextEditorImplementation };
|
|
44
|
-
};
|
|
45
|
-
};
|
|
46
|
-
readonly utils: {
|
|
47
|
-
mergeObject<T>(original: T, other?: object, options?: object): T;
|
|
48
|
-
randomID(length?: number): string;
|
|
49
|
-
};
|
|
50
|
-
}
|
|
51
|
-
|
|
52
34
|
declare global {
|
|
53
35
|
var game: Game;
|
|
54
36
|
var CONFIG: FoundryConfig;
|