mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2025-01-22 06:56:52 +00:00
feat: make $tw.wiki globally available
This commit is contained in:
parent
ac308e0f89
commit
b6f219aa82
1
.gitignore
vendored
1
.gitignore
vendored
@ -9,3 +9,4 @@ node_modules/
|
|||||||
/playwright-report/
|
/playwright-report/
|
||||||
/playwright/.cache/
|
/playwright/.cache/
|
||||||
$__StoryList.tid
|
$__StoryList.tid
|
||||||
|
types/generated/
|
||||||
|
1
core/globals.d.ts
vendored
1
core/globals.d.ts
vendored
@ -1 +0,0 @@
|
|||||||
declare var $tw: any;
|
|
@ -22,6 +22,13 @@ Adds the following properties to the wiki object:
|
|||||||
/*global $tw: false */
|
/*global $tw: false */
|
||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @typedef {import('$:/core/modules/widgets/widget.js').widget} Widget
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @type {Widget}
|
||||||
|
*/
|
||||||
var widget = require("$:/core/modules/widgets/widget.js");
|
var widget = require("$:/core/modules/widgets/widget.js");
|
||||||
|
|
||||||
var USER_NAME_TITLE = "$:/status/UserName",
|
var USER_NAME_TITLE = "$:/status/UserName",
|
||||||
|
@ -13,6 +13,7 @@
|
|||||||
"bin": {
|
"bin": {
|
||||||
"tiddlywiki": "./tiddlywiki.js"
|
"tiddlywiki": "./tiddlywiki.js"
|
||||||
},
|
},
|
||||||
|
"types": "./types",
|
||||||
"main": "./boot/boot.js",
|
"main": "./boot/boot.js",
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
|
@ -11,15 +11,16 @@
|
|||||||
"allowSyntheticDefaultImports": true,
|
"allowSyntheticDefaultImports": true,
|
||||||
"checkJs": true,
|
"checkJs": true,
|
||||||
"declaration": true,
|
"declaration": true,
|
||||||
"declarationDir": "types",
|
"declarationDir": "types/generated",
|
||||||
"declarationMap": true,
|
"declarationMap": true,
|
||||||
"emitDeclarationOnly": true,
|
"emitDeclarationOnly": true,
|
||||||
"lib": ["ES2020", "DOM", "DOM.Iterable"],
|
"lib": ["ES2020", "DOM", "DOM.Iterable"],
|
||||||
"module": "Node16",
|
"module": "Node16",
|
||||||
"outDir": "types",
|
"outDir": "types/generated",
|
||||||
"rootDir": "core",
|
"rootDir": ".",
|
||||||
"skipLibCheck": true,
|
"skipLibCheck": true,
|
||||||
"target": "ESNext"
|
"target": "ESNext"
|
||||||
},
|
},
|
||||||
"include": ["./core/**/*.js", "**/*.d.ts"]
|
"include": ["./core/**/*.js", "./core/**/*.d.ts", "types/tw.d.ts"],
|
||||||
|
"exclude": ["types/generated"]
|
||||||
}
|
}
|
||||||
|
7
types/tw.d.ts
vendored
Normal file
7
types/tw.d.ts
vendored
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
import * as Wiki from '../core/modules/wiki';
|
||||||
|
|
||||||
|
declare global {
|
||||||
|
var $tw: {
|
||||||
|
wiki: typeof Wiki;
|
||||||
|
};
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user