tw5-typed 1.1.2 → 1.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/README.md CHANGED
@@ -58,6 +58,15 @@ You can add new `*.d.ts` file to contain your types:
58
58
  - add type import like `/// <reference path="parser.d.ts" />`
59
59
  - using normal import, like `import { parse } from './parser';` will not work
60
60
 
61
+ Could import from `"tiddlywiki"` inside `declare module` like
62
+
63
+ ```ts
64
+ declare module '$:/core/modules/utils/parsetree.js' {
65
+ import { IParseTreeNode } from 'tiddlywiki';
66
+ ```
67
+
68
+ Import outside of `declare module` will cause error.
69
+
61
70
  ### Test in your node_modules
62
71
 
63
72
  To rapid prototype the type, just right click a type to open `.d.ts` file in the `node_modules`, and try create new file there, and copy to this repo after a success.
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "tw5-typed",
3
- "version": "1.1.2",
3
+ "version": "1.1.4",
4
4
  "scripts": {
5
- "check": "tsc --noEmit && eslint src/**/*.ts test/**/*.ts",
5
+ "check": "tsc --noEmit && eslint --max-warnings 0 \"src/**/*.ts\" \"src/**/*.d.ts\" \"test/**/*.ts\"",
6
6
  "docs": "docs-ts",
7
7
  "docs:build": "docusaurus build",
8
8
  "docs:dev": "docusaurus start",
package/src/index.d.ts CHANGED
@@ -13,12 +13,16 @@
13
13
  /// <reference path="./modules/parsers/index.d.ts" />
14
14
  /// <reference path="./modules/server/index.d.ts" />
15
15
  /// <reference path="./modules/story.d.ts" />
16
+ /// <reference path="./modules/utils/index.d.ts" />
16
17
  /// <reference path="./modules/utils/filesystem.d.ts" />
17
18
  /// <reference path="./modules/utils/logger.d.ts" />
19
+ /// <reference path="./modules/utils/dom/dom.d.ts" />
20
+ /// <reference path="./modules/utils/dom/modal.d.ts" />
21
+ /// <reference path="./modules/utils/dom/notifier.d.ts" />
22
+ /// <reference path="./modules/utils/fakedom.d.ts" />
23
+ /// <reference path="./modules/utils/linked-list.d.ts" />
18
24
  /// <reference path="./modules/syncer/syncadaptor.d.ts" />
19
25
  /// <reference path="./modules/syncer/syncer.d.ts" />
20
- /// <reference path="./modules/utils/dom/index.d.ts" />
21
- /// <reference path="./modules/utils/linked-list.d.ts" />
22
26
  /// <reference path="./modules/widgets/index.d.ts" />
23
27
  /// <reference path="./plugins/index.d.ts" />
24
28
 
@@ -1,6 +1,5 @@
1
- import type Http from 'http';
2
-
3
1
  declare module 'tiddlywiki' {
2
+ import type Http from 'http';
4
3
  export interface IServerStatus {
5
4
  anonymous: boolean;
6
5
  read_only: boolean;
@@ -16,7 +16,7 @@ declare module 'tiddlywiki' {
16
16
  import * as editionInfo from '$:/core/modules/utils/edition-info.js';
17
17
  import * as escapecss from '$:/core/modules/utils/escapecss.js';
18
18
 
19
- type IUtilitiesModules =
19
+ export type IUtilitiesModules =
20
20
  & Pick<typeof dom, keyof typeof dom>
21
21
  & Pick<typeof logger, keyof typeof logger>
22
22
  & Pick<typeof filesystem, keyof typeof filesystem>
@@ -1,10 +1,9 @@
1
- import { IParseTreeNode } from 'tiddlywiki';
2
-
3
1
  /**
4
2
  * A utility module for working with parse trees.
5
3
  * @description 用于处理解析树的实用程序模块。
6
4
  */
7
5
  declare module '$:/core/modules/utils/parsetree.js' {
6
+ import { IParseTreeNode } from 'tiddlywiki';
8
7
  /**
9
8
  * Add attribute to parse tree node.
10
9
  * @param node - The parse tree node.
@@ -1,6 +1,5 @@
1
- import { Logger } from '$:/core/modules/utils/logger.js';
2
-
3
1
  declare module '$:/core/modules/utils/performance.js' {
2
+ import { Logger } from '$:/core/modules/utils/logger.js';
4
3
  /**
5
4
  * A performance measurement utility.
6
5
  * @param enabled - Whether performance measurements are enabled.
@@ -1,7 +1,6 @@
1
- import type { Logger } from '$:/core/modules/utils/logger.js';
2
- import { Spread } from 'type-fest';
3
-
4
1
  declare module 'tiddlywiki' {
2
+ import type { Logger } from '$:/core/modules/utils/logger.js';
3
+ import { Spread } from 'type-fest';
5
4
  export type TWDocument = Document | IFakeDocument;
6
5
  export type TWElement = Element;
7
6
  export type TWDOMElement = TWElement;
@@ -500,5 +499,6 @@ declare module 'tiddlywiki' {
500
499
  formatDateString: (date: Date, template: string) => string;
501
500
  }
502
501
 
502
+ import type { IUtilitiesModules } from 'tiddlywiki';
503
503
  export type IUtilities = IUtilitiesBoot & IUtilitiesModules;
504
504
  }