tw5-typed 0.2.16 → 0.2.18

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/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2021 Tiddly Gittly
3
+ Copyright (c) 2023 Tiddly Gittly
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "description": "Types for tiddlywiki",
3
3
  "license": "MIT",
4
4
  "name": "tw5-typed",
5
- "version": "0.2.16",
5
+ "version": "0.2.18",
6
6
  "url": "https://github.com/tiddly-gittly/tw5-typed",
7
7
  "homepage": "https://github.com/tiddly-gittly/tw5-typed",
8
8
  "bugs": {
@@ -16,9 +16,6 @@
16
16
  "files": [
17
17
  "src/"
18
18
  ],
19
- "scripts": {
20
- "check": "tsc --noEmit && eslint src/**/*.ts"
21
- },
22
19
  "husky": {
23
20
  "hooks": {
24
21
  "pre-commit": "lint-staged"
@@ -35,10 +32,16 @@
35
32
  "devDependencies": {
36
33
  "@modern-js/eslint-config": "latest",
37
34
  "@modern-js/tsconfig": "latest",
35
+ "@types/codemirror": "^5.60.6",
36
+ "@types/echarts": "^4.9.16",
38
37
  "@types/node": "^18.11.9",
39
38
  "husky": "^8.0.2",
40
39
  "lint-staged": "^13.1.0",
41
40
  "rimraf": "^3.0.2",
41
+ "tiddlywiki": "^5.2.5",
42
42
  "typescript": "^4.9.4"
43
+ },
44
+ "scripts": {
45
+ "check": "tsc --noEmit && eslint src/**/*.ts"
43
46
  }
44
- }
47
+ }
@@ -0,0 +1,55 @@
1
+ declare module 'tiddlywiki' {
2
+ export interface IContentTypeInfo {
3
+ deserializerType: string;
4
+ encoding: string;
5
+ extension: string;
6
+ flags: string[];
7
+ }
8
+
9
+ export interface IFileExtensionInfo {
10
+ type: string;
11
+ }
12
+
13
+ export type ITWConfig = IConfig;
14
+
15
+ interface IConfig {
16
+ [configName: string]: unknown;
17
+ /** Map type to file content type */
18
+ contentTypeInfo: Record<string, IContentTypeInfo>;
19
+ /** @default 'TIDDLYWIKI_EDITION_PATH' */
20
+ editionsEnvVar: string;
21
+ /** @default '../editions/' */
22
+ editionsPath: string;
23
+ /** Map file extension */
24
+ fileExtensionInfo: Record<string, IFileExtensionInfo>;
25
+ /**
26
+ * @default '^\\/\\*\\\\(?:\\r?\\n)((?:^[^\\r\\n]*(?:\\r?\\n))+?)(^\\\\\\*\\/$(?:\\r?\\n)?)
27
+ */
28
+ jsModuleHeaderRegExpString: string;
29
+ /** @default 'TIDDLYWIKI_LANGUAGE_PATH' */
30
+ languagesEnvVar: string;
31
+ /** @default '../languages/' */
32
+ languagesPath: string;
33
+ //
34
+ /** @default 'TIDDLYWIKI_PLUGIN_PATH' */
35
+ pluginsEnvVar: string;
36
+ /** @default '../plugins/'' */
37
+ pluginsPath: string;
38
+ /** @default 'TIDDLYWIKI_THEME_PATH' */
39
+ themesEnvVar: string;
40
+ /** @default '../themes/' */
41
+ themesPath: string;
42
+ /** @default './tiddlywiki.info' */
43
+ wikiInfo: string;
44
+ /** @default './languages' */
45
+ wikiLanguagesSubDir: string;
46
+ /** @default './output' */
47
+ wikiOutputSubDir: string;
48
+ /** @default './plugins' */
49
+ wikiPluginsSubDir: string;
50
+ /** @default './themes' */
51
+ wikiThemesSubDir: string;
52
+ /** @default './tiddlers' */
53
+ wikiTiddlersSubDir: string;
54
+ }
55
+ }
@@ -0,0 +1,32 @@
1
+ /// <reference path="config.d.ts" />
2
+
3
+ declare module 'tiddlywiki' {
4
+ export interface IBootFilesIndexItem {
5
+ filepath: string;
6
+ hasMetaFile: boolean;
7
+ tiddlerTitle: string;
8
+ type: string;
9
+ }
10
+
11
+ export type IBootFilesIndex = Record<string, IBootFilesIndexItem>;
12
+
13
+ export interface IStartUpOption {
14
+ bootPath?: string;
15
+ callback?: () => unknown;
16
+ }
17
+
18
+ export interface IBoot {
19
+ argv: string[];
20
+ boot: (callback?: () => void) => void;
21
+ files: IBootFilesIndex;
22
+ log: (logString: string) => void;
23
+ logMessages: string[];
24
+ startup: (options: IStartUpOption) => void;
25
+ /** Default boot tasks */
26
+ tasks: {
27
+ readBrowserTiddlers: boolean;
28
+ trapErrors: boolean;
29
+ };
30
+ excludeRegExp: RegExp;
31
+ }
32
+ }
package/src/core.d.ts ADDED
@@ -0,0 +1,140 @@
1
+ /// <reference path="hooks.d.ts" />
2
+ /// <reference path="boot/index.d.ts" />
3
+ /// <reference path="wiki/index.d.ts" />
4
+ /// <reference path="utils/index.d.ts" />
5
+ /// <reference path="tiddler/index.d.ts" />
6
+ /// <reference path="modules/index.d.ts" />
7
+ /// <reference path="plugins/index.d.ts" />
8
+
9
+ declare module 'tiddlywiki' {
10
+ export interface IPluginInfo {
11
+ version: string;
12
+ 'plugin-type': string;
13
+ dependents: string;
14
+ type: 'application/json';
15
+ text: string;
16
+ [pluginProperty: string]: string;
17
+ }
18
+
19
+ export interface ILanguage {
20
+ getString(key: string, options: { variables: { title: string } }): string;
21
+ }
22
+
23
+ export type IWikiInfo = Record<string, unknown>;
24
+
25
+ export interface ITiddlyWiki {
26
+ Wiki: typeof Wiki;
27
+ Story: typeof Story;
28
+ Tiddler: typeof Tiddler;
29
+
30
+ wiki: Wiki;
31
+ boot: IBoot;
32
+ crypto: Crypto;
33
+ utils: IUtils;
34
+ version: string;
35
+ safeMode: boolean;
36
+ config: IConfig;
37
+ rootWidget: Widget;
38
+ notifier: Notifier;
39
+ language: ILanguage;
40
+ modules: IModules;
41
+ locationHash: string;
42
+ passwordPrompt: PasswordPrompt;
43
+ packageInfo: Record<string, unknown>;
44
+
45
+ /**
46
+ * Check for this window being the source of the drag. If true, some drop target widget will stop responding to the drop event, so you can handle drop event in your own widget.
47
+ * Used by `DropZoneWidget.prototype.handleDropEvent`
48
+ */
49
+ dragInProgress?: boolean;
50
+
51
+ /**
52
+ * Global Hooks mechanism which allows plugins to modify default functionality
53
+ */
54
+ hooks: IHooks;
55
+
56
+ addUnloadTask(task: any);
57
+
58
+ /** Convenience function for pushing a tiddler onto the preloading array */
59
+ preloadTiddler(fields: Record<string, unknown>);
60
+ /** Convenience function for pushing an array of tiddlers onto the preloading array */
61
+ preloadTiddlerArray(fieldsArray: Array<Record<string, unknown>>): void;
62
+ /** External JavaScript can populate this array before calling boot.js in order to preload tiddlers */
63
+ preloadTiddlers: Record<string, Record<string, unknown>>;
64
+
65
+ getLibraryItemSearchPaths(libraryPath: string, envVar?: string): string;
66
+ findLibraryItem(name: string, paths: string[]): string | null;
67
+ loadPluginFolder(
68
+ filepath: string,
69
+ excludeRegExp?: RegExp,
70
+ ): IPluginInfo | null;
71
+ loadPlugin(name: string, paths: string[]): void;
72
+ loadPlugins(plugins: string[], libraryPath: string, envVar?: string): void;
73
+ loadWikiTiddlers(
74
+ wikiPath: string,
75
+ options?: { parentPaths?: string; readOnly?: boolean },
76
+ ): IWikiInfo;
77
+ loadTiddlersNode(): void;
78
+ loadTiddlersBrowser(): void;
79
+ loadTiddlersFromFile(
80
+ filepath: string,
81
+ defaultFields?: Record<string, unknown>,
82
+ ): {
83
+ filepath: string;
84
+ type: string;
85
+ tiddlers: ITiddlerFields[];
86
+ hasMetaFile: boolean;
87
+ };
88
+ loadMetadataForFile(filepath: string): ITiddlerFields | null;
89
+ loadTiddlersFromPath(
90
+ filepath: string,
91
+ excludeRegExp?: RegExp,
92
+ ): ITiddlerFields[];
93
+ loadTiddlersFromSpecification(
94
+ filepath: string,
95
+ excludeRegExp?: RegExp,
96
+ ): ITiddlerFields[];
97
+
98
+ browser: null | {
99
+ is?: {
100
+ android?: boolean;
101
+ bada?: boolean;
102
+ blackberry?: boolean;
103
+ chrome?: boolean;
104
+ firefox?: boolean;
105
+ firefoxos?: boolean;
106
+ gecko?: boolean;
107
+ ios?: boolean;
108
+ ipad?: boolean;
109
+ iphone?: boolean;
110
+ mobile?: boolean;
111
+ name?: boolean;
112
+ opera?: boolean;
113
+ phantomjs?: boolean;
114
+ safari?: boolean;
115
+ sailfish?: boolean;
116
+ seamonkey?: boolean;
117
+ silk?: boolean;
118
+ tizen?: boolean;
119
+ version?: boolean;
120
+ webkit?: boolean;
121
+ webos?: boolean;
122
+ windowsphone?: boolean;
123
+ };
124
+ /**
125
+ * @deprecated
126
+ * Install `$:/plugins/tiddlywiki/browser-sniff` to use `browser.is`
127
+ */
128
+ isFirefox: boolean;
129
+ /**
130
+ * @deprecated
131
+ * Install `$:/plugins/tiddlywiki/browser-sniff` to use `browser.is`
132
+ */
133
+ isIE: boolean;
134
+ };
135
+ /** NodeJS features, if tw isn't running on a NodeJS environment, the value will be `null` */
136
+ node: null | Record<string, any>;
137
+ /** Broswer features, if tw isn't running on a browser environment, the value will be `null` */
138
+ nodeWebKit: null | Record<string, any>;
139
+ }
140
+ }
package/src/hooks.d.ts ADDED
@@ -0,0 +1,83 @@
1
+ declare module 'tiddlywiki' {
2
+ interface IHooks {
3
+ names: Record<string, Function[]>;
4
+ /** Add hooks to the hashmap */
5
+ addHook(
6
+ hookName: 'th-server-command-post-start',
7
+ callback: (
8
+ server: unknown,
9
+ nodeServer: Server,
10
+ who: 'tiddlywiki',
11
+ ) => void,
12
+ );
13
+ addHook(
14
+ hookName: 'th-saving-tiddler',
15
+ callback: (toTiddler: Tiddler, fromTiddler: Tiddler) => Tiddler | void,
16
+ );
17
+ addHook(
18
+ hookName: 'th-renaming-tiddler',
19
+ callback: (toTiddler: Tiddler, fromTiddler: Tiddler) => Tiddler | void,
20
+ );
21
+ addHook(
22
+ hookName: 'th-relinking-tiddler',
23
+ callback: (toTiddler: Tiddler, fromTiddler: Tiddler) => Tiddler | void,
24
+ );
25
+ addHook(
26
+ hookName: 'th-importing-tiddler',
27
+ callback: (tiddler: Tiddler) => Tiddler | void,
28
+ );
29
+ addHook(
30
+ hookName: 'th-before-importing',
31
+ callback: (tiddler: Tiddler) => Tiddler | void,
32
+ );
33
+ addHook(
34
+ hookName: 'th-opening-default-tiddlers-list',
35
+ callback: (storyList: string[]) => string[],
36
+ );
37
+ addHook(
38
+ hookName: 'th-make-tiddler-path',
39
+ callback: (fullPath: string, fullPath: string) => string,
40
+ );
41
+ addHook(
42
+ hookName: 'th-rendering-element',
43
+ callback: (
44
+ parseTreeNodes: IParseTreeNode | null,
45
+ widget: Widget,
46
+ ) => parseTreeNodes,
47
+ );
48
+ addHook(hookName: 'th-navigating', callback: (event: unknown) => unknown);
49
+ addHook(
50
+ hookName: 'th-closing-tiddler',
51
+ callback: (event: unknown) => unknown,
52
+ );
53
+ addHook(
54
+ hookName: 'th-editing-tiddler',
55
+ callback: (event: unknown) => unknown,
56
+ );
57
+ addHook(
58
+ hookName: 'th-cancelling-tiddler',
59
+ callback: (event: unknown) => unknown,
60
+ );
61
+ addHook(hookName: 'th-new-tiddler', callback: (event: unknown) => unknown);
62
+ addHook(hookName: 'th-deleting-tiddler', callback: (title: string) => void);
63
+ addHook(hookName: 'th-page-refreshed', callback: () => void);
64
+ addHook(hookName: 'th-boot-tiddlers-loaded', callback: () => void);
65
+ addHook(hookName: 'th-page-refreshed', callback: () => void);
66
+ addHook(hookName: 'th-page-refreshing', callback: () => void);
67
+ addHook(hookName: 'th-page-refreshed', callback: () => void);
68
+ addHook(
69
+ hookName: 'th-importing-file',
70
+ callback: (props: {
71
+ file: unknown;
72
+ type: string;
73
+ isBinary: boolean;
74
+ callback: Function;
75
+ }) => boolean | void,
76
+ );
77
+ addHook(hookName: string, callback: (...arguments_: unknown[]) => unknown);
78
+ /**
79
+ * Invoke the hook by key
80
+ */
81
+ invokeHook(hookName: string, event: IWidgetEvent): undefined | IWidgetEvent;
82
+ }
83
+ }
package/src/index.d.ts CHANGED
@@ -1,19 +1,14 @@
1
- /// <reference path="tw.d.ts" />
2
- /// <reference path="server.d.ts" />
1
+ /// <reference path="core.d.ts" />
3
2
 
4
- import * as TW from 'tiddlywiki';
3
+ import { ITiddlyWiki } from 'tiddlywiki';
5
4
 
6
5
  export * from 'tiddlywiki';
6
+
7
+ declare module 'tiddlywiki' {
8
+ export type TW5InitFunction = (baseObject?: Record<string, unknown>) => ITiddlyWiki
9
+ export const TiddlyWiki: TW5InitFunction;
10
+ }
11
+
7
12
  declare global {
8
- const $tw: TW.ITiddlyWiki;
9
- // const Buffer: ?Buffer;
10
- // const clearInterval: typeof global.clearInterval;
11
- // const clearTimeout: typeof global.clearTimeout;
12
- // const console: Console;
13
- // const exports: TW.ITWModuleExports;
14
- // const module: { exports: TW.ITWModuleExports; readonly id: string };
15
- // const process: ?NodeJS.Process;
16
- // const require: ITWRequire;
17
- // const setInterval: typeof global.setInterval;
18
- // const setTimeout: typeof global.setTimeout;
13
+ export let $tw: ITiddlyWiki;
19
14
  }
@@ -1,3 +1,11 @@
1
+ /// <reference path="wiki.d.ts" />
2
+ /// <reference path="story.d.ts" />
3
+ /// <reference path="utils/index.d.ts" />
4
+ /// <reference path="server/index.d.ts" />
5
+ /// <reference path="parsers/index.d.ts" />
6
+ /// <reference path="widgets/index.d.ts" />
7
+ /// <reference path="parsers/index.d.ts" />
8
+
1
9
  declare module 'tiddlywiki' {
2
10
  export interface ITWModuleExports {
3
11
  [exportName: string]: unknown;
@@ -13,7 +21,7 @@ declare module 'tiddlywiki' {
13
21
  (title: string): ITWModuleExports;
14
22
  readonly main: NodeJS.Module | { TiddlyWiki: TW5InitFunction };
15
23
  }
16
- export interface IModuleSandbox {
24
+ export interface IEvalContent {
17
25
  $tw: ITiddlyWiki;
18
26
  // eslint-disable-next-line node/prefer-global/buffer
19
27
  Buffer?: Buffer;
@@ -32,6 +40,9 @@ declare module 'tiddlywiki' {
32
40
  exports: ITWModuleExports,
33
41
  requireFunction: ITWRequire,
34
42
  ) => void;
43
+
44
+ export type ITWModules = IModules;
45
+
35
46
  /**
36
47
  * Information about each module is kept in an object with these members:
37
48
  *
@@ -47,7 +58,7 @@ declare module 'tiddlywiki' {
47
58
  *
48
59
  * Each moduleInfo object is stored in two hashmaps: $tw.modules.titles and $tw.modules.types. The first is indexed by title and the second is indexed by type and then title
49
60
  */
50
- interface ITWModules {
61
+ interface IModules {
51
62
  /** Apply the exports of the modules of a particular type to a target object */
52
63
  applyMethods: (
53
64
  moduleType: string,
@@ -1,4 +1,58 @@
1
1
  declare module 'tiddlywiki' {
2
+ export interface IParserOptions {
3
+ /**
4
+ * Optional source uri, used in parseText
5
+ */
6
+ _canonical_uri?: string;
7
+ /**
8
+ * While calling `getCacheForTiddler`, use inlineParseTree or blockParseTree
9
+ */
10
+ parseAsInline?: boolean;
11
+ }
12
+
13
+ export class WikiParseRule {
14
+ is: { block?: boolean; inline?: boolean };
15
+
16
+ match?: unknown;
17
+
18
+ matchRegExp?: RegExp;
19
+
20
+ parser?: WikiParser;
21
+
22
+ nextTag?: unknown;
23
+
24
+ /** `{type: 'macrocall', start: 261, params: Array(1), name: 'reuse-tiddler', end: 290}` */
25
+ nextCall?: {
26
+ end: number;
27
+ name: string;
28
+ /** `{ type: 'macro-parameter'; start: 276; value: '快速创建新笔记按钮'; end: 288 }` */
29
+ params: { end: number; start: number; type: string; value: string };
30
+ start: number;
31
+ type: string;
32
+ };
33
+ }
34
+ export class WikiParser {
35
+ blockRules: { matchIndex?: number; rule: WikiParseRule }[];
36
+
37
+ inlineRules: { matchIndex?: number; rule: WikiParseRule }[];
38
+
39
+ pragmaRules: { matchIndex?: number; rule: WikiParseRule }[];
40
+
41
+ configTrimWhiteSpace: boolean;
42
+
43
+ pos: number;
44
+
45
+ source: string;
46
+
47
+ sourceLength: number;
48
+
49
+ type: string;
50
+
51
+ wiki: Wiki;
52
+
53
+ tree: IParseTreeNode[];
54
+ }
55
+
2
56
  export interface IParseTreeAttribute {
3
57
  end?: number;
4
58
  name?: string;
@@ -1,5 +1,3 @@
1
- /// <reference path="Wiki.d.ts" />
2
-
3
1
  import type Http from 'http';
4
2
 
5
3
  declare module 'tiddlywiki' {
@@ -0,0 +1,56 @@
1
+ declare module 'tiddlywiki' {
2
+ declare class Story {
3
+ wiki: Wiki;
4
+ storyTitle: string;
5
+ historyTitle: string;
6
+
7
+ constructor(options: {
8
+ wiki?: Wiki;
9
+ storyTitle?: string;
10
+ historyTitle?: string;
11
+ });
12
+
13
+ getStoryList(): string[];
14
+
15
+ navigateTiddler(
16
+ navigateTo: string,
17
+ navigateFromTitle: string,
18
+ navigateFromClientRect: DOMRect,
19
+ );
20
+
21
+ addToStory(
22
+ navigateTo: string,
23
+ navigateFromTitle: string,
24
+ options?: {
25
+ openLinkFromInsideRiver?: 'top' | 'bottom' | 'above' | 'below';
26
+ },
27
+ );
28
+
29
+ addToHistory(
30
+ navigateTo: string | string[],
31
+ navigateFromClientRect: DOMRect,
32
+ );
33
+
34
+ saveStoryList(storyList: string[] | string);
35
+
36
+ storyCloseTiddler(targetTitle: string);
37
+
38
+ storyCloseAllTiddlers();
39
+
40
+ storyCloseOtherTiddlers(targetTitle: string);
41
+
42
+ storyEditTiddler(targetTitle: string);
43
+
44
+ storyDeleteTiddler(targetTitle: string);
45
+
46
+ storySaveTiddler(targetTitle: string);
47
+
48
+ storyCancelTiddler(targetTitle: string);
49
+
50
+ storyNewTiddler(targetTitle: string);
51
+ }
52
+ }
53
+
54
+ declare module '$:/core/modules/story.js' {
55
+ export { Story } from 'tiddlywiki';
56
+ }
@@ -0,0 +1,51 @@
1
+ declare const addClass: (element: Element, className: string) => void;
2
+ declare const addEventListeners: (
3
+ domNode: Node,
4
+ events: {
5
+ handlerFunction?: (event: MouseEvent) => void;
6
+ handlerMethod?: string;
7
+ handlerObject?: Widget;
8
+ name: string;
9
+ }[],
10
+ ) => void;
11
+
12
+ declare class Notifier {
13
+ /**
14
+ * Display a notification
15
+ * * title: Title of tiddler containing the notification text
16
+ * * options: see below
17
+ * Options include:
18
+ */
19
+ display(title: string, options?: Record<string, unknown>): void;
20
+ }
21
+
22
+ declare module 'tiddlywiki' {
23
+ interface IUtils {
24
+ /**
25
+ * Alternative to `element.classList.add`, add a css class name to an element, see issue for detail.
26
+ * @link https://github.com/Jermolene/TiddlyWiki5/issues/6475
27
+ * @param element
28
+ * @param className
29
+ */
30
+ addClass: typeof addClass;
31
+ /**
32
+ * Attach specified event handlers to a DOM node
33
+ * @param domNode: where to attach the event handlers
34
+ * @param events: array of event handlers to be added (see below)
35
+ * Each entry in the events array is an object with these properties:
36
+ * * name: event name of `addEventListener`
37
+ * * handlerFunction: optional event handler function
38
+ * * handlerObject: optional event handler object
39
+ * * handlerMethod: optionally specifies object handler method name (defaults to `handleEvent`)
40
+ */
41
+ addEventListeners: typeof addEventListeners;
42
+ /**
43
+ * Notifier mechanism
44
+ */
45
+ Notifier: typeof Notifier;
46
+ }
47
+ }
48
+
49
+ declare module '$:/core/modules/utils/dom.js' {
50
+ export { addClass, addEventListeners, Notifier };
51
+ }
@@ -0,0 +1,33 @@
1
+ declare const generateTiddlerFilepath: (
2
+ title: string,
3
+ options?: {
4
+ directory?: string;
5
+ extension?: string;
6
+ fileInfo?: {
7
+ originalpath?: string;
8
+ filePath?: string;
9
+ writeError?: boolean;
10
+ };
11
+ pathFilters?: string[];
12
+ wiki?: Wiki;
13
+ },
14
+ ) => string;
15
+
16
+ declare module 'tiddlywiki' {
17
+ interface IUtils {
18
+ /**
19
+ * Generate the filepath for saving a tiddler
20
+ * Options include:
21
+ * * extension: file extension to be added the finished filepath
22
+ * * directory: absolute path of root directory to which we are saving
23
+ * * pathFilters: optional array of filters to be used to generate the base path
24
+ * * wiki: optional wiki for evaluating the pathFilters
25
+ * * fileInfo: an existing fileInfo object to check against
26
+ */
27
+ generateTiddlerFilepath: typeof generateTiddlerFilepath;
28
+ }
29
+ }
30
+
31
+ declare module '$:/core/modules/utils/utils.js' {
32
+ export { generateTiddlerFilepath };
33
+ }
@@ -0,0 +1,3 @@
1
+ /// <reference path="dom.d.ts" />
2
+ /// <reference path="utils.d.ts" />
3
+ /// <reference path="filesystem.d.ts" />
@@ -0,0 +1,25 @@
1
+ declare const count: (object: object) => number;
2
+ declare const hashString: (str: string) => number;
3
+ declare const formatDateString: (date: Date, format: string) => string;
4
+
5
+ declare module 'tiddlywiki' {
6
+ interface IUtils {
7
+ /**
8
+ * @en
9
+ * Return the number of keys in an object
10
+ * @zh
11
+ * 返回一个对象中的键的数量
12
+ */
13
+ count: typeof count;
14
+ /** the function behind `<<now "format">> */
15
+ formatDateString: typeof formatDateString;
16
+ /** Hash a string to a number
17
+ * Derived from http://stackoverflow.com/a/15710692
18
+ */
19
+ hashString: typeof hashString;
20
+ }
21
+ }
22
+
23
+ declare module '$:/core/modules/utils/utils.js' {
24
+ export { count, formatDateString, hashString };
25
+ }