tw5-typed 0.4.4 → 0.4.6

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.4",
5
+ "version": "0.4.6",
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
  }
@@ -388,7 +388,10 @@ declare module 'tiddlywiki' {
388
388
  ): void;
389
389
 
390
390
  /**
391
- * Add an event listener
391
+ * Add an event listener.
392
+ * If the handler is sync, then should return a boolean, `false` means the event is handled and don't propagate, and `true` will be dispatched to the parent widget.
393
+ * If the handler is async, then it is always propagate to the parent widget.
394
+ * @returns should propagate to parent widget
392
395
  */
393
396
  addEventListener(
394
397
  type: string,
@@ -399,7 +402,7 @@ declare module 'tiddlywiki' {
399
402
  * Dispatch an event to a widget. If the widget doesn't handle the event then it is also dispatched to the parent widget
400
403
  * Events added via `addEventListener`, like `tm-notify`, can be invoked by this.
401
404
  */
402
- dispatchEvent(typeOrEvent: string | Omit<IWidgetEvent, 'widget'>): void;
405
+ dispatchEvent(widgetEvent: Omit<IWidgetEvent, 'widget'> & { widget?: IWidgetEvent['widget'] }): void;
403
406
 
404
407
  /**
405
408
  * Rebuild a previously rendered widget
@@ -472,13 +475,6 @@ declare module 'tiddlywiki' {
472
475
  variables: Record<string, IWidgetVariable>,
473
476
  ): boolean;
474
477
 
475
- /**
476
- * The destroy method will be called by parent widget.
477
- * If you widget don't have any child widget, you can just write your own tear down logic. If it may have some child widget, don't forget to call original destroy method in the Widget class to destroy children widgets.
478
- * @version >=5.3.0
479
- * @url https://tiddlywiki.com/dev/#Widget%20%60destroy%60%20method%20examples
480
- */
481
- destroy(): void;
482
478
  removeLocalDomNodes(): void;
483
479
  }
484
480
  }