tw5-typed 0.1.9 → 0.1.10
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/ast.d.ts +3 -2
- package/src/widget.d.ts +12 -0
package/package.json
CHANGED
package/src/ast.d.ts
CHANGED
|
@@ -24,9 +24,10 @@ declare module 'tiddlywiki' {
|
|
|
24
24
|
type: 'link';
|
|
25
25
|
text: string;
|
|
26
26
|
}
|
|
27
|
+
export type HTMLTags = keyof HTMLElementTagNameMap
|
|
27
28
|
export interface IDomParseTreeNode extends IWikiASTNode {
|
|
28
29
|
type: 'element';
|
|
29
|
-
tag:
|
|
30
|
+
tag: HTMLTags;
|
|
30
31
|
}
|
|
31
32
|
export interface IMacroParamCallParseTreeNode extends IWikiASTNode {
|
|
32
33
|
type: 'macro-parameter';
|
|
@@ -44,5 +45,5 @@ declare module 'tiddlywiki' {
|
|
|
44
45
|
params: IMacroParamCallParseTreeNode[];
|
|
45
46
|
text?: string;
|
|
46
47
|
}
|
|
47
|
-
export type IParseTreeNode = IDomParseTreeNode | IMacroParamCallParseTreeNode | IMacroCallParseTreeNode | ICustomParseTreeNode;
|
|
48
|
+
export type IParseTreeNode = IDomParseTreeNode | IMacroParamCallParseTreeNode | IMacroCallParseTreeNode | ITextParseTreeNode | ICustomParseTreeNode;
|
|
48
49
|
}
|
package/src/widget.d.ts
CHANGED
|
@@ -2,6 +2,9 @@ declare module 'tiddlywiki' {
|
|
|
2
2
|
// eslint-disable-next-line @typescript-eslint/no-extraneous-class
|
|
3
3
|
class variablesConstructor {}
|
|
4
4
|
|
|
5
|
+
/**
|
|
6
|
+
* @link https://tiddlywiki.com/dev/#Widgets
|
|
7
|
+
*/
|
|
5
8
|
export class Widget {
|
|
6
9
|
constructor(parseTreeNode: unknown, options: unknown);
|
|
7
10
|
initialize: (parseTreeNode: unknown, options: unknown) => void;
|
|
@@ -31,6 +34,15 @@ declare module 'tiddlywiki' {
|
|
|
31
34
|
* Lifecycle method: Render this widget into the DOM
|
|
32
35
|
*/
|
|
33
36
|
render(parent: Node, nextSibling: Node): void;
|
|
37
|
+
/**
|
|
38
|
+
* Selectively refreshes the widget if needed. Returns true if the widget or any of its children needed re-rendering.
|
|
39
|
+
* You can do some cleanup or buildup before return true.
|
|
40
|
+
* @param changedTiddlers Object key is tiddler title, value is metadata about the change
|
|
41
|
+
* @link https://tiddlywiki.com/dev/#Selective%20Update
|
|
42
|
+
*/
|
|
43
|
+
refresh(changedTiddlers: Record<string, {
|
|
44
|
+
modified: boolean
|
|
45
|
+
}>): boolean;
|
|
34
46
|
computeAttributes(): void;
|
|
35
47
|
/**
|
|
36
48
|
* Get parameters that user set in the widget
|