tw5-typed 0.4.6 → 0.4.8
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 +1 -1
- package/src/tiddler/index.d.ts +2 -2
- package/src/wiki/index.d.ts +12 -1
package/package.json
CHANGED
package/src/tiddler/index.d.ts
CHANGED
|
@@ -27,8 +27,8 @@ declare module 'tiddlywiki' {
|
|
|
27
27
|
*/
|
|
28
28
|
constructor(...tiddlers: Array<Record<string, unknown> | Tiddler>);
|
|
29
29
|
|
|
30
|
-
hasTag(
|
|
31
|
-
hasField(): boolean;
|
|
30
|
+
hasTag(tag: string): boolean;
|
|
31
|
+
hasField(field: string): boolean;
|
|
32
32
|
isPlugin(): boolean;
|
|
33
33
|
isDraft(): boolean;
|
|
34
34
|
/**
|
package/src/wiki/index.d.ts
CHANGED
|
@@ -20,6 +20,10 @@ declare module 'tiddlywiki' {
|
|
|
20
20
|
Partial<ITiddlerFields>,
|
|
21
21
|
'created' | 'modified'
|
|
22
22
|
> & { created?: string; modified?: string };
|
|
23
|
+
export type ITiddlerJSONResult = Omit<
|
|
24
|
+
Partial<ITiddlerFieldsParam>,
|
|
25
|
+
'list' | 'tags'
|
|
26
|
+
> & { list?: string; tags?: string };
|
|
23
27
|
export class Wiki {
|
|
24
28
|
/**
|
|
25
29
|
* 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.
|
|
@@ -35,11 +39,18 @@ declare module 'tiddlywiki' {
|
|
|
35
39
|
*/
|
|
36
40
|
getTiddlers(): string[];
|
|
37
41
|
/**
|
|
38
|
-
* Get JSON string of tiddlers. Note that this will make lists like tags/list to be string, instead of array.
|
|
42
|
+
* Get JSON string of tiddlers. Note that this will make lists like tags/list to be string, instead of array. And result is a string, not an array.
|
|
39
43
|
* @param filter Filter string
|
|
40
44
|
* @param spaces Last arg of `JSON.stringify`, default is `' '`
|
|
45
|
+
* @returns a stringified JSON with type ITiddlerJSONResult. You will need to use `JSON.parse` on it.
|
|
41
46
|
*/
|
|
42
47
|
getTiddlersAsJson(filter: string, spaces?: string): string;
|
|
48
|
+
/**
|
|
49
|
+
* 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
|
|
51
|
+
* @returns a stringified JSON with type ITiddlerJSONResult. You will need to use `JSON.parse` on it.
|
|
52
|
+
*/
|
|
53
|
+
getTiddlerAsJson(title: string): string;
|
|
43
54
|
deleteTiddler(title: string): void;
|
|
44
55
|
each(callback: (tiddler: Tiddler, title: string) => void): void;
|
|
45
56
|
/**
|