镜像自地址
https://github.com/bhsd-harry/Wikiplus-highlight.git
已同步 2024-06-03 03:40:35 +08:00
fix: load latest lib versions
这个提交包含在:
父节点
9c8b07c96c
当前提交
70b17dc2c0
11
src/index.d.ts
vendored
11
src/index.d.ts
vendored
|
@ -15,17 +15,6 @@ type MonacoOrPromise = MonacoEditor | Promise<MonacoEditor>;
|
|||
type CodeMirrorOrPromise = CodeMirror | Promise<CodeMirror>;
|
||||
|
||||
declare global {
|
||||
namespace mw {
|
||||
const libs: {
|
||||
wphl?: {
|
||||
version?: string;
|
||||
cmVersion: string;
|
||||
monacoVersion: string;
|
||||
useMonaco?: boolean;
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
interface Window {
|
||||
MonacoWikiEditor: MonacoOrPromise | undefined;
|
||||
CodeMirror6: CodeMirrorOrPromise | undefined;
|
||||
|
|
11
src/main.ts
11
src/main.ts
|
@ -4,14 +4,21 @@
|
|||
* @license GPL-3.0
|
||||
*/
|
||||
|
||||
declare interface WPHL {
|
||||
version?: string;
|
||||
cmVersion?: string;
|
||||
monacoVersion?: string;
|
||||
useMonaco?: boolean;
|
||||
}
|
||||
|
||||
((): void => {
|
||||
const {libs} = mw,
|
||||
const {libs} = mw as {libs: {wphl?: WPHL}},
|
||||
{wphl} = libs;
|
||||
if (wphl?.version) {
|
||||
return;
|
||||
}
|
||||
const version = '3.1.0';
|
||||
libs.wphl = {version, cmVersion: '2.9', monacoVersion: '0.2.2', ...wphl}; // 开始加载
|
||||
libs.wphl = {version, ...wphl}; // 开始加载
|
||||
|
||||
// 路径
|
||||
const CDN = '//testingcf.jsdelivr.net',
|
||||
|
|
正在加载...
在新工单中引用
屏蔽一个用户