Skip to content

Commit

Permalink
fix: load latest lib versions
Browse files Browse the repository at this point in the history
  • Loading branch information
bhsd-harry committed Apr 25, 2024
1 parent 9c8b07c commit 70b17dc
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 13 deletions.
11 changes: 0 additions & 11 deletions src/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
11 changes: 9 additions & 2 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down

0 comments on commit 70b17dc

Please sign in to comment.