mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2025-01-05 23:10:28 +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/.cache/
|
||||
$__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 */
|
||||
"use strict";
|
||||
|
||||
/**
|
||||
* @typedef {import('$:/core/modules/widgets/widget.js').widget} Widget
|
||||
*/
|
||||
|
||||
/**
|
||||
* @type {Widget}
|
||||
*/
|
||||
var widget = require("$:/core/modules/widgets/widget.js");
|
||||
|
||||
var USER_NAME_TITLE = "$:/status/UserName",
|
||||
|
@ -13,6 +13,7 @@
|
||||
"bin": {
|
||||
"tiddlywiki": "./tiddlywiki.js"
|
||||
},
|
||||
"types": "./types",
|
||||
"main": "./boot/boot.js",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
|
@ -11,15 +11,16 @@
|
||||
"allowSyntheticDefaultImports": true,
|
||||
"checkJs": true,
|
||||
"declaration": true,
|
||||
"declarationDir": "types",
|
||||
"declarationDir": "types/generated",
|
||||
"declarationMap": true,
|
||||
"emitDeclarationOnly": true,
|
||||
"lib": ["ES2020", "DOM", "DOM.Iterable"],
|
||||
"module": "Node16",
|
||||
"outDir": "types",
|
||||
"rootDir": "core",
|
||||
"outDir": "types/generated",
|
||||
"rootDir": ".",
|
||||
"skipLibCheck": true,
|
||||
"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