tw5-typed 0.4.0 → 0.4.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/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"description": "Types for tiddlywiki",
|
|
3
3
|
"license": "MIT",
|
|
4
4
|
"name": "tw5-typed",
|
|
5
|
-
"version": "0.4.
|
|
5
|
+
"version": "0.4.2",
|
|
6
6
|
"url": "https://github.com/tiddly-gittly/tw5-typed",
|
|
7
7
|
"homepage": "https://github.com/tiddly-gittly/tw5-typed",
|
|
8
8
|
"bugs": {
|
|
@@ -17,7 +17,8 @@
|
|
|
17
17
|
"src/"
|
|
18
18
|
],
|
|
19
19
|
"scripts": {
|
|
20
|
-
"check": "tsc --noEmit && eslint src/**/*.ts"
|
|
20
|
+
"check": "tsc --noEmit && eslint src/**/*.ts",
|
|
21
|
+
"prepublishOnly": "npm run check"
|
|
21
22
|
},
|
|
22
23
|
"husky": {
|
|
23
24
|
"hooks": {
|
|
@@ -2,6 +2,16 @@
|
|
|
2
2
|
/// <reference path="utils.d.ts" />
|
|
3
3
|
/// <reference path="fakedom.d.ts" />
|
|
4
4
|
/// <reference path="filesystem.d.ts" />
|
|
5
|
+
/// <reference path="linked-list.d.ts" />
|
|
6
|
+
/// <reference path="performance.d.ts" />
|
|
7
|
+
/// <reference path="logger.d.ts" />
|
|
8
|
+
/// <reference path="parsetree.d.ts" />
|
|
9
|
+
/// <reference path="pluginmaker.d.ts" />
|
|
10
|
+
/// <reference path="transliterate.d.ts" />
|
|
11
|
+
/// <reference path="crypto.d.ts" />
|
|
12
|
+
/// <reference path="csv.d.ts" />
|
|
13
|
+
/// <reference path="edition-info.d.ts" />
|
|
14
|
+
/// <reference path="escapecss.d.ts" />
|
|
5
15
|
|
|
6
16
|
declare module 'tiddlywiki' {
|
|
7
17
|
// Thanks for GitHub Copilot, you has helped me a lot!
|
|
@@ -10,7 +20,8 @@ declare module 'tiddlywiki' {
|
|
|
10
20
|
import * as filesystem from '$:/core/modules/utils/filesystem.js';
|
|
11
21
|
import * as LinkedList from '$:/core/modules/utils/linked-list.js';
|
|
12
22
|
import * as performance from '$:/core/modules/utils/performance.js';
|
|
13
|
-
import
|
|
23
|
+
// import the class directly, to fix: Property 'log' does not exist on type 'typeof Logger'.ts(2339)
|
|
24
|
+
import { Logger } from '$:/core/modules/utils/logger.js';
|
|
14
25
|
import * as parsetree from '$:/core/modules/utils/parsetree.js';
|
|
15
26
|
import * as pluginMaker from '$:/core/modules/utils/pluginmaker.js';
|
|
16
27
|
import * as transliterate from '$:/core/modules/utils/transliterate.js';
|
|
@@ -24,12 +35,11 @@ declare module 'tiddlywiki' {
|
|
|
24
35
|
Pick<typeof utils, keyof typeof utils> &
|
|
25
36
|
Pick<typeof LinkedList, keyof typeof LinkedList> &
|
|
26
37
|
Pick<typeof performance, keyof typeof performance> &
|
|
27
|
-
Pick<typeof logger, keyof typeof logger> &
|
|
28
38
|
Pick<typeof parsetree, keyof typeof parsetree> &
|
|
29
39
|
Pick<typeof pluginMaker, keyof typeof pluginMaker> &
|
|
30
40
|
Pick<typeof transliterate, keyof typeof transliterate> &
|
|
31
41
|
Pick<typeof crypto, keyof typeof crypto> &
|
|
32
42
|
Pick<typeof csv, keyof typeof csv> &
|
|
33
43
|
Pick<typeof editionInfo, keyof typeof editionInfo> &
|
|
34
|
-
Pick<typeof escapecss, keyof typeof escapecss
|
|
44
|
+
Pick<typeof escapecss, keyof typeof escapecss> & { Logger: Logger };
|
|
35
45
|
}
|
|
@@ -81,4 +81,17 @@ declare module '$:/core/modules/utils/logger.js' {
|
|
|
81
81
|
*/
|
|
82
82
|
clearAlerts(): void;
|
|
83
83
|
}
|
|
84
|
+
// This part is important for TypeScript to understand the constructor signature
|
|
85
|
+
// fixes `Property 'prototype' is missing in type 'Logger' but required in type 'typeof Logger'.ts(2741)`
|
|
86
|
+
export interface Logger {
|
|
87
|
+
new (
|
|
88
|
+
componentName?: string,
|
|
89
|
+
options?: {
|
|
90
|
+
colour?: string;
|
|
91
|
+
enable?: boolean;
|
|
92
|
+
save?: boolean;
|
|
93
|
+
saveLimit?: number;
|
|
94
|
+
}
|
|
95
|
+
): Logger;
|
|
96
|
+
}
|
|
84
97
|
}
|
|
File without changes
|