tw5-typed 0.4.5 → 0.4.7

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",
5
+ "version": "0.4.7",
6
6
  "url": "https://github.com/tiddly-gittly/tw5-typed",
7
7
  "homepage": "https://github.com/tiddly-gittly/tw5-typed",
8
8
  "bugs": {
@@ -1,7 +1,7 @@
1
1
  /// <reference path="../../widgets/index.d.ts" />
2
2
 
3
- declare module 'tiddlywiki' {
4
- export interface IModal {
3
+ declare module '$:/core/modules/utils/dom/modal.js' {
4
+ export class Modal {
5
5
  adjustPageClass: () => void;
6
6
  /**
7
7
  *
@@ -19,6 +19,7 @@ declare module 'tiddlywiki' {
19
19
  },
20
20
  ) => void;
21
21
 
22
- // new (wiki: Wiki): ModalWidget;
22
+ constructor (wiki: Wiki);
23
+ new (wiki: Wiki): Modal;
23
24
  }
24
25
  }
@@ -27,8 +27,8 @@ declare module 'tiddlywiki' {
27
27
  */
28
28
  constructor(...tiddlers: Array<Record<string, unknown> | Tiddler>);
29
29
 
30
- hasTag(field: string): boolean;
31
- hasField(): boolean;
30
+ hasTag(tag: string): boolean;
31
+ hasField(field: string): boolean;
32
32
  isPlugin(): boolean;
33
33
  isDraft(): boolean;
34
34
  /**
@@ -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.
@@ -39,7 +43,7 @@ declare module 'tiddlywiki' {
39
43
  * @param filter Filter string
40
44
  * @param spaces Last arg of `JSON.stringify`, default is `' '`
41
45
  */
42
- getTiddlersAsJson(filter: string, spaces?: string): string;
46
+ getTiddlersAsJson(filter: string, spaces?: string): ITiddlerJSONResult;
43
47
  deleteTiddler(title: string): void;
44
48
  each(callback: (tiddler: Tiddler, title: string) => void): void;
45
49
  /**