tw5-typed 1.0.2 → 1.0.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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tw5-typed",
3
- "version": "1.0.2",
3
+ "version": "1.0.4",
4
4
  "scripts": {
5
5
  "check": "tsc --noEmit && eslint src/**/*.ts test/**/*.ts",
6
6
  "docs": "docs-ts",
@@ -6,7 +6,7 @@ declare module 'tiddlywiki' {
6
6
  export interface SyncAdaptor {
7
7
  getTiddlerFileInfo(
8
8
  title: string,
9
- callback: (error: null, fileInfo: IFileInfo) => void,
9
+ callback: (error: Error | null | string, fileInfo: IFileInfo) => void,
10
10
  ): void;
11
11
  getTiddlerInfo(title: string): IBootFilesIndexItem;
12
12
  /**
@@ -2,7 +2,7 @@ declare module 'tiddlywiki' {
2
2
  /**
3
3
  * File information for saving a tiddler
4
4
  */
5
- export interface FileInfo {
5
+ export interface IFileInfo {
6
6
  filepath: string;
7
7
  type: string;
8
8
  hasMetaFile: boolean;
@@ -15,7 +15,7 @@ declare module 'tiddlywiki' {
15
15
  }
16
16
 
17
17
  declare module '$:/core/modules/utils/filesystem.js' {
18
- import type { FileInfo, Tiddler, Wiki } from 'tiddlywiki';
18
+ import type { IFileInfo, Tiddler, Wiki } from 'tiddlywiki';
19
19
 
20
20
  /**
21
21
  * Return the subdirectories of a path
@@ -114,11 +114,11 @@ declare module '$:/core/modules/utils/filesystem.js' {
114
114
  options: {
115
115
  directory: string;
116
116
  extFilters?: string[];
117
- fileInfo?: FileInfo;
117
+ fileInfo?: IFileInfo;
118
118
  pathFilters?: string[];
119
119
  wiki?: Wiki;
120
120
  },
121
- ): FileInfo;
121
+ ): IFileInfo;
122
122
 
123
123
  /**
124
124
  * Generate the file extension for saving a tiddler
@@ -153,7 +153,7 @@ declare module '$:/core/modules/utils/filesystem.js' {
153
153
  directory?: string;
154
154
  extension?: string;
155
155
  extFilters?: string[];
156
- fileInfo?: FileInfo;
156
+ fileInfo?: IFileInfo;
157
157
  pathFilters?: string[];
158
158
  wiki?: Wiki;
159
159
  },
@@ -168,8 +168,8 @@ declare module '$:/core/modules/utils/filesystem.js' {
168
168
  */
169
169
  export function saveTiddlerToFile(
170
170
  tiddler: Tiddler,
171
- fileInfo: FileInfo,
172
- callback: (error: Error | null, fileInfo?: FileInfo) => void,
171
+ fileInfo: IFileInfo,
172
+ callback: (error: Error | null, fileInfo?: IFileInfo) => void,
173
173
  ): void;
174
174
 
175
175
  /**
@@ -179,7 +179,7 @@ declare module '$:/core/modules/utils/filesystem.js' {
179
179
  * @returns The fileInfo object
180
180
  * @description 同步地将 tiddler 保存到由 fileInfo 描述的文件
181
181
  */
182
- export function saveTiddlerToFileSync(tiddler: Tiddler, fileInfo: FileInfo): FileInfo;
182
+ export function saveTiddlerToFileSync(tiddler: Tiddler, fileInfo: IFileInfo): IFileInfo;
183
183
 
184
184
  /**
185
185
  * Delete a file described by the fileInfo if it exists
@@ -188,8 +188,8 @@ declare module '$:/core/modules/utils/filesystem.js' {
188
188
  * @description 删除由 fileInfo 描述的文件(如果存在)
189
189
  */
190
190
  export function deleteTiddlerFile(
191
- fileInfo: FileInfo,
192
- callback: (error: Error | null, fileInfo?: FileInfo) => void,
191
+ fileInfo: IFileInfo,
192
+ callback: (error: Error | null, fileInfo?: IFileInfo) => void,
193
193
  ): void;
194
194
 
195
195
  /**
@@ -200,10 +200,10 @@ declare module '$:/core/modules/utils/filesystem.js' {
200
200
  */
201
201
  export function cleanupTiddlerFiles(
202
202
  options: {
203
- adaptorInfo?: FileInfo;
204
- bootInfo?: FileInfo;
203
+ adaptorInfo?: IFileInfo;
204
+ bootInfo?: IFileInfo;
205
205
  title?: string;
206
206
  },
207
- callback: (error: Error | null, fileInfo?: FileInfo) => void,
207
+ callback: (error: Error | null, fileInfo?: IFileInfo) => void,
208
208
  ): void;
209
209
  }
@@ -476,24 +476,24 @@ declare module 'tiddlywiki' {
476
476
  pathFilters?: string[];
477
477
  extFilters?: string[];
478
478
  wiki: Wiki;
479
- fileInfo?: Partial<FileInfo>;
479
+ fileInfo?: Partial<IFileInfo>;
480
480
  },
481
- ) => FileInfo;
481
+ ) => IFileInfo;
482
482
  /**
483
483
  * Save tiddler to file
484
484
  */
485
- saveTiddlerToFile: (tiddler: Tiddler, fileInfo: FileInfo, callback?: (error: Error | null) => void) => void;
485
+ saveTiddlerToFile: (tiddler: Tiddler, fileInfo: IFileInfo, callback?: (error: Error | null) => void) => void;
486
486
  /**
487
487
  * Cleanup tiddler files (delete old files when tiddler is moved)
488
488
  */
489
489
  cleanupTiddlerFiles: (
490
- fileInfo: FileInfo | Record<string, unknown>,
491
- callback?: (error: Error | null, cleanedFileInfo?: FileInfo) => void,
490
+ fileInfo: IFileInfo | Record<string, unknown>,
491
+ callback?: (error: Error | null, cleanedFileInfo?: IFileInfo) => void,
492
492
  ) => void;
493
493
  /**
494
494
  * Delete tiddler file
495
495
  */
496
- deleteTiddlerFile: (fileInfo: FileInfo, callback?: (error: Error | null, deletedFileInfo?: FileInfo) => void) => void;
496
+ deleteTiddlerFile: (fileInfo: IFileInfo, callback?: (error: Error | null, deletedFileInfo?: IFileInfo) => void) => void;
497
497
  /**
498
498
  * Format date string
499
499
  */