tw5-typed 0.5.13 → 0.6.0
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
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "tw5-typed",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.6.0",
|
|
4
4
|
"scripts": {
|
|
5
5
|
"check": "tsc --noEmit && eslint src/**/*.ts",
|
|
6
6
|
"docs": "docs-ts",
|
|
@@ -23,6 +23,13 @@
|
|
|
23
23
|
"url": "git+https://github.com/tiddly-gittly/tw5-typed.git"
|
|
24
24
|
},
|
|
25
25
|
"types": "src/index.d.ts",
|
|
26
|
+
"exports": {
|
|
27
|
+
".": {
|
|
28
|
+
"import": "./src/index.d.ts",
|
|
29
|
+
"require": "./src/index.d.ts",
|
|
30
|
+
"types": "./src/index.d.ts"
|
|
31
|
+
}
|
|
32
|
+
},
|
|
26
33
|
"files": [
|
|
27
34
|
"src/"
|
|
28
35
|
],
|
package/src/hooks.d.ts
CHANGED
|
@@ -69,7 +69,7 @@ declare module 'tiddlywiki' {
|
|
|
69
69
|
callback: (props: {
|
|
70
70
|
// eslint-disable-next-line @typescript-eslint/ban-types
|
|
71
71
|
callback: Function;
|
|
72
|
-
file: { name: string; path?: string };
|
|
72
|
+
file: { lastModified?: number; lastModifiedDate?: Date; name: string; path?: string; size: number; type: string; webkitRelativePath?: string };
|
|
73
73
|
isBinary: boolean;
|
|
74
74
|
type: string;
|
|
75
75
|
}) => boolean | undefined,
|
|
@@ -78,7 +78,7 @@ declare module 'tiddlywiki' {
|
|
|
78
78
|
/**
|
|
79
79
|
* Invoke the hook by key
|
|
80
80
|
*/
|
|
81
|
-
invokeHook(hookName: string, event: IWidgetEvent): undefined | IWidgetEvent
|
|
81
|
+
invokeHook(hookName: string, event: IWidgetEvent): undefined | IWidgetEvent;
|
|
82
82
|
// eslint-disable-next-line @typescript-eslint/ban-types
|
|
83
83
|
names: Record<string, Function[]>;
|
|
84
84
|
}
|
|
@@ -1,5 +1,18 @@
|
|
|
1
1
|
declare module 'tiddlywiki' {
|
|
2
2
|
/**
|
|
3
|
+
* # Usage
|
|
4
|
+
*
|
|
5
|
+
* ```ts
|
|
6
|
+
* const yourFilter: IFilterOperator = (source,operator) => {
|
|
7
|
+
* var results = [];
|
|
8
|
+
* source(function(tiddler,title) {
|
|
9
|
+
* if (!tiddler.fields['xxx']) return;
|
|
10
|
+
* results.push(title);
|
|
11
|
+
* });
|
|
12
|
+
* return results;
|
|
13
|
+
* }
|
|
14
|
+
* ```
|
|
15
|
+
*
|
|
3
16
|
* # Overview
|
|
4
17
|
|
|
5
18
|
Filter operators are modules (tiddlers of type `application/javascript`) with their `module-type` field set to `filteroperator`, exporting one or more functions implementing a filter.
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { IParseTreeNode } from 'tiddlywiki';
|
|
2
|
+
|
|
1
3
|
/**
|
|
2
4
|
* A utility module for working with parse trees.
|
|
3
5
|
* @description 用于处理解析树的实用程序模块。
|
|
@@ -78,4 +80,11 @@ declare module '$:/core/modules/utils/parsetree.js' {
|
|
|
78
80
|
* @description 获取解析树节点或节点数组的文本。
|
|
79
81
|
*/
|
|
80
82
|
export function getParseTreeText(tree: any): string;
|
|
83
|
+
/**
|
|
84
|
+
* Serialize parse tree.
|
|
85
|
+
* @param tree - The parse tree node or array of nodes.
|
|
86
|
+
* @returns The serialized parse tree.
|
|
87
|
+
* @description 序列化解析树。
|
|
88
|
+
*/
|
|
89
|
+
export function serializeParseTree(tree: IParseTreeNode | IParseTreeNode[]): string;
|
|
81
90
|
}
|
|
@@ -41,7 +41,7 @@ declare module '$:/core/modules/utils/parseutils.js' {
|
|
|
41
41
|
export function parseStringLiteral(source: string, pos: number): { end: number; start: number; type: 'string'; value: string } | null;
|
|
42
42
|
|
|
43
43
|
/**
|
|
44
|
-
* Returns an array of {name:} with an optional "default" property. Options include `requireParenthesis`.
|
|
44
|
+
* Returns an array of `{name:}` with an optional "default" property. Options include `requireParenthesis`.
|
|
45
45
|
*/
|
|
46
46
|
export function parseParameterDefinition(parameterString: string, options?: { requireParenthesis?: boolean }): Array<{ default?: string; name: string }>;
|
|
47
47
|
|