tw5-typed 0.4.4 → 0.4.5
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
|
@@ -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(
|
|
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
|
}
|