tw5-typed 0.1.3 → 0.1.4
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/widget.d.ts +16 -0
package/package.json
CHANGED
package/src/widget.d.ts
CHANGED
|
@@ -38,5 +38,21 @@ declare module 'tiddlywiki' {
|
|
|
38
38
|
* @param fallbackText default value if the attribute is not set
|
|
39
39
|
*/
|
|
40
40
|
getAttribute(name: string, fallbackText?: string): string;
|
|
41
|
+
/**
|
|
42
|
+
* Get variable in the context of the widget.
|
|
43
|
+
* Simplified version of getVariableInfo() that just returns the text.
|
|
44
|
+
* @param name variable name, for example, `actions` in the button widget
|
|
45
|
+
* @param options options for getVariableInfo()
|
|
46
|
+
*
|
|
47
|
+
* Options include
|
|
48
|
+
params: array of {name:, value:} for each parameter
|
|
49
|
+
defaultValue: default value if the variable is not defined
|
|
50
|
+
|
|
51
|
+
Returns an object with the following fields:
|
|
52
|
+
|
|
53
|
+
params: array of {name:,value:} of parameters passed to wikitext variables
|
|
54
|
+
text: text of variable, with parameters properly substituted
|
|
55
|
+
*/
|
|
56
|
+
getVariable(name: string, options?: object): string;
|
|
41
57
|
}
|
|
42
58
|
}
|