tw5-typed 0.6.8 → 0.7.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/package.json +23 -21
- package/src/modules/filters/index.d.ts +2 -2
- package/src/modules/server/index.d.ts +1 -1
- package/src/modules/utils/dom/dom.d.ts +4 -4
- package/src/modules/utils/dom/modal.d.ts +1 -1
- package/src/modules/utils/filesystem.d.ts +1 -1
- package/src/modules/utils/index.d.ts +1 -3
- package/src/utils/index.d.ts +2 -2
- package/src/wiki/index.d.ts +301 -15
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "tw5-typed",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.7.0",
|
|
4
4
|
"scripts": {
|
|
5
5
|
"check": "tsc --noEmit && eslint src/**/*.ts",
|
|
6
6
|
"docs": "docs-ts",
|
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
"docs:generate": "npm run docs:generate:api && npm run docs:generate:copy",
|
|
10
10
|
"docs:generate:api": "rimraf docs/api && typedoc --options typedoc.json",
|
|
11
11
|
"docs:generate:copy": "zx scripts/copy-readme.mjs",
|
|
12
|
+
"update": "npm-check-updates -u && dprint config update",
|
|
12
13
|
"prepublishOnly": "tsc --noEmit"
|
|
13
14
|
},
|
|
14
15
|
"description": "Types for tiddlywiki",
|
|
@@ -47,30 +48,31 @@
|
|
|
47
48
|
]
|
|
48
49
|
},
|
|
49
50
|
"dependencies": {
|
|
50
|
-
"@types/codemirror": "^5.60.
|
|
51
|
-
"@types/echarts": "^
|
|
52
|
-
"@types/node": "^
|
|
51
|
+
"@types/codemirror": "^5.60.17",
|
|
52
|
+
"@types/echarts": "^5.0.0",
|
|
53
|
+
"@types/node": "^24.10.1"
|
|
53
54
|
},
|
|
54
55
|
"devDependencies": {
|
|
55
|
-
"@docusaurus/core": "^3.
|
|
56
|
-
"@docusaurus/preset-classic": "^3.
|
|
57
|
-
"@docusaurus/types": "^3.
|
|
58
|
-
"@mdx-js/react": "^3.
|
|
56
|
+
"@docusaurus/core": "^3.9.2",
|
|
57
|
+
"@docusaurus/preset-classic": "^3.9.2",
|
|
58
|
+
"@docusaurus/types": "^3.9.2",
|
|
59
|
+
"@mdx-js/react": "^3.1.1",
|
|
59
60
|
"@modern-js/eslint-config": "latest",
|
|
60
61
|
"@modern-js/tsconfig": "latest",
|
|
61
62
|
"docs-ts": "^0.8.0",
|
|
62
|
-
"dprint": "^0.
|
|
63
|
-
"eslint-config-tidgi": "^
|
|
64
|
-
"husky": "^9.
|
|
65
|
-
"lint-staged": "^
|
|
66
|
-
"
|
|
67
|
-
"react": "^
|
|
68
|
-
"
|
|
69
|
-
"
|
|
70
|
-
"
|
|
71
|
-
"
|
|
72
|
-
"typedoc
|
|
73
|
-
"
|
|
74
|
-
"
|
|
63
|
+
"dprint": "^0.50.2",
|
|
64
|
+
"eslint-config-tidgi": "^2.2.0",
|
|
65
|
+
"husky": "^9.1.7",
|
|
66
|
+
"lint-staged": "^16.2.6",
|
|
67
|
+
"npm-check-updates": "^19.1.2",
|
|
68
|
+
"prism-react-renderer": "^2.4.1",
|
|
69
|
+
"react": "^19.2.0",
|
|
70
|
+
"rimraf": "^6.1.0",
|
|
71
|
+
"tiddlywiki": "^5.3.8",
|
|
72
|
+
"type-fest": "^5.2.0",
|
|
73
|
+
"typedoc": "^0.28.14",
|
|
74
|
+
"typedoc-plugin-markdown": "^4.9.0",
|
|
75
|
+
"typescript": "^5.9.3",
|
|
76
|
+
"zx": "^8.8.5"
|
|
75
77
|
}
|
|
76
78
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
declare module 'tiddlywiki' {
|
|
2
2
|
/**
|
|
3
3
|
* # Usage
|
|
4
|
-
*
|
|
4
|
+
*
|
|
5
5
|
* ```ts
|
|
6
6
|
* const yourFilter: IFilterOperator = (source,operator) => {
|
|
7
7
|
* var results = [];
|
|
@@ -12,7 +12,7 @@ declare module 'tiddlywiki' {
|
|
|
12
12
|
* return results;
|
|
13
13
|
* }
|
|
14
14
|
* ```
|
|
15
|
-
*
|
|
15
|
+
*
|
|
16
16
|
* # Overview
|
|
17
17
|
|
|
18
18
|
Filter operators are modules (tiddlers of type `application/javascript`) with their `module-type` field set to `filteroperator`, exporting one or more functions implementing a filter.
|
|
@@ -201,10 +201,10 @@ declare module '$:/core/modules/utils/dom.js' {
|
|
|
201
201
|
*/
|
|
202
202
|
export function copyToClipboard(
|
|
203
203
|
text: string,
|
|
204
|
-
options?: {
|
|
205
|
-
doNotNotify?: boolean
|
|
206
|
-
successNotification?: string
|
|
207
|
-
failureNotification?: string
|
|
204
|
+
options?: {
|
|
205
|
+
doNotNotify?: boolean;
|
|
206
|
+
successNotification?: string; // default is $:/language/Notifications/CopiedToClipboard/Succeeded
|
|
207
|
+
failureNotification?: string;
|
|
208
208
|
},
|
|
209
209
|
): boolean;
|
|
210
210
|
|
|
@@ -18,7 +18,7 @@ declare module 'tiddlywiki' {
|
|
|
18
18
|
}
|
|
19
19
|
|
|
20
20
|
declare module '$:/core/modules/utils/filesystem.js' {
|
|
21
|
-
import type { Tiddler, Wiki
|
|
21
|
+
import type { FileInfo, Tiddler, Wiki } from 'tiddlywiki';
|
|
22
22
|
|
|
23
23
|
/**
|
|
24
24
|
* Return the subdirectories of a path
|
|
@@ -21,7 +21,6 @@ declare module 'tiddlywiki' {
|
|
|
21
21
|
import * as LinkedList from '$:/core/modules/utils/linked-list.js';
|
|
22
22
|
import * as performance from '$:/core/modules/utils/performance.js';
|
|
23
23
|
// import the class directly, to fix: Property 'log' does not exist on type 'typeof Logger'.ts(2339)
|
|
24
|
-
import * as parsetree from '$:/core/modules/utils/parsetree.js';
|
|
25
24
|
import * as parseutils from '$:/core/modules/utils/parseutils.js';
|
|
26
25
|
import * as pluginMaker from '$:/core/modules/utils/pluginmaker.js';
|
|
27
26
|
import * as transliterate from '$:/core/modules/utils/transliterate.js';
|
|
@@ -30,14 +29,13 @@ declare module 'tiddlywiki' {
|
|
|
30
29
|
import * as editionInfo from '$:/core/modules/utils/edition-info.js';
|
|
31
30
|
import * as escapecss from '$:/core/modules/utils/escapecss.js';
|
|
32
31
|
|
|
33
|
-
type
|
|
32
|
+
type IUtilitiesModules =
|
|
34
33
|
& Pick<typeof dom, keyof typeof dom>
|
|
35
34
|
& Pick<typeof logger, keyof typeof logger>
|
|
36
35
|
& Pick<typeof filesystem, keyof typeof filesystem>
|
|
37
36
|
& Pick<typeof utils, keyof typeof utils>
|
|
38
37
|
& Pick<typeof LinkedList, keyof typeof LinkedList>
|
|
39
38
|
& Pick<typeof performance, keyof typeof performance>
|
|
40
|
-
& Pick<typeof parsetree, keyof typeof parsetree>
|
|
41
39
|
& Pick<typeof parseutils, keyof typeof parseutils>
|
|
42
40
|
& Pick<typeof pluginMaker, keyof typeof pluginMaker>
|
|
43
41
|
& Pick<typeof transliterate, keyof typeof transliterate>
|
package/src/utils/index.d.ts
CHANGED
|
@@ -106,7 +106,7 @@ declare module 'tiddlywiki' {
|
|
|
106
106
|
text?: string;
|
|
107
107
|
}
|
|
108
108
|
|
|
109
|
-
interface
|
|
109
|
+
interface IUtilitiesBoot {
|
|
110
110
|
Crypto: typeof Crypto;
|
|
111
111
|
PasswordPrompt: typeof PasswordPrompt;
|
|
112
112
|
|
|
@@ -458,5 +458,5 @@ declare module 'tiddlywiki' {
|
|
|
458
458
|
transliterationPairs: Record<string, string>;
|
|
459
459
|
}
|
|
460
460
|
|
|
461
|
-
export type IUtils =
|
|
461
|
+
export type IUtils = IUtilitiesBoot & IUtilsModules;
|
|
462
462
|
}
|
package/src/wiki/index.d.ts
CHANGED
|
@@ -16,14 +16,18 @@ declare module 'tiddlywiki' {
|
|
|
16
16
|
| 'text/html'
|
|
17
17
|
| 'text/vnd.tiddlywiki'
|
|
18
18
|
| 'text/plain';
|
|
19
|
-
export type ITiddlerFieldsParam =
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
19
|
+
export type ITiddlerFieldsParam =
|
|
20
|
+
& Omit<
|
|
21
|
+
Partial<ITiddlerFields>,
|
|
22
|
+
'created' | 'modified'
|
|
23
|
+
>
|
|
24
|
+
& { created?: string; modified?: string };
|
|
25
|
+
export type ITiddlerJSONResult =
|
|
26
|
+
& Omit<
|
|
27
|
+
Partial<ITiddlerFieldsParam>,
|
|
28
|
+
'list' | 'tags'
|
|
29
|
+
>
|
|
30
|
+
& { list?: string; tags?: string };
|
|
27
31
|
export class Wiki {
|
|
28
32
|
/**
|
|
29
33
|
* 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.
|
|
@@ -47,12 +51,104 @@ declare module 'tiddlywiki' {
|
|
|
47
51
|
getTiddlersAsJson(filter: string, spaces?: string): string;
|
|
48
52
|
/**
|
|
49
53
|
* Get JSON string of tiddler. Note that this will make lists like tags/list to be string, instead of array. And result is a string, not an object.
|
|
50
|
-
* @param title
|
|
54
|
+
* @param title
|
|
51
55
|
* @returns a stringified JSON with type ITiddlerJSONResult. You will need to use `JSON.parse` on it.
|
|
52
56
|
*/
|
|
53
57
|
getTiddlerAsJson(title: string): string;
|
|
54
58
|
deleteTiddler(title: string): void;
|
|
55
59
|
each(callback: (tiddler: Tiddler, title: string) => void): void;
|
|
60
|
+
/**
|
|
61
|
+
* For every tiddler invoke a callback(title,tiddler) with `this` set to the wiki object.
|
|
62
|
+
* @param options Options include sortField, excludeTag, includeSystem
|
|
63
|
+
* @param callback Function to be called for each tiddler
|
|
64
|
+
*/
|
|
65
|
+
forEachTiddler(options: { sortField?: string; excludeTag?: string; includeSystem?: boolean }, callback: (title: string, tiddler: Tiddler) => void): void;
|
|
66
|
+
forEachTiddler(callback: (title: string, tiddler: Tiddler) => void): void;
|
|
67
|
+
/**
|
|
68
|
+
* Sort an array of tiddler titles by a specified field
|
|
69
|
+
* @param titles Array of titles (sorted in place)
|
|
70
|
+
* @param sortField Name of field to sort by
|
|
71
|
+
* @param isDescending True if the sort should be descending
|
|
72
|
+
* @param isCaseSensitive True if the sort should consider upper and lower case letters to be different
|
|
73
|
+
* @param isNumeric True if the sort should be numeric
|
|
74
|
+
* @param isAlphaNumeric True if the sort should be alphanumeric
|
|
75
|
+
*/
|
|
76
|
+
sortTiddlers(titles: string[], sortField: string, isDescending?: boolean, isCaseSensitive?: boolean, isNumeric?: boolean, isAlphaNumeric?: boolean): void;
|
|
77
|
+
/**
|
|
78
|
+
* Return an array of tiddler titles that match a search string
|
|
79
|
+
* @param text The text string to search for
|
|
80
|
+
* @param options Search options
|
|
81
|
+
*/
|
|
82
|
+
search(text: string, options?: {
|
|
83
|
+
/** An iterator function for the source tiddlers */
|
|
84
|
+
source?: (callback: (tiddler: Tiddler, title: string) => void) => void;
|
|
85
|
+
/** An array of tiddler titles to exclude from the search */
|
|
86
|
+
exclude?: string[];
|
|
87
|
+
/** If true returns tiddlers that do not contain the specified string */
|
|
88
|
+
invert?: boolean;
|
|
89
|
+
/** If true forces a case sensitive search */
|
|
90
|
+
caseSensitive?: boolean;
|
|
91
|
+
/** If specified, restricts the search to the specified field, or an array of field names */
|
|
92
|
+
field?: string | string[];
|
|
93
|
+
/** If true, forces all but regexp searches to be anchored to the start of text */
|
|
94
|
+
anchored?: boolean;
|
|
95
|
+
/** If true, the field options are inverted to specify the fields that are not to be searched */
|
|
96
|
+
excludeField?: boolean;
|
|
97
|
+
/** Searches for literal string */
|
|
98
|
+
literal?: boolean;
|
|
99
|
+
/** Same as literal except runs of whitespace are treated as a single space */
|
|
100
|
+
whitespace?: boolean;
|
|
101
|
+
/** Treats the search term as a regular expression */
|
|
102
|
+
regexp?: boolean;
|
|
103
|
+
/** Treats search string as a list of tokens, and matches if all tokens are found */
|
|
104
|
+
words?: boolean;
|
|
105
|
+
/** Treats search string as a list of tokens, and matches if at least ONE token is found */
|
|
106
|
+
some?: boolean;
|
|
107
|
+
}): string[];
|
|
108
|
+
/**
|
|
109
|
+
* Check whether the text of a tiddler matches a given value
|
|
110
|
+
* @param title Tiddler title
|
|
111
|
+
* @param targetText Text to compare with
|
|
112
|
+
* @param options Comparison options
|
|
113
|
+
*/
|
|
114
|
+
checkTiddlerText(title: string, targetText: string, options?: { noTrim?: boolean; caseSensitive?: boolean }): boolean;
|
|
115
|
+
/**
|
|
116
|
+
* Return the content of a tiddler as an array containing each line
|
|
117
|
+
* @param title Title of the tiddler
|
|
118
|
+
* @param field Field name (defaults to "list")
|
|
119
|
+
* @param index Data index (key) to get, if you are getting a JSON data tiddler
|
|
120
|
+
* @returns Array of strings parsed from the field/index value
|
|
121
|
+
*/
|
|
122
|
+
getTiddlerList(title: string, field?: string, index?: string): string[];
|
|
123
|
+
/**
|
|
124
|
+
* Get the value of a text reference. Text references can have any of these forms:
|
|
125
|
+
* - <tiddlertitle>
|
|
126
|
+
* - <tiddlertitle>!!<fieldname>
|
|
127
|
+
* - !!<fieldname> - specifies a field of the current tiddlers
|
|
128
|
+
* - <tiddlertitle>##<index>
|
|
129
|
+
* @param textRef The text reference string
|
|
130
|
+
* @param defaultText Default text to return if the reference is not found
|
|
131
|
+
* @param currTiddlerTitle Current tiddler title for relative references
|
|
132
|
+
*/
|
|
133
|
+
getTextReference(textReference: string, defaultText?: string, currentTiddlerTitle?: string): string | undefined;
|
|
134
|
+
/**
|
|
135
|
+
* Set the value of a text reference
|
|
136
|
+
* @param textRef The text reference string
|
|
137
|
+
* @param value The value to set
|
|
138
|
+
* @param currTiddlerTitle Current tiddler title for relative references
|
|
139
|
+
*/
|
|
140
|
+
setTextReference(textReference: string, value: string, currentTiddlerTitle?: string): void;
|
|
141
|
+
/**
|
|
142
|
+
* Delete a text reference
|
|
143
|
+
* @param textRef The text reference string
|
|
144
|
+
* @param currTiddlerTitle Current tiddler title for relative references
|
|
145
|
+
*/
|
|
146
|
+
deleteTextReference(textReference: string, currentTiddlerTitle?: string): void;
|
|
147
|
+
/**
|
|
148
|
+
* Count the number of tiddlers in the wiki
|
|
149
|
+
* @param excludeTag Optional tag to exclude from the count
|
|
150
|
+
*/
|
|
151
|
+
countTiddlers(excludeTag?: string): number;
|
|
56
152
|
/**
|
|
57
153
|
* Return a named global cache object. Global cache objects are cleared whenever a tiddler change.
|
|
58
154
|
* You can put anything into the cache.
|
|
@@ -74,6 +170,11 @@ declare module 'tiddlywiki' {
|
|
|
74
170
|
* clear all cache, will be called when a tiddler is changed
|
|
75
171
|
*/
|
|
76
172
|
clearGlobalCache(): void;
|
|
173
|
+
/**
|
|
174
|
+
* Clear all caches associated with a particular tiddler, or if the title is null, clear all caches for all tiddlers
|
|
175
|
+
* @param title Tiddler title or null to clear all caches
|
|
176
|
+
*/
|
|
177
|
+
clearCache(title?: string | null): void;
|
|
77
178
|
/**
|
|
78
179
|
* Compile filter string to be a function that execute the filter in the wiki.
|
|
79
180
|
* You can pass an optional iterator that provide the input to the returned function. If no iterator is provided, filter will use first operator to get input.
|
|
@@ -89,7 +190,6 @@ declare module 'tiddlywiki' {
|
|
|
89
190
|
widget?: Widget,
|
|
90
191
|
) => string[];
|
|
91
192
|
/**
|
|
92
|
-
*
|
|
93
193
|
* @param filterString
|
|
94
194
|
* @param widget an optional widget node for retrieving the current tiddler etc.
|
|
95
195
|
* @param source an iterator function for the source tiddlers, called source(iterator), where iterator is called as iterator(tiddler,title)
|
|
@@ -227,7 +327,7 @@ declare module 'tiddlywiki' {
|
|
|
227
327
|
deserializeTiddlers(
|
|
228
328
|
type: string,
|
|
229
329
|
text: string,
|
|
230
|
-
|
|
330
|
+
sourceFields?: ITiddlerFieldsParam,
|
|
231
331
|
options?: IParseOptions,
|
|
232
332
|
): ITiddlerFieldsParam[];
|
|
233
333
|
/**
|
|
@@ -318,6 +418,33 @@ declare module 'tiddlywiki' {
|
|
|
318
418
|
getShadowSource(title: string): string | null;
|
|
319
419
|
getTiddlerBacklinks(targetTitle: string): string[];
|
|
320
420
|
getTiddlerLinks(title: string): string[];
|
|
421
|
+
/**
|
|
422
|
+
* Return an array of tiddler titles that are directly linked within the given parse tree
|
|
423
|
+
* @param parseTreeRoot The parse tree root node
|
|
424
|
+
*/
|
|
425
|
+
extractLinks(parseTreeRoot: IParseTreeNode[]): string[];
|
|
426
|
+
/**
|
|
427
|
+
* Return an array of tiddler titles that are directly transcluded within the given parse tree
|
|
428
|
+
* @param parseTreeRoot The parse tree root node
|
|
429
|
+
* @param title The tiddler being parsed (to ignore self-referential transclusions)
|
|
430
|
+
*/
|
|
431
|
+
extractTranscludes(parseTreeRoot: IParseTreeNode[], title?: string): string[];
|
|
432
|
+
/**
|
|
433
|
+
* Return an array of tiddler titles that are transcluded from the specified tiddler
|
|
434
|
+
* @param title Tiddler title
|
|
435
|
+
*/
|
|
436
|
+
getTiddlerTranscludes(title: string): string[];
|
|
437
|
+
/**
|
|
438
|
+
* Return an array of tiddler titles that transclude to the specified tiddler
|
|
439
|
+
* @param targetTitle Target tiddler title
|
|
440
|
+
*/
|
|
441
|
+
getTiddlerBacktranscludes(targetTitle: string): string[];
|
|
442
|
+
/**
|
|
443
|
+
* Lookup a given tiddler and return a list of all the tiddlers that include it in the specified list field
|
|
444
|
+
* @param targetTitle Target tiddler title
|
|
445
|
+
* @param fieldName Field name (defaults to "list")
|
|
446
|
+
*/
|
|
447
|
+
findListingsOfTiddler(targetTitle: string, fieldName?: string): string[];
|
|
321
448
|
getPluginInfo(title: string): { tiddlers: Record<string, ITiddlerFields> };
|
|
322
449
|
getChangeCount(title: string): number;
|
|
323
450
|
/**
|
|
@@ -325,6 +452,165 @@ declare module 'tiddlywiki' {
|
|
|
325
452
|
options.prefix must be a string
|
|
326
453
|
*/
|
|
327
454
|
generateNewTitle(baseTitle: string, options: { prefix?: string }): string;
|
|
455
|
+
/**
|
|
456
|
+
* Get a subtiddler from a plugin or data tiddler
|
|
457
|
+
* @param title Title of the plugin or data tiddler
|
|
458
|
+
* @param subTiddlerTitle Title of the subtiddler within the bundle
|
|
459
|
+
*/
|
|
460
|
+
getSubTiddler(title: string, subTiddlerTitle: string): Tiddler | null;
|
|
461
|
+
/**
|
|
462
|
+
* Return a hashmap of tiddler titles that are referenced but not defined
|
|
463
|
+
*/
|
|
464
|
+
getMissingTitles(): string[];
|
|
465
|
+
/**
|
|
466
|
+
* Return an array of tiddler titles that are not linked from any other tiddler
|
|
467
|
+
*/
|
|
468
|
+
getOrphanTitles(): string[];
|
|
469
|
+
/**
|
|
470
|
+
* Sorts an array of tiddler titles according to an ordered list
|
|
471
|
+
* @param array Array of tiddler titles to sort
|
|
472
|
+
* @param listTitle Title of tiddler containing the ordered list
|
|
473
|
+
*/
|
|
474
|
+
sortByList(array: string[], listTitle: string): string[];
|
|
475
|
+
/**
|
|
476
|
+
* Get a hashmap by tag of arrays of tiddler titles
|
|
477
|
+
*/
|
|
478
|
+
getTagMap(): Record<string, string[]>;
|
|
479
|
+
/**
|
|
480
|
+
* Find any existing draft of a specified tiddler
|
|
481
|
+
* @param targetTitle Title of the target tiddler
|
|
482
|
+
*/
|
|
483
|
+
findDraft(targetTitle: string): string | undefined;
|
|
484
|
+
/**
|
|
485
|
+
* Check whether the specified draft tiddler has been modified
|
|
486
|
+
* @param title Title of the draft tiddler
|
|
487
|
+
*/
|
|
488
|
+
isDraftModified(title: string): boolean;
|
|
489
|
+
/**
|
|
490
|
+
* Add a new tiddler to the story river
|
|
491
|
+
* @param title A title string or an array of title strings
|
|
492
|
+
* @param fromTitle The title of the tiddler from which the navigation originated
|
|
493
|
+
* @param storyTitle Title of story tiddler (defaults to $:/StoryList)
|
|
494
|
+
* @param options Additional options
|
|
495
|
+
* @deprecated Use story.addToStory() from the story object instead
|
|
496
|
+
*/
|
|
497
|
+
addToStory(title: string | string[], fromTitle?: string, storyTitle?: string, options?: any): void;
|
|
498
|
+
/**
|
|
499
|
+
* Add a new record to the top of the history stack
|
|
500
|
+
* @param title A title string or an array of title strings
|
|
501
|
+
* @param fromPageRect Page coordinates of the origin of the navigation
|
|
502
|
+
* @param historyTitle Title of history tiddler (defaults to $:/HistoryList)
|
|
503
|
+
* @deprecated Use story.addToHistory() from the story object instead
|
|
504
|
+
*/
|
|
505
|
+
addToHistory(title: string | string[], fromPageRect?: any, historyTitle?: string): void;
|
|
506
|
+
/**
|
|
507
|
+
* Generate a draft title for a given tiddler
|
|
508
|
+
* @param title Title of the tiddler to create a draft for
|
|
509
|
+
*/
|
|
510
|
+
generateDraftTitle(title: string): string;
|
|
511
|
+
/**
|
|
512
|
+
* Convert a title to a URL-friendly slug
|
|
513
|
+
* @param title Title to slugify
|
|
514
|
+
* @param options Options (currently unused)
|
|
515
|
+
*/
|
|
516
|
+
slugify(title: string, options?: any): string;
|
|
517
|
+
/**
|
|
518
|
+
* Invoke the available upgrader modules
|
|
519
|
+
* @param titles Array of tiddler titles to be processed
|
|
520
|
+
* @param tiddlers Hashmap by title of tiddler fields of pending import tiddlers
|
|
521
|
+
*/
|
|
522
|
+
invokeUpgraders(titles: string[], tiddlers: Record<string, ITiddlerFields>): Record<string, string>;
|
|
523
|
+
/**
|
|
524
|
+
* Determine whether a plugin by title is dynamically loadable
|
|
525
|
+
* @param title Plugin title
|
|
526
|
+
*/
|
|
527
|
+
doesPluginRequireReload(title: string): boolean;
|
|
528
|
+
/**
|
|
529
|
+
* Determine whether a plugin info structure is dynamically loadable
|
|
530
|
+
* @param pluginInfo Plugin info object
|
|
531
|
+
*/
|
|
532
|
+
doesPluginInfoRequireReload(pluginInfo: any): boolean | null;
|
|
533
|
+
/**
|
|
534
|
+
* Execute an action string without an associated context widget
|
|
535
|
+
* @param actions Action string to execute
|
|
536
|
+
* @param event Event object
|
|
537
|
+
* @param variables Variables hashmap
|
|
538
|
+
* @param options Options including parentWidget
|
|
539
|
+
*/
|
|
540
|
+
invokeActionString(actions: string, event?: any, variables?: Record<string, string>, options?: { parentWidget?: Widget }): void;
|
|
541
|
+
/**
|
|
542
|
+
* Read an array of browser File objects
|
|
543
|
+
* @param files Array of File objects
|
|
544
|
+
* @param options Options or callback function
|
|
545
|
+
*/
|
|
546
|
+
readFiles(files: File[], options?: { callback?: (tiddlerFieldsArray: ITiddlerFields[]) => void } | ((tiddlerFieldsArray: ITiddlerFields[]) => void)): number;
|
|
547
|
+
/**
|
|
548
|
+
* Read a browser File object
|
|
549
|
+
* @param file File object
|
|
550
|
+
* @param options Options or callback function
|
|
551
|
+
*/
|
|
552
|
+
readFile(file: File, options?: { callback?: (tiddlerFieldsArray: ITiddlerFields[]) => void; deserializer?: string } | ((tiddlerFieldsArray: ITiddlerFields[]) => void)): void;
|
|
553
|
+
/**
|
|
554
|
+
* Lower level utility to read the content of a browser File object
|
|
555
|
+
* @param file File object
|
|
556
|
+
* @param type MIME type
|
|
557
|
+
* @param isBinary Whether the file is binary
|
|
558
|
+
* @param deserializer Deserializer name
|
|
559
|
+
* @param callback Callback function
|
|
560
|
+
*/
|
|
561
|
+
readFileContent(file: File, type: string, isBinary: boolean, deserializer: string | undefined, callback: (tiddlerFieldsArray: ITiddlerFields[]) => void): void;
|
|
562
|
+
/**
|
|
563
|
+
* Get substituted text with variable and filter replacements
|
|
564
|
+
* @param text Text to perform substitutions on
|
|
565
|
+
* @param widget Widget for context
|
|
566
|
+
* @param options Options including substitutions array
|
|
567
|
+
*/
|
|
568
|
+
getSubstitutedText(text: string, widget: Widget, options?: { substitutions?: Array<{ name: string; value: string }> }): string;
|
|
569
|
+
/**
|
|
570
|
+
* Parse a text reference and get parser info
|
|
571
|
+
* @param title Title of tiddler
|
|
572
|
+
* @param field Field name
|
|
573
|
+
* @param index Index name
|
|
574
|
+
* @param options Options including subTiddler and defaultType
|
|
575
|
+
*/
|
|
576
|
+
getTextReferenceParserInfo(
|
|
577
|
+
title: string,
|
|
578
|
+
field?: string,
|
|
579
|
+
index?: string,
|
|
580
|
+
options?: { subTiddler?: string; defaultType?: string },
|
|
581
|
+
): { parserType: string | null; sourceText: string | null };
|
|
582
|
+
/**
|
|
583
|
+
* Parse a text reference
|
|
584
|
+
* @param title Title of tiddler
|
|
585
|
+
* @param field Field name
|
|
586
|
+
* @param index Index name
|
|
587
|
+
* @param options Parse options
|
|
588
|
+
*/
|
|
589
|
+
parseTextReference(title: string, field?: string, index?: string, options?: IParseOptions): WikiParser | null;
|
|
590
|
+
/**
|
|
591
|
+
* Get the size of tiddler event queue
|
|
592
|
+
*/
|
|
593
|
+
getSizeOfTiddlerEventQueue(): number;
|
|
594
|
+
/**
|
|
595
|
+
* Clear the tiddler event queue
|
|
596
|
+
*/
|
|
597
|
+
clearTiddlerEventQueue(): void;
|
|
598
|
+
/**
|
|
599
|
+
* Enqueue a tiddler event (internal method)
|
|
600
|
+
* @param title Tiddler title
|
|
601
|
+
* @param isDeleted Whether the tiddler was deleted
|
|
602
|
+
* @param isShadow Whether this is a shadow tiddler change
|
|
603
|
+
*/
|
|
604
|
+
enqueueTiddlerEvent(title: string, isDeleted?: boolean, isShadow?: boolean): void;
|
|
605
|
+
/**
|
|
606
|
+
* Initialize parsers (internal method)
|
|
607
|
+
* @param moduleType Module type
|
|
608
|
+
*/
|
|
609
|
+
initParsers(moduleType?: string): void;
|
|
610
|
+
/**
|
|
611
|
+
* Add indexers to this wiki (internal method)
|
|
612
|
+
*/
|
|
613
|
+
addIndexersToWiki(): void;
|
|
328
614
|
|
|
329
615
|
removeEventListener(
|
|
330
616
|
type: string,
|
|
@@ -336,11 +622,11 @@ declare module 'tiddlywiki' {
|
|
|
336
622
|
handler: (event: unknown) => void | Promise<void>,
|
|
337
623
|
): void;
|
|
338
624
|
addEventListener(
|
|
339
|
-
type:
|
|
625
|
+
type: 'change',
|
|
340
626
|
handler: (change: IChangedTiddlers) => void | Promise<void>,
|
|
341
627
|
): void;
|
|
342
628
|
addEventListener(
|
|
343
|
-
type:
|
|
629
|
+
type: 'lazyLoad',
|
|
344
630
|
handler: (title: string) => void | Promise<void>,
|
|
345
631
|
): void;
|
|
346
632
|
|
|
@@ -349,11 +635,11 @@ declare module 'tiddlywiki' {
|
|
|
349
635
|
dataOrEvent: unknown,
|
|
350
636
|
): void;
|
|
351
637
|
dispatchEvent(
|
|
352
|
-
type:
|
|
638
|
+
type: 'change',
|
|
353
639
|
change: IChangedTiddlers,
|
|
354
640
|
): void;
|
|
355
641
|
dispatchEvent(
|
|
356
|
-
type:
|
|
642
|
+
type: 'lazyLoad',
|
|
357
643
|
title: string,
|
|
358
644
|
): void;
|
|
359
645
|
}
|