tw5-typed 0.2.12 → 0.2.14
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 +9 -9
- package/src/Wiki.d.ts +4 -3
- package/src/widget.d.ts +3 -1
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.2.
|
|
5
|
+
"version": "0.2.14",
|
|
6
6
|
"url": "https://github.com/tiddly-gittly/tw5-typed",
|
|
7
7
|
"homepage": "https://github.com/tiddly-gittly/tw5-typed",
|
|
8
8
|
"bugs": {
|
|
@@ -20,10 +20,10 @@
|
|
|
20
20
|
"prepublishOnly": "npx tsc --noEmit"
|
|
21
21
|
},
|
|
22
22
|
"devDependencies": {
|
|
23
|
-
"@types/node": "^18.11.
|
|
24
|
-
"@typescript-eslint/eslint-plugin": "5.
|
|
25
|
-
"@typescript-eslint/parser": "5.
|
|
26
|
-
"eslint": "8.
|
|
23
|
+
"@types/node": "^18.11.12",
|
|
24
|
+
"@typescript-eslint/eslint-plugin": "5.46.0",
|
|
25
|
+
"@typescript-eslint/parser": "5.46.0",
|
|
26
|
+
"eslint": "8.29.0",
|
|
27
27
|
"eslint-config-prettier": "8.5.0",
|
|
28
28
|
"eslint-config-standard": "17.0.0",
|
|
29
29
|
"eslint-config-standard-with-typescript": "23.0.0",
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
"eslint-import-resolver-typescript": "3.5.2",
|
|
32
32
|
"eslint-plugin-html": "7.1.0",
|
|
33
33
|
"eslint-plugin-import": "2.26.0",
|
|
34
|
-
"eslint-plugin-n": "15.
|
|
34
|
+
"eslint-plugin-n": "15.6.0",
|
|
35
35
|
"eslint-plugin-node": "11.1.0",
|
|
36
36
|
"eslint-plugin-prettier": "4.2.1",
|
|
37
37
|
"eslint-plugin-promise": "6.1.1",
|
|
@@ -40,8 +40,8 @@
|
|
|
40
40
|
"eslint-plugin-security": "1.5.0",
|
|
41
41
|
"eslint-plugin-security-node": "1.1.1",
|
|
42
42
|
"eslint-plugin-typescript-sort-keys": "2.1.0",
|
|
43
|
-
"eslint-plugin-unicorn": "45.0.
|
|
44
|
-
"prettier": "2.8.
|
|
45
|
-
"typescript": "4.9.
|
|
43
|
+
"eslint-plugin-unicorn": "45.0.1",
|
|
44
|
+
"prettier": "2.8.1",
|
|
45
|
+
"typescript": "4.9.4"
|
|
46
46
|
}
|
|
47
47
|
}
|
package/src/Wiki.d.ts
CHANGED
|
@@ -12,6 +12,7 @@ declare module 'tiddlywiki' {
|
|
|
12
12
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
13
13
|
variables?: Record<string, any>;
|
|
14
14
|
}
|
|
15
|
+
export type ITiddlerFieldsParam = Omit<Partial<ITiddlerFields>, 'created' | 'modified'> & { created?: string; modified?: string };
|
|
15
16
|
export class Wiki {
|
|
16
17
|
/**
|
|
17
18
|
* Wiki constructor. State is stored in private members that only a small number of privileged accessor methods have direct access. Methods added via the prototype have to use these accessors and cannot access the state data directly.
|
|
@@ -63,16 +64,16 @@ declare module 'tiddlywiki' {
|
|
|
63
64
|
* Set JSON tiddler, Object in data field will be JSON.stringify and put into the text.
|
|
64
65
|
* This will make tiddler to be JSON data tiddler `"type":"application/json"`, so if you just want to modify existed tiddler's data, use `addTiddler` instead.
|
|
65
66
|
*/
|
|
66
|
-
setTiddlerData: (title: string, data?: object, fields?:
|
|
67
|
+
setTiddlerData: (title: string, data?: object, fields?: ITiddlerFieldsParam, options?: any) => void;
|
|
67
68
|
/**
|
|
68
69
|
* Create or update tiddler.
|
|
69
70
|
* Update existed tiddler based on the title field.
|
|
70
71
|
*/
|
|
71
|
-
addTiddler: (tiddler: Tiddler | Partial<ITiddlerFields>) => void;
|
|
72
|
+
addTiddler: (tiddler: Tiddler | Partial<ITiddlerFieldsParam> | Partial<ITiddlerFields>) => void;
|
|
72
73
|
/**
|
|
73
74
|
* Call `addTiddler` for each iton of the list, but should passing `tiddler.fields`, directly passing tiddler object may failed to add in some cases.
|
|
74
75
|
*/
|
|
75
|
-
addTiddlers: (tiddler: Array<Partial<ITiddlerFields>>) => void;
|
|
76
|
+
addTiddlers: (tiddler: Array<Partial<ITiddlerFieldsParam>| Partial<ITiddlerFields>>) => void;
|
|
76
77
|
/**
|
|
77
78
|
* Get tiddler's text field, with an optional default text.
|
|
78
79
|
* If have _is_skinny field, will just return null (this is a rare case, so not put in the return type for now).
|
package/src/widget.d.ts
CHANGED
|
@@ -4,8 +4,10 @@ declare module 'tiddlywiki' {
|
|
|
4
4
|
* Key is tiddler title
|
|
5
5
|
*/
|
|
6
6
|
export type IChangedTiddlers = Record<string, IChangedTiddlersMeta>;
|
|
7
|
+
/** Only one of these fields will be `true` */
|
|
7
8
|
export interface IChangedTiddlersMeta {
|
|
8
|
-
|
|
9
|
+
deleted?: boolean;
|
|
10
|
+
modified?: boolean;
|
|
9
11
|
}
|
|
10
12
|
|
|
11
13
|
export interface IWidgetEvent {
|