tw5-typed 0.3.2 → 0.3.3
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
package/src/modules/index.d.ts
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
declare module 'tiddlywiki' {
|
|
2
|
-
|
|
2
|
+
/**
|
|
3
|
+
* SyncAdaptorModules
|
|
4
|
+
* @url https://tiddlywiki.com/dev/#SyncAdaptorModules
|
|
5
|
+
*/
|
|
6
|
+
export interface SyncAdaptor {
|
|
3
7
|
name: string;
|
|
4
8
|
supportsLazyLoading: boolean;
|
|
5
9
|
isReady(): boolean;
|
|
@@ -8,6 +12,29 @@ declare module 'tiddlywiki' {
|
|
|
8
12
|
title: string,
|
|
9
13
|
callback: (error: null, fileInfo: IFileInfo) => void,
|
|
10
14
|
): void;
|
|
15
|
+
/**
|
|
16
|
+
* Retrieves the titles of tiddlers that need to be updated from the server.
|
|
17
|
+
|
|
18
|
+
This method is optional. If an adaptor doesn't implement it then synchronisation will be unidirectional from the TiddlyWiki store to the adaptor, but not the other way.
|
|
19
|
+
|
|
20
|
+
The syncer will use the `getUpdatedTiddlers()` method in preference to the `getSkinnyTiddlers()` method.
|
|
21
|
+
|
|
22
|
+
|!Parameter |!Description |
|
|
23
|
+
|syncer |Reference to the syncer object making the call |
|
|
24
|
+
|callback |Callback function invoked with parameter `err,data` -- see below |
|
|
25
|
+
|
|
26
|
+
The data provided by the callback is as follows:
|
|
27
|
+
|
|
28
|
+
```
|
|
29
|
+
{
|
|
30
|
+
modifications: [<array of title>],
|
|
31
|
+
deletions: [<array of title>],
|
|
32
|
+
}
|
|
33
|
+
```
|
|
34
|
+
* @param syncer
|
|
35
|
+
* @param callback
|
|
36
|
+
*/
|
|
37
|
+
getUpdatedTiddlers(syncer: Syncer,callback: (error: Error | null | undefined, changes: { modifications: string[]; deletions: string[] }) => void): void;
|
|
11
38
|
wiki: Wiki;
|
|
12
39
|
}
|
|
13
40
|
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
declare module 'tiddlywiki' {
|
|
2
|
+
export class Syncer {
|
|
3
|
+
syncadaptor?: SyncAdaptor;
|
|
4
|
+
/**
|
|
5
|
+
Synchronise from the server by reading the skinny tiddler list and queuing up loads for any tiddlers that we don't already have up to date
|
|
6
|
+
*/
|
|
7
|
+
syncFromServer(): void;
|
|
8
|
+
}
|
|
9
|
+
}
|
|
File without changes
|
package/src/wiki/index.d.ts
CHANGED
|
@@ -67,7 +67,10 @@ declare module 'tiddlywiki' {
|
|
|
67
67
|
*/
|
|
68
68
|
compileFilter(
|
|
69
69
|
filterString: string,
|
|
70
|
-
): (
|
|
70
|
+
): (
|
|
71
|
+
source?: SourceIterator | string[] | Record<string, unknown>,
|
|
72
|
+
widget?: Widget,
|
|
73
|
+
) => string[];
|
|
71
74
|
/**
|
|
72
75
|
*
|
|
73
76
|
* @param filterString
|
|
@@ -80,15 +83,15 @@ declare module 'tiddlywiki' {
|
|
|
80
83
|
makeTiddlerIterator(titles: string[]): SourceIterator;
|
|
81
84
|
/**
|
|
82
85
|
* You can use this with `makeTiddlerIterator`:
|
|
83
|
-
*
|
|
86
|
+
*
|
|
84
87
|
* ```js
|
|
85
88
|
* $tw.wiki.filterTiddlers(filter, undefined, $tw.wiki.makeTiddlerIterator(['title']))
|
|
86
89
|
* ```
|
|
87
|
-
*
|
|
90
|
+
*
|
|
88
91
|
* This calls `compileFilter`
|
|
89
|
-
* @param filterString
|
|
90
|
-
* @param widget
|
|
91
|
-
* @param source
|
|
92
|
+
* @param filterString
|
|
93
|
+
* @param widget
|
|
94
|
+
* @param source
|
|
92
95
|
*/
|
|
93
96
|
filterTiddlers(
|
|
94
97
|
filterString: string,
|
|
@@ -221,7 +224,7 @@ declare module 'tiddlywiki' {
|
|
|
221
224
|
outputType: OutputMimeTypes,
|
|
222
225
|
textType: TextMimeTypes,
|
|
223
226
|
text: string,
|
|
224
|
-
options?: Partial<IMakeWidgetOptions> &
|
|
227
|
+
options?: Partial<IMakeWidgetOptions> & IParseOptions,
|
|
225
228
|
): string;
|
|
226
229
|
/**
|
|
227
230
|
Make a widget tree for a parse tree
|
|
@@ -271,11 +274,51 @@ declare module 'tiddlywiki' {
|
|
|
271
274
|
isShadowTiddler(title: string): boolean;
|
|
272
275
|
isBinaryTiddler(title: string): boolean;
|
|
273
276
|
isImageTiddler(title: string): boolean;
|
|
277
|
+
isSystemTiddler(title: string): boolean;
|
|
278
|
+
isTemporaryTiddler(title: string): boolean;
|
|
279
|
+
isVolatileTiddler(title: string): boolean;
|
|
280
|
+
/**
|
|
281
|
+
* Like addTiddler() except it will silently reject any plugin tiddlers that are older than the currently loaded version. Returns true if the tiddler was imported
|
|
282
|
+
*/
|
|
283
|
+
importTiddler(title: string): boolean;
|
|
274
284
|
/** return shadowTiddlers[title].source; */
|
|
275
285
|
getShadowSource(title: string): string | null;
|
|
276
286
|
getTiddlerBacklinks(targetTitle: string): string[];
|
|
277
287
|
getTiddlerLinks(title: string): string[];
|
|
278
288
|
getPluginInfo(title: string): { tiddlers: Record<string, ITiddlerFields> };
|
|
279
289
|
getChangeCount(title: string): number;
|
|
290
|
+
getCreationFields(): {
|
|
291
|
+
created: Date;
|
|
292
|
+
creator?: string;
|
|
293
|
+
[x: string]: unknown;
|
|
294
|
+
};
|
|
295
|
+
getModificationFields(): {
|
|
296
|
+
modified: Date;
|
|
297
|
+
modifier?: string;
|
|
298
|
+
[x: string]: unknown;
|
|
299
|
+
};
|
|
300
|
+
/**
|
|
301
|
+
Generate an unused title from the specified base
|
|
302
|
+
options.prefix must be a string
|
|
303
|
+
*/
|
|
304
|
+
generateNewTitle(baseTitle: string, options: { prefix?: string }): string;
|
|
305
|
+
|
|
306
|
+
addEventListener(
|
|
307
|
+
type: string,
|
|
308
|
+
handler: (event: unknown) => void | Promise<void>,
|
|
309
|
+
): void;
|
|
310
|
+
addEventListener(
|
|
311
|
+
type: "change",
|
|
312
|
+
handler: (change: IChangedTiddlers) => void | Promise<void>,
|
|
313
|
+
): void;
|
|
314
|
+
|
|
315
|
+
dispatchEvent(
|
|
316
|
+
type: string,
|
|
317
|
+
dataOrEvent: unknown,
|
|
318
|
+
): void;
|
|
319
|
+
dispatchEvent(
|
|
320
|
+
type: "change",
|
|
321
|
+
change: IChangedTiddlers,
|
|
322
|
+
): void;
|
|
280
323
|
}
|
|
281
324
|
}
|