tw5-typed 0.2.7 → 0.2.8
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 +4 -4
- package/src/Wiki.d.ts +13 -0
- package/src/ast.d.ts +12 -14
- package/src/server.d.ts +5 -0
- package/src/tw.d.ts +11 -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.
|
|
5
|
+
"version": "0.2.8",
|
|
6
6
|
"url": "https://github.com/tiddly-gittly/tw5-typed",
|
|
7
7
|
"homepage": "https://github.com/tiddly-gittly/tw5-typed",
|
|
8
8
|
"bugs": {
|
|
@@ -21,9 +21,9 @@
|
|
|
21
21
|
},
|
|
22
22
|
"devDependencies": {
|
|
23
23
|
"@types/node": "^17.0.31",
|
|
24
|
-
"@typescript-eslint/eslint-plugin": "5.
|
|
25
|
-
"@typescript-eslint/parser": "5.
|
|
26
|
-
"eslint": "8.
|
|
24
|
+
"@typescript-eslint/eslint-plugin": "5.22.0",
|
|
25
|
+
"@typescript-eslint/parser": "5.22.0",
|
|
26
|
+
"eslint": "8.15.0",
|
|
27
27
|
"eslint-config-prettier": "8.5.0",
|
|
28
28
|
"eslint-config-standard": "17.0.0",
|
|
29
29
|
"eslint-config-standard-with-typescript": "21.0.1",
|
package/src/Wiki.d.ts
CHANGED
|
@@ -122,7 +122,20 @@ declare module 'tiddlywiki' {
|
|
|
122
122
|
* @param {object} options options, see tiddlywiki dev doc for details
|
|
123
123
|
*/
|
|
124
124
|
setText: (title: string, field?: string, index?: string | undefined, value?: string, options?: { suppressTimestamp?: boolean }) => void;
|
|
125
|
+
/**
|
|
126
|
+
Parse a tiddler according to its MIME type
|
|
127
|
+
*/
|
|
125
128
|
parseTiddler(title: string, options?: IParserOptions): WikiParser;
|
|
129
|
+
/**
|
|
130
|
+
Parse a block of text of a specified MIME type
|
|
131
|
+
@param {string} type: content type of text to be parsed
|
|
132
|
+
@param {string} text: text
|
|
133
|
+
@param {object}options: see below
|
|
134
|
+
|
|
135
|
+
Options include:
|
|
136
|
+
- parseAsInline: if true, the text of the tiddler will be parsed as an inline run
|
|
137
|
+
- _canonical_uri: optional string of the canonical URI of this content
|
|
138
|
+
*/
|
|
126
139
|
parseText(type: string, text: string, options?: IParserOptions): WikiParser;
|
|
127
140
|
/**
|
|
128
141
|
Parse text from a tiddler and render it into another format
|
package/src/ast.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ declare module 'tiddlywiki' {
|
|
|
3
3
|
end?: number;
|
|
4
4
|
name?: string;
|
|
5
5
|
start?: number;
|
|
6
|
-
type: 'string' | 'number';
|
|
6
|
+
type: 'string' | 'number' | 'bigint' | 'boolean' | 'symbol' | 'undefined' | 'object' | 'function';
|
|
7
7
|
value: string;
|
|
8
8
|
}
|
|
9
9
|
|
|
@@ -42,19 +42,15 @@ declare module 'tiddlywiki' {
|
|
|
42
42
|
}
|
|
43
43
|
export interface ICodeBlockParseTreeNode extends IWikiASTNode {
|
|
44
44
|
attributes: {
|
|
45
|
-
code?:
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
value: string;
|
|
55
|
-
}
|
|
56
|
-
| undefined;
|
|
57
|
-
};
|
|
45
|
+
code?: {
|
|
46
|
+
type: 'string';
|
|
47
|
+
value: string;
|
|
48
|
+
};
|
|
49
|
+
language?: {
|
|
50
|
+
type: 'string';
|
|
51
|
+
value: string;
|
|
52
|
+
};
|
|
53
|
+
} & IWikiASTNode['attributes'];
|
|
58
54
|
type: 'codeblock';
|
|
59
55
|
}
|
|
60
56
|
export interface IMacroParameterCallParseTreeNode extends IWikiASTNode {
|
|
@@ -81,5 +77,7 @@ declare module 'tiddlywiki' {
|
|
|
81
77
|
| IImageParseTreeNode
|
|
82
78
|
| ITranscludeParseTreeNode
|
|
83
79
|
| ITiddlerParseTreeNode
|
|
80
|
+
| ICodeBlockParseTreeNode
|
|
81
|
+
| ILinkParseTreeNode
|
|
84
82
|
| ICustomParseTreeNode;
|
|
85
83
|
}
|
package/src/server.d.ts
CHANGED
|
@@ -81,6 +81,11 @@ declare module 'tiddlywiki' {
|
|
|
81
81
|
prefix: optional prefix (falls back to value of "path-prefix" variable)
|
|
82
82
|
*/
|
|
83
83
|
listen(port?: string, host?: string, prefix?: string): void;
|
|
84
|
+
|
|
85
|
+
on(eventName: 'error', callback: (error: Error) => void): void;
|
|
86
|
+
on(eventName: 'listening', callback: () => void): void;
|
|
87
|
+
on(eventName: string, callback: (...arguments_: unknown[]) => unknown): void;
|
|
88
|
+
|
|
84
89
|
/**
|
|
85
90
|
Check whether a given user is authorized for the specified authorizationType ("readers" or "writers"). Pass null or undefined as the username to check for anonymous access
|
|
86
91
|
*/
|
package/src/tw.d.ts
CHANGED
|
@@ -63,6 +63,12 @@ declare module 'tiddlywiki' {
|
|
|
63
63
|
|
|
64
64
|
config: ITWConfig;
|
|
65
65
|
|
|
66
|
+
/**
|
|
67
|
+
* Check for this window being the source of the drag. If true, some drop target widget will stop responding to the drop event, so you can handle drop event in your own widget.
|
|
68
|
+
* Used by `DropZoneWidget.prototype.handleDropEvent`
|
|
69
|
+
*/
|
|
70
|
+
dragInProgress?: boolean;
|
|
71
|
+
|
|
66
72
|
/**
|
|
67
73
|
Global Hooks mechanism which allows plugins to modify default functionality
|
|
68
74
|
*/
|
|
@@ -77,9 +83,11 @@ declare module 'tiddlywiki' {
|
|
|
77
83
|
*/
|
|
78
84
|
invokeHook(hookName: string, event: IWidgetEvent): undefined | IWidgetEvent;
|
|
79
85
|
};
|
|
80
|
-
|
|
86
|
+
/** Determines if a tiddler is a shadow tiddler, regardless of whether it has been overridden by a real tiddler */
|
|
87
|
+
isShadowTiddler(title: string): boolean;
|
|
81
88
|
language: ILanguage;
|
|
82
89
|
modules: ITWModules;
|
|
90
|
+
|
|
83
91
|
/** NodeJS features, if tw isn't running on a NodeJS environment, the value will be `null` */
|
|
84
92
|
node: null | object;
|
|
85
93
|
/** Broswer features, if tw isn't running on a browser environment, the value will be `null` */
|
|
@@ -96,6 +104,8 @@ declare module 'tiddlywiki' {
|
|
|
96
104
|
|
|
97
105
|
rootWidget: Widget;
|
|
98
106
|
|
|
107
|
+
/** Test for the existence of a tiddler (excludes shadow tiddlers) */
|
|
108
|
+
tiddlerExists(title: string): boolean;
|
|
99
109
|
utils: ITWUtils;
|
|
100
110
|
version: string;
|
|
101
111
|
wiki: Wiki;
|