tw5-typed 0.6.0 → 0.6.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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/hooks.d.ts +10 -8
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tw5-typed",
3
- "version": "0.6.0",
3
+ "version": "0.6.2",
4
4
  "scripts": {
5
5
  "check": "tsc --noEmit && eslint src/**/*.ts",
6
6
  "docs": "docs-ts",
package/src/hooks.d.ts CHANGED
@@ -1,4 +1,12 @@
1
1
  declare module 'tiddlywiki' {
2
+ interface ImportFileInfo {
3
+ // eslint-disable-next-line @typescript-eslint/ban-types
4
+ callback: Function;
5
+ file: { lastModified?: number; lastModifiedDate?: Date; name: string; path?: string; size: number; type: string; webkitRelativePath?: string };
6
+ isBinary: boolean;
7
+ type: string;
8
+ }
9
+
2
10
  interface IHooks {
3
11
  /** Add hooks to the hashmap */
4
12
  addHook(
@@ -58,7 +66,7 @@ declare module 'tiddlywiki' {
58
66
  callback: (event: unknown) => unknown,
59
67
  );
60
68
  addHook(hookName: 'th-new-tiddler', callback: (event: unknown) => unknown);
61
- addHook(hookName: 'th-deleting-tiddler', callback: (title: string) => void);
69
+ addHook(hookName: 'th-deleting-tiddler', callback: (title: Tiddler) => void);
62
70
  addHook(hookName: 'th-page-refreshed', callback: () => void);
63
71
  addHook(hookName: 'th-boot-tiddlers-loaded', callback: () => void);
64
72
  addHook(hookName: 'th-page-refreshed', callback: () => void);
@@ -66,13 +74,7 @@ declare module 'tiddlywiki' {
66
74
  addHook(hookName: 'th-page-refreshed', callback: () => void);
67
75
  addHook(
68
76
  hookName: 'th-importing-file',
69
- callback: (props: {
70
- // eslint-disable-next-line @typescript-eslint/ban-types
71
- callback: Function;
72
- file: { lastModified?: number; lastModifiedDate?: Date; name: string; path?: string; size: number; type: string; webkitRelativePath?: string };
73
- isBinary: boolean;
74
- type: string;
75
- }) => boolean | undefined,
77
+ callback: (props: ImportFileInfo) => boolean | undefined,
76
78
  );
77
79
  addHook(hookName: string, callback: (...arguments_: unknown[]) => unknown);
78
80
  /**