tw5-typed 0.0.1 → 0.0.2
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/README.md +25 -0
- package/package.json +7 -6
- package/src/tw.d.ts +2 -0
package/README.md
CHANGED
|
@@ -1,2 +1,27 @@
|
|
|
1
1
|
# TW5-Typed
|
|
2
|
+
|
|
2
3
|
TypeScript type definitions for TiddlyWiki5.
|
|
4
|
+
|
|
5
|
+
## Usage
|
|
6
|
+
|
|
7
|
+
First, install it as dev-dependency:
|
|
8
|
+
|
|
9
|
+
```sh
|
|
10
|
+
npm i -D tw5-typed
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
Add `tw5-typed` to your `tsconfig.json`'s `compilerOptions`
|
|
14
|
+
|
|
15
|
+
```json
|
|
16
|
+
{
|
|
17
|
+
"compilerOptions": {
|
|
18
|
+
"types": ["node", "tw5-typed"] /* Type declaration files to be included in compilation. */,
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
Then you will have global types like `$tw` automatically. You can import the rest of the types using `import type` statement:
|
|
24
|
+
|
|
25
|
+
```typescript
|
|
26
|
+
|
|
27
|
+
```
|
package/package.json
CHANGED
|
@@ -2,15 +2,16 @@
|
|
|
2
2
|
"description": "Types for tiddlywiki",
|
|
3
3
|
"license": "MIT",
|
|
4
4
|
"name": "tw5-typed",
|
|
5
|
-
"version": "0.0.
|
|
5
|
+
"version": "0.0.2",
|
|
6
6
|
"url": "https://github.com/tiddly-gittly/tw5-typed",
|
|
7
|
-
"types": "
|
|
7
|
+
"types": "index.d.ts",
|
|
8
|
+
"files": [
|
|
9
|
+
"src/"
|
|
10
|
+
],
|
|
8
11
|
"author": "",
|
|
9
|
-
"scripts": {
|
|
10
|
-
},
|
|
12
|
+
"scripts": {},
|
|
11
13
|
"devDependencies": {
|
|
12
14
|
"typescript": "^4.5.5"
|
|
13
15
|
},
|
|
14
|
-
"dependencies": {
|
|
15
|
-
}
|
|
16
|
+
"dependencies": {}
|
|
16
17
|
}
|
package/src/tw.d.ts
CHANGED
|
@@ -38,6 +38,8 @@ export interface I$TW {
|
|
|
38
38
|
hooks: { addHook: (hookName: string, callback: (...arguments_: any[]) => unknown) => void };
|
|
39
39
|
wiki: {
|
|
40
40
|
getTiddler: (title: string) => ITiddler | undefined;
|
|
41
|
+
getTiddlers: () => ITiddler[];
|
|
41
42
|
};
|
|
43
|
+
utils: Record<string, any>;
|
|
42
44
|
}
|
|
43
45
|
export function TiddlyWiki(): I$TW;
|