tw5-typed 0.2.10 → 0.2.12

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/widget.d.ts +18 -1
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.2.10",
5
+ "version": "0.2.12",
6
6
  "url": "https://github.com/tiddly-gittly/tw5-typed",
7
7
  "homepage": "https://github.com/tiddly-gittly/tw5-typed",
8
8
  "bugs": {
package/src/widget.d.ts CHANGED
@@ -64,6 +64,10 @@ declare module 'tiddlywiki' {
64
64
  @param parseTreeNodes default to `this.parseTreeNode.children`, can be undefined
65
65
  */
66
66
  makeChildWidgets(parseTreeNodes?: IParseTreeNode[], options?: { variables?: unknown }): void;
67
+ /*
68
+ Initialise widget properties. These steps are pulled out of the constructor so that we can reuse them in subclasses
69
+ */
70
+ initialise(parseTreeNode: IParseTreeNode, options?: { document?: Document; parentWidget?: Widget; wiki?: ITiddlyWiki }): void;
67
71
  /**
68
72
  * Remove any DOM nodes created by this widget or its children
69
73
  *
@@ -120,7 +124,7 @@ declare module 'tiddlywiki' {
120
124
  * @param event
121
125
  * @returns handled
122
126
  */
123
- invokeAction: (triggeringWidget: Widget, event: IWidgetEvent) => boolean | undefined;
127
+ invokeAction(triggeringWidget: Widget, event: IWidgetEvent): boolean | undefined;
124
128
 
125
129
  /**
126
130
  * Lifecycle method: Render this widget into the DOM
@@ -199,4 +203,17 @@ declare module 'tiddlywiki' {
199
203
  export interface TW_TextNode extends Node {
200
204
  textContent: string;
201
205
  }
206
+
207
+ export interface ModalWidget {
208
+ new (wiki: Wiki): ModalWidget;
209
+ adjustPageClass(): void;
210
+ /**
211
+ *
212
+ * @param title
213
+ * @param options
214
+ * variables: optional hashmap of variables to wrap around the widget
215
+ * downloadLink: normally is used for "Right-click to save changes"
216
+ */
217
+ display(title: string, options?: { downloadLink?: string; event?: IWidgetEvent; variables?: unknown }): void;
218
+ }
202
219
  }