obsidian-dev-utils 77.1.0 → 78.1.0
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/CHANGELOG.md +13 -0
- package/dist/dev/main.js +588 -239
- package/dist/lib/cjs/async.cjs +15 -1
- package/dist/lib/cjs/async.d.cts +8 -0
- package/dist/lib/cjs/html-element.cjs +16 -3
- package/dist/lib/cjs/html-element.d.cts +7 -0
- package/dist/lib/cjs/library.cjs +1 -1
- package/dist/lib/cjs/obsidian/bases-view-registrar.cjs +155 -0
- package/dist/lib/cjs/obsidian/bases-view-registrar.d.cts +52 -0
- package/dist/lib/cjs/obsidian/command-handlers/command-handler.cjs +1 -1
- package/dist/lib/cjs/obsidian/command-handlers/command-handler.d.cts +3 -3
- package/dist/lib/cjs/obsidian/components/rename-delete-handler-component.cjs +64 -53
- package/dist/lib/cjs/obsidian/editor-extension-registrar.cjs +155 -0
- package/dist/lib/cjs/obsidian/editor-extension-registrar.d.cts +37 -0
- package/dist/lib/cjs/obsidian/editor-suggest-registrar.cjs +155 -0
- package/dist/lib/cjs/obsidian/editor-suggest-registrar.d.cts +36 -0
- package/dist/lib/cjs/obsidian/extensions-registrar.cjs +155 -0
- package/dist/lib/cjs/obsidian/extensions-registrar.d.cts +51 -0
- package/dist/lib/cjs/obsidian/hover-link-source-registrar.cjs +155 -0
- package/dist/lib/cjs/obsidian/hover-link-source-registrar.d.cts +52 -0
- package/dist/lib/cjs/obsidian/index.cjs +28 -1
- package/dist/lib/cjs/obsidian/index.d.cts +9 -0
- package/dist/lib/cjs/obsidian/markdown-code-block-processor-registrar.cjs +5 -6
- package/dist/lib/cjs/obsidian/markdown-code-block-processor-registrar.d.cts +25 -9
- package/dist/lib/cjs/obsidian/markdown-post-processor-registrar.cjs +156 -0
- package/dist/lib/cjs/obsidian/markdown-post-processor-registrar.d.cts +57 -0
- package/dist/lib/cjs/obsidian/markdown.cjs +6 -8
- package/dist/lib/cjs/obsidian/modals/alert.cjs +11 -5
- package/dist/lib/cjs/obsidian/modals/confirm.cjs +11 -5
- package/dist/lib/cjs/obsidian/modals/confirm.d.cts +2 -10
- package/dist/lib/cjs/obsidian/modals/modal.cjs +16 -14
- package/dist/lib/cjs/obsidian/modals/modal.d.cts +22 -11
- package/dist/lib/cjs/obsidian/modals/prompt.cjs +11 -5
- package/dist/lib/cjs/obsidian/modals/prompt.d.cts +2 -6
- package/dist/lib/cjs/obsidian/modals/select-item.cjs +23 -16
- package/dist/lib/cjs/obsidian/modals/select-item.d.cts +3 -11
- package/dist/lib/cjs/obsidian/obsidian-protocol-handler-registrar.cjs +6 -6
- package/dist/lib/cjs/obsidian/obsidian-protocol-handler-registrar.d.cts +24 -10
- package/dist/lib/cjs/obsidian/plugin-cli-handler-registrar.cjs +156 -0
- package/dist/lib/cjs/obsidian/plugin-cli-handler-registrar.d.cts +64 -0
- package/dist/lib/cjs/obsidian/ribbon-icon-registrar.cjs +156 -0
- package/dist/lib/cjs/obsidian/ribbon-icon-registrar.d.cts +60 -0
- package/dist/lib/cjs/obsidian/setting-components/date-component.cjs +6 -2
- package/dist/lib/cjs/obsidian/setting-components/date-time-component.cjs +6 -2
- package/dist/lib/cjs/obsidian/setting-components/email-component.cjs +6 -2
- package/dist/lib/cjs/obsidian/setting-components/file-component.cjs +6 -2
- package/dist/lib/cjs/obsidian/setting-components/month-component.cjs +6 -2
- package/dist/lib/cjs/obsidian/setting-components/multiple-email-component.cjs +6 -2
- package/dist/lib/cjs/obsidian/setting-components/multiple-file-component.cjs +6 -2
- package/dist/lib/cjs/obsidian/setting-components/number-component.cjs +6 -2
- package/dist/lib/cjs/obsidian/setting-components/password-component.cjs +8 -4
- package/dist/lib/cjs/obsidian/setting-components/password-component.d.cts +2 -2
- package/dist/lib/cjs/obsidian/setting-components/telephone-component.cjs +8 -4
- package/dist/lib/cjs/obsidian/setting-components/telephone-component.d.cts +2 -2
- package/dist/lib/cjs/obsidian/setting-components/time-component.cjs +6 -2
- package/dist/lib/cjs/obsidian/setting-components/typed-text-component.cjs +6 -8
- package/dist/lib/cjs/obsidian/setting-components/typed-text-component.d.cts +19 -4
- package/dist/lib/cjs/obsidian/setting-components/url-component.cjs +6 -2
- package/dist/lib/cjs/obsidian/setting-components/week-component.cjs +6 -2
- package/dist/lib/cjs/obsidian/status-bar-item-registrar.cjs +153 -0
- package/dist/lib/cjs/obsidian/status-bar-item-registrar.d.cts +32 -0
- package/dist/lib/cjs/obsidian/view-registrar.cjs +4 -5
- package/dist/lib/cjs/obsidian/view-registrar.d.cts +20 -7
- package/dist/lib/cjs/script-utils/linters/over-exposure.cjs +241 -68
- package/dist/lib/cjs/script-utils/linters/over-exposure.d.cts +59 -6
- package/dist/lib/esm/async.d.mts +8 -0
- package/dist/lib/esm/async.mjs +14 -1
- package/dist/lib/esm/html-element.d.mts +7 -0
- package/dist/lib/esm/html-element.mjs +14 -2
- package/dist/lib/esm/library.mjs +1 -1
- package/dist/lib/esm/obsidian/bases-view-registrar.d.mts +52 -0
- package/dist/lib/esm/obsidian/bases-view-registrar.mjs +47 -0
- package/dist/lib/esm/obsidian/command-handlers/command-handler.d.mts +3 -3
- package/dist/lib/esm/obsidian/command-handlers/command-handler.mjs +1 -1
- package/dist/lib/esm/obsidian/components/rename-delete-handler-component.mjs +64 -53
- package/dist/lib/esm/obsidian/editor-extension-registrar.d.mts +37 -0
- package/dist/lib/esm/obsidian/editor-extension-registrar.mjs +47 -0
- package/dist/lib/esm/obsidian/editor-suggest-registrar.d.mts +36 -0
- package/dist/lib/esm/obsidian/editor-suggest-registrar.mjs +50 -0
- package/dist/lib/esm/obsidian/extensions-registrar.d.mts +51 -0
- package/dist/lib/esm/obsidian/extensions-registrar.mjs +47 -0
- package/dist/lib/esm/obsidian/hover-link-source-registrar.d.mts +52 -0
- package/dist/lib/esm/obsidian/hover-link-source-registrar.mjs +47 -0
- package/dist/lib/esm/obsidian/index.d.mts +9 -0
- package/dist/lib/esm/obsidian/index.mjs +19 -1
- package/dist/lib/esm/obsidian/markdown-code-block-processor-registrar.d.mts +25 -9
- package/dist/lib/esm/obsidian/markdown-code-block-processor-registrar.mjs +5 -6
- package/dist/lib/esm/obsidian/markdown-post-processor-registrar.d.mts +57 -0
- package/dist/lib/esm/obsidian/markdown-post-processor-registrar.mjs +48 -0
- package/dist/lib/esm/obsidian/markdown.mjs +10 -9
- package/dist/lib/esm/obsidian/modals/alert.mjs +11 -6
- package/dist/lib/esm/obsidian/modals/confirm.d.mts +2 -10
- package/dist/lib/esm/obsidian/modals/confirm.mjs +11 -6
- package/dist/lib/esm/obsidian/modals/modal.d.mts +22 -11
- package/dist/lib/esm/obsidian/modals/modal.mjs +16 -13
- package/dist/lib/esm/obsidian/modals/prompt.d.mts +2 -6
- package/dist/lib/esm/obsidian/modals/prompt.mjs +11 -6
- package/dist/lib/esm/obsidian/modals/select-item.d.mts +3 -11
- package/dist/lib/esm/obsidian/modals/select-item.mjs +23 -16
- package/dist/lib/esm/obsidian/obsidian-protocol-handler-registrar.d.mts +24 -10
- package/dist/lib/esm/obsidian/obsidian-protocol-handler-registrar.mjs +6 -6
- package/dist/lib/esm/obsidian/plugin-cli-handler-registrar.d.mts +64 -0
- package/dist/lib/esm/obsidian/plugin-cli-handler-registrar.mjs +48 -0
- package/dist/lib/esm/obsidian/ribbon-icon-registrar.d.mts +60 -0
- package/dist/lib/esm/obsidian/ribbon-icon-registrar.mjs +48 -0
- package/dist/lib/esm/obsidian/setting-components/date-component.mjs +6 -2
- package/dist/lib/esm/obsidian/setting-components/date-time-component.mjs +6 -2
- package/dist/lib/esm/obsidian/setting-components/email-component.mjs +6 -2
- package/dist/lib/esm/obsidian/setting-components/file-component.mjs +6 -2
- package/dist/lib/esm/obsidian/setting-components/month-component.mjs +6 -2
- package/dist/lib/esm/obsidian/setting-components/multiple-email-component.mjs +6 -2
- package/dist/lib/esm/obsidian/setting-components/multiple-file-component.mjs +6 -2
- package/dist/lib/esm/obsidian/setting-components/number-component.mjs +6 -2
- package/dist/lib/esm/obsidian/setting-components/password-component.d.mts +2 -2
- package/dist/lib/esm/obsidian/setting-components/password-component.mjs +8 -4
- package/dist/lib/esm/obsidian/setting-components/telephone-component.d.mts +2 -2
- package/dist/lib/esm/obsidian/setting-components/telephone-component.mjs +8 -4
- package/dist/lib/esm/obsidian/setting-components/time-component.mjs +6 -2
- package/dist/lib/esm/obsidian/setting-components/typed-text-component.d.mts +19 -4
- package/dist/lib/esm/obsidian/setting-components/typed-text-component.mjs +6 -8
- package/dist/lib/esm/obsidian/setting-components/url-component.mjs +6 -2
- package/dist/lib/esm/obsidian/setting-components/week-component.mjs +6 -2
- package/dist/lib/esm/obsidian/status-bar-item-registrar.d.mts +32 -0
- package/dist/lib/esm/obsidian/status-bar-item-registrar.mjs +45 -0
- package/dist/lib/esm/obsidian/view-registrar.d.mts +20 -7
- package/dist/lib/esm/obsidian/view-registrar.mjs +4 -5
- package/dist/lib/esm/script-utils/linters/over-exposure.d.mts +59 -6
- package/dist/lib/esm/script-utils/linters/over-exposure.mjs +242 -68
- package/dist/scripts/linters/over-exposure/find-overexposed-fix.ts +12 -0
- package/obsidian/bases-view-registrar/package.json +6 -0
- package/obsidian/editor-extension-registrar/package.json +6 -0
- package/obsidian/editor-suggest-registrar/package.json +6 -0
- package/obsidian/extensions-registrar/package.json +6 -0
- package/obsidian/hover-link-source-registrar/package.json +6 -0
- package/obsidian/markdown-post-processor-registrar/package.json +6 -0
- package/obsidian/plugin-cli-handler-registrar/package.json +6 -0
- package/obsidian/ribbon-icon-registrar/package.json +6 -0
- package/obsidian/status-bar-item-registrar/package.json +6 -0
- package/package.json +1 -1
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
/*
|
|
2
|
+
THIS IS A GENERATED/BUNDLED FILE BY ESBUILD
|
|
3
|
+
if you want to view the source, please visit the github repository of this plugin
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
(function initCjs() {
|
|
7
|
+
// eslint-disable-next-line obsidianmd/no-global-this -- Actively use globalThis.
|
|
8
|
+
const globalThisRecord = globalThis;
|
|
9
|
+
globalThisRecord['__name'] ??= name;
|
|
10
|
+
const originalRequire = require;
|
|
11
|
+
if (originalRequire && !originalRequire.__isPatched) {
|
|
12
|
+
// eslint-disable-next-line no-global-assign, no-implicit-globals -- We need to patch the `require()` function.
|
|
13
|
+
require = Object.assign(
|
|
14
|
+
(id) => requirePatched(id),
|
|
15
|
+
originalRequire,
|
|
16
|
+
{
|
|
17
|
+
__isPatched: true
|
|
18
|
+
}
|
|
19
|
+
);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
const newFuncs = {
|
|
23
|
+
__extractDefault() {
|
|
24
|
+
return extractDefault;
|
|
25
|
+
},
|
|
26
|
+
process() {
|
|
27
|
+
const browserProcess = {
|
|
28
|
+
browser: true,
|
|
29
|
+
cwd() {
|
|
30
|
+
return '/';
|
|
31
|
+
},
|
|
32
|
+
env: {},
|
|
33
|
+
platform: 'android'
|
|
34
|
+
};
|
|
35
|
+
return browserProcess;
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
for (const key of Object.keys(newFuncs)) {
|
|
40
|
+
globalThisRecord[key] ??= newFuncs[key]?.();
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
function name(obj) {
|
|
44
|
+
return obj;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
function extractDefault(module) {
|
|
48
|
+
return module && module.__esModule && 'default' in module ? module.default : module;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
const OBSIDIAN_BUILT_IN_MODULE_NAMES = [
|
|
52
|
+
'obsidian',
|
|
53
|
+
'@codemirror/autocomplete',
|
|
54
|
+
'@codemirror/collab',
|
|
55
|
+
'@codemirror/commands',
|
|
56
|
+
'@codemirror/language',
|
|
57
|
+
'@codemirror/lint',
|
|
58
|
+
'@codemirror/search',
|
|
59
|
+
'@codemirror/state',
|
|
60
|
+
'@codemirror/text',
|
|
61
|
+
'@codemirror/view',
|
|
62
|
+
'@lezer/common',
|
|
63
|
+
'@lezer/lr',
|
|
64
|
+
'@lezer/highlight'];
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
const DEPRECATED_OBSIDIAN_BUILT_IN_MODULE_NAMES = [
|
|
68
|
+
'@codemirror/closebrackets',
|
|
69
|
+
'@codemirror/comment',
|
|
70
|
+
'@codemirror/fold',
|
|
71
|
+
'@codemirror/gutter',
|
|
72
|
+
'@codemirror/highlight',
|
|
73
|
+
'@codemirror/history',
|
|
74
|
+
'@codemirror/matchbrackets',
|
|
75
|
+
'@codemirror/panel',
|
|
76
|
+
'@codemirror/rangeset',
|
|
77
|
+
'@codemirror/rectangular-selection',
|
|
78
|
+
'@codemirror/stream-parser',
|
|
79
|
+
'@codemirror/tooltip'];
|
|
80
|
+
|
|
81
|
+
|
|
82
|
+
function requirePatched(id) {
|
|
83
|
+
if (OBSIDIAN_BUILT_IN_MODULE_NAMES.includes(id) || DEPRECATED_OBSIDIAN_BUILT_IN_MODULE_NAMES.includes(id)) {
|
|
84
|
+
return originalRequire?.(id);
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
// eslint-disable-next-line @typescript-eslint/no-deprecated, obsidianmd/no-global-this -- Need access to app. Actively use globalThis.
|
|
88
|
+
if (globalThis.app.isMobile) {
|
|
89
|
+
if (id === 'process' || id === 'node:process') {
|
|
90
|
+
// eslint-disable-next-line no-console -- Valid usage.
|
|
91
|
+
console.debug(`The most likely you can safely ignore this error. Module not found: ${id}. Fake process object is returned instead.`);
|
|
92
|
+
// eslint-disable-next-line obsidianmd/no-global-this -- Actively use globalThis.
|
|
93
|
+
return globalThis.process;
|
|
94
|
+
}
|
|
95
|
+
} else {
|
|
96
|
+
const module = originalRequire?.(id);
|
|
97
|
+
if (module) {
|
|
98
|
+
return extractDefault(module);
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
// eslint-disable-next-line no-console -- Valid usage.
|
|
103
|
+
console.debug(`The most likely you can safely ignore this error. Module not found: ${id}. Empty object is returned instead.`);
|
|
104
|
+
return {};
|
|
105
|
+
}
|
|
106
|
+
})();
|
|
107
|
+
|
|
108
|
+
"use strict";
|
|
109
|
+
var __defProp = Object.defineProperty;
|
|
110
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
111
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
112
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
113
|
+
var __export = (target, all) => {
|
|
114
|
+
for (var name in all)
|
|
115
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
116
|
+
};
|
|
117
|
+
var __copyProps = (to, from, except, desc) => {
|
|
118
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
119
|
+
for (let key of __getOwnPropNames(from))
|
|
120
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
121
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
122
|
+
}
|
|
123
|
+
return to;
|
|
124
|
+
};
|
|
125
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
126
|
+
var editor_extension_registrar_exports = {};
|
|
127
|
+
__export(editor_extension_registrar_exports, {
|
|
128
|
+
PluginEditorExtensionRegistrar: () => PluginEditorExtensionRegistrar
|
|
129
|
+
});
|
|
130
|
+
module.exports = __toCommonJS(editor_extension_registrar_exports);
|
|
131
|
+
var import_obsidian = require('obsidian');
|
|
132
|
+
class PluginEditorExtensionRegistrar {
|
|
133
|
+
/**
|
|
134
|
+
* Creates a new instance of the {@link PluginEditorExtensionRegistrar} class.
|
|
135
|
+
*
|
|
136
|
+
* @param plugin - The Obsidian plugin instance.
|
|
137
|
+
*/
|
|
138
|
+
constructor(plugin) {
|
|
139
|
+
this.plugin = plugin;
|
|
140
|
+
}
|
|
141
|
+
plugin;
|
|
142
|
+
/**
|
|
143
|
+
* Registers an editor extension.
|
|
144
|
+
*
|
|
145
|
+
* @param extension - The editor extension to register.
|
|
146
|
+
*/
|
|
147
|
+
registerEditorExtension(extension) {
|
|
148
|
+
this.plugin.registerEditorExtension(extension);
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
152
|
+
0 && (module.exports = {
|
|
153
|
+
PluginEditorExtensionRegistrar
|
|
154
|
+
});
|
|
155
|
+
//# sourceMappingURL=data:application/json;base64,ewogICJ2ZXJzaW9uIjogMywKICAic291cmNlcyI6IFsiLi4vLi4vLi4vLi4vc3JjL29ic2lkaWFuL2VkaXRvci1leHRlbnNpb24tcmVnaXN0cmFyLnRzIl0sCiAgInNvdXJjZXNDb250ZW50IjogWyIvKipcbiAqIEBmaWxlXG4gKlxuICogRWRpdG9yIGV4dGVuc2lvbiByZWdpc3RyYXJzLlxuICovXG5cbmltcG9ydCB0eXBlIHsgRXh0ZW5zaW9uIH0gZnJvbSAnQGNvZGVtaXJyb3Ivc3RhdGUnO1xuXG5pbXBvcnQgeyBQbHVnaW4gfSBmcm9tICdvYnNpZGlhbic7XG5cbi8qKlxuICogRWRpdG9yIGV4dGVuc2lvbiByZWdpc3RyYXIuXG4gKi9cbmV4cG9ydCBpbnRlcmZhY2UgRWRpdG9yRXh0ZW5zaW9uUmVnaXN0cmFyIHtcbiAgLyoqXG4gICAqIFJlZ2lzdGVycyBhbiBlZGl0b3IgZXh0ZW5zaW9uLlxuICAgKlxuICAgKiBAcGFyYW0gZXh0ZW5zaW9uIC0gVGhlIGVkaXRvciBleHRlbnNpb24gdG8gcmVnaXN0ZXIuXG4gICAqL1xuICByZWdpc3RlckVkaXRvckV4dGVuc2lvbihleHRlbnNpb246IEV4dGVuc2lvbik6IHZvaWQ7XG59XG5cbi8qKlxuICogRWRpdG9yIGV4dGVuc2lvbiByZWdpc3RyYXIgaW4gYW4gT2JzaWRpYW4gcGx1Z2luLlxuICovXG5leHBvcnQgY2xhc3MgUGx1Z2luRWRpdG9yRXh0ZW5zaW9uUm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tBQUFoQjtBQUFBLEVBQWlCO0FBQUEsRUFBakI7QUFBQTtBQUFBO0FBQUE7QUFBQTtBQUFBO0FBQUEsRUFPN0Isd0JBQXdCLFdBQTRCO0FBQ3pELFNBQUssT0FBTyx3QkFBd0IsU0FBUztBQUFBLEVBQy9DO0FBQ0Y7IiwKICAibmFtZXMiOiBbXQp9Cg==
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/// <reference path="../library.d.cts" />
|
|
2
|
+
/**
|
|
3
|
+
* @file
|
|
4
|
+
*
|
|
5
|
+
* Editor extension registrars.
|
|
6
|
+
*/
|
|
7
|
+
import type { Extension } from '@codemirror/state';
|
|
8
|
+
import { Plugin } from 'obsidian';
|
|
9
|
+
/**
|
|
10
|
+
* Editor extension registrar.
|
|
11
|
+
*/
|
|
12
|
+
export interface EditorExtensionRegistrar {
|
|
13
|
+
/**
|
|
14
|
+
* Registers an editor extension.
|
|
15
|
+
*
|
|
16
|
+
* @param extension - The editor extension to register.
|
|
17
|
+
*/
|
|
18
|
+
registerEditorExtension(extension: Extension): void;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Editor extension registrar in an Obsidian plugin.
|
|
22
|
+
*/
|
|
23
|
+
export declare class PluginEditorExtensionRegistrar implements EditorExtensionRegistrar {
|
|
24
|
+
private readonly plugin;
|
|
25
|
+
/**
|
|
26
|
+
* Creates a new instance of the {@link PluginEditorExtensionRegistrar} class.
|
|
27
|
+
*
|
|
28
|
+
* @param plugin - The Obsidian plugin instance.
|
|
29
|
+
*/
|
|
30
|
+
constructor(plugin: Plugin);
|
|
31
|
+
/**
|
|
32
|
+
* Registers an editor extension.
|
|
33
|
+
*
|
|
34
|
+
* @param extension - The editor extension to register.
|
|
35
|
+
*/
|
|
36
|
+
registerEditorExtension(extension: Extension): void;
|
|
37
|
+
}
|
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
/*
|
|
2
|
+
THIS IS A GENERATED/BUNDLED FILE BY ESBUILD
|
|
3
|
+
if you want to view the source, please visit the github repository of this plugin
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
(function initCjs() {
|
|
7
|
+
// eslint-disable-next-line obsidianmd/no-global-this -- Actively use globalThis.
|
|
8
|
+
const globalThisRecord = globalThis;
|
|
9
|
+
globalThisRecord['__name'] ??= name;
|
|
10
|
+
const originalRequire = require;
|
|
11
|
+
if (originalRequire && !originalRequire.__isPatched) {
|
|
12
|
+
// eslint-disable-next-line no-global-assign, no-implicit-globals -- We need to patch the `require()` function.
|
|
13
|
+
require = Object.assign(
|
|
14
|
+
(id) => requirePatched(id),
|
|
15
|
+
originalRequire,
|
|
16
|
+
{
|
|
17
|
+
__isPatched: true
|
|
18
|
+
}
|
|
19
|
+
);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
const newFuncs = {
|
|
23
|
+
__extractDefault() {
|
|
24
|
+
return extractDefault;
|
|
25
|
+
},
|
|
26
|
+
process() {
|
|
27
|
+
const browserProcess = {
|
|
28
|
+
browser: true,
|
|
29
|
+
cwd() {
|
|
30
|
+
return '/';
|
|
31
|
+
},
|
|
32
|
+
env: {},
|
|
33
|
+
platform: 'android'
|
|
34
|
+
};
|
|
35
|
+
return browserProcess;
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
for (const key of Object.keys(newFuncs)) {
|
|
40
|
+
globalThisRecord[key] ??= newFuncs[key]?.();
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
function name(obj) {
|
|
44
|
+
return obj;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
function extractDefault(module) {
|
|
48
|
+
return module && module.__esModule && 'default' in module ? module.default : module;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
const OBSIDIAN_BUILT_IN_MODULE_NAMES = [
|
|
52
|
+
'obsidian',
|
|
53
|
+
'@codemirror/autocomplete',
|
|
54
|
+
'@codemirror/collab',
|
|
55
|
+
'@codemirror/commands',
|
|
56
|
+
'@codemirror/language',
|
|
57
|
+
'@codemirror/lint',
|
|
58
|
+
'@codemirror/search',
|
|
59
|
+
'@codemirror/state',
|
|
60
|
+
'@codemirror/text',
|
|
61
|
+
'@codemirror/view',
|
|
62
|
+
'@lezer/common',
|
|
63
|
+
'@lezer/lr',
|
|
64
|
+
'@lezer/highlight'];
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
const DEPRECATED_OBSIDIAN_BUILT_IN_MODULE_NAMES = [
|
|
68
|
+
'@codemirror/closebrackets',
|
|
69
|
+
'@codemirror/comment',
|
|
70
|
+
'@codemirror/fold',
|
|
71
|
+
'@codemirror/gutter',
|
|
72
|
+
'@codemirror/highlight',
|
|
73
|
+
'@codemirror/history',
|
|
74
|
+
'@codemirror/matchbrackets',
|
|
75
|
+
'@codemirror/panel',
|
|
76
|
+
'@codemirror/rangeset',
|
|
77
|
+
'@codemirror/rectangular-selection',
|
|
78
|
+
'@codemirror/stream-parser',
|
|
79
|
+
'@codemirror/tooltip'];
|
|
80
|
+
|
|
81
|
+
|
|
82
|
+
function requirePatched(id) {
|
|
83
|
+
if (OBSIDIAN_BUILT_IN_MODULE_NAMES.includes(id) || DEPRECATED_OBSIDIAN_BUILT_IN_MODULE_NAMES.includes(id)) {
|
|
84
|
+
return originalRequire?.(id);
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
// eslint-disable-next-line @typescript-eslint/no-deprecated, obsidianmd/no-global-this -- Need access to app. Actively use globalThis.
|
|
88
|
+
if (globalThis.app.isMobile) {
|
|
89
|
+
if (id === 'process' || id === 'node:process') {
|
|
90
|
+
// eslint-disable-next-line no-console -- Valid usage.
|
|
91
|
+
console.debug(`The most likely you can safely ignore this error. Module not found: ${id}. Fake process object is returned instead.`);
|
|
92
|
+
// eslint-disable-next-line obsidianmd/no-global-this -- Actively use globalThis.
|
|
93
|
+
return globalThis.process;
|
|
94
|
+
}
|
|
95
|
+
} else {
|
|
96
|
+
const module = originalRequire?.(id);
|
|
97
|
+
if (module) {
|
|
98
|
+
return extractDefault(module);
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
// eslint-disable-next-line no-console -- Valid usage.
|
|
103
|
+
console.debug(`The most likely you can safely ignore this error. Module not found: ${id}. Empty object is returned instead.`);
|
|
104
|
+
return {};
|
|
105
|
+
}
|
|
106
|
+
})();
|
|
107
|
+
|
|
108
|
+
"use strict";
|
|
109
|
+
var __defProp = Object.defineProperty;
|
|
110
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
111
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
112
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
113
|
+
var __export = (target, all) => {
|
|
114
|
+
for (var name in all)
|
|
115
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
116
|
+
};
|
|
117
|
+
var __copyProps = (to, from, except, desc) => {
|
|
118
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
119
|
+
for (let key of __getOwnPropNames(from))
|
|
120
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
121
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
122
|
+
}
|
|
123
|
+
return to;
|
|
124
|
+
};
|
|
125
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
126
|
+
var editor_suggest_registrar_exports = {};
|
|
127
|
+
__export(editor_suggest_registrar_exports, {
|
|
128
|
+
PluginEditorSuggestRegistrar: () => PluginEditorSuggestRegistrar
|
|
129
|
+
});
|
|
130
|
+
module.exports = __toCommonJS(editor_suggest_registrar_exports);
|
|
131
|
+
var import_obsidian = require('obsidian');
|
|
132
|
+
class PluginEditorSuggestRegistrar {
|
|
133
|
+
/**
|
|
134
|
+
* Creates a new instance of the {@link PluginEditorSuggestRegistrar} class.
|
|
135
|
+
*
|
|
136
|
+
* @param plugin - The Obsidian plugin instance.
|
|
137
|
+
*/
|
|
138
|
+
constructor(plugin) {
|
|
139
|
+
this.plugin = plugin;
|
|
140
|
+
}
|
|
141
|
+
plugin;
|
|
142
|
+
/**
|
|
143
|
+
* Registers an editor suggest.
|
|
144
|
+
*
|
|
145
|
+
* @param editorSuggest - The editor suggest to register.
|
|
146
|
+
*/
|
|
147
|
+
registerEditorSuggest(editorSuggest) {
|
|
148
|
+
this.plugin.registerEditorSuggest(editorSuggest);
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
152
|
+
0 && (module.exports = {
|
|
153
|
+
PluginEditorSuggestRegistrar
|
|
154
|
+
});
|
|
155
|
+
//# sourceMappingURL=data:application/json;base64,ewogICJ2ZXJzaW9uIjogMywKICAic291cmNlcyI6IFsiLi4vLi4vLi4vLi4vc3JjL29ic2lkaWFuL2VkaXRvci1zdWdnZXN0LXJlZ2lzdHJhci50cyJdLAogICJzb3VyY2VzQ29udGVudCI6IFsiLyoqXG4gKiBAZmlsZVxuICpcbiAqIEVkaXRvciBzdWdnZXN0IHJlZ2lzdHJhcnMuXG4gKi9cblxuaW1wb3J0IHtcbiAgRWRpdG9yU3VnZ2VzdCxcbiAgUGx1Z2luXG59IGZyb20gJ29ic2lkaWFuJztcblxuLyoqXG4gKiBFZGl0b3Igc3VnZ2VzdCByZWdpc3RyYXIuXG4gKi9cbmV4cG9ydCBpbnRlcmZhY2UgRWRpdG9yU3VnZ2VzdFJlZ2lzdHJhciB7XG4gIC8qKlxuICAgKiBSZWdpc3RlcnMgYW4gZWRpdG9yIHN1Z2dlc3QuXG4gICAqXG4gICAqIEBwYXJhbSBlZGl0b3JTdWdnZXN0IC0gVGhlIGVkaXRvciBzdWdnZXN0IHRvIHJlZ2lzdGVyLlxuICAgKi9cbiAgcmVnaXN0ZXJFZGl0b3JTdWdnZXN0KGVkaXRvclN1Z2dlc3Q6IEVkaXRvclN1Z2dlc3Q8dW5rbm93bj4pOiB2b2lkO1xufVxuXG4vKipcbiAqIEVka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UE7QUFBQTtBQUFBO0FBQUE7QUFBQTtBQU1BLHNCQUdPO0FBaUJBLE1BQU0sNkJBQStEO0FBQUE7QUFBQTtBQUFBO0FBQUE7QUFBQTtBQUFBLEVBTW5FLFlBQTZCLFFBQWdCO0FBQWhCO0FBQUEsRUFBaUI7QUFBQSxFQUFqQjtBQUFBO0FBQUE7QUFBQTtBQUFBO0FBQUE7QUFBQSxFQU83QixzQkFBc0IsZUFBNkM7QUFDeEUsU0FBSyxPQUFPLHNCQUFzQixhQUFhO0FBQUEsRUFDakQ7QUFDRjsiLAogICJuYW1lcyI6IFtdCn0K
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/// <reference path="../library.d.cts" />
|
|
2
|
+
/**
|
|
3
|
+
* @file
|
|
4
|
+
*
|
|
5
|
+
* Editor suggest registrars.
|
|
6
|
+
*/
|
|
7
|
+
import { EditorSuggest, Plugin } from 'obsidian';
|
|
8
|
+
/**
|
|
9
|
+
* Editor suggest registrar.
|
|
10
|
+
*/
|
|
11
|
+
export interface EditorSuggestRegistrar {
|
|
12
|
+
/**
|
|
13
|
+
* Registers an editor suggest.
|
|
14
|
+
*
|
|
15
|
+
* @param editorSuggest - The editor suggest to register.
|
|
16
|
+
*/
|
|
17
|
+
registerEditorSuggest(editorSuggest: EditorSuggest<unknown>): void;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Editor suggest registrar in an Obsidian plugin.
|
|
21
|
+
*/
|
|
22
|
+
export declare class PluginEditorSuggestRegistrar implements EditorSuggestRegistrar {
|
|
23
|
+
private readonly plugin;
|
|
24
|
+
/**
|
|
25
|
+
* Creates a new instance of the {@link PluginEditorSuggestRegistrar} class.
|
|
26
|
+
*
|
|
27
|
+
* @param plugin - The Obsidian plugin instance.
|
|
28
|
+
*/
|
|
29
|
+
constructor(plugin: Plugin);
|
|
30
|
+
/**
|
|
31
|
+
* Registers an editor suggest.
|
|
32
|
+
*
|
|
33
|
+
* @param editorSuggest - The editor suggest to register.
|
|
34
|
+
*/
|
|
35
|
+
registerEditorSuggest(editorSuggest: EditorSuggest<unknown>): void;
|
|
36
|
+
}
|
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
/*
|
|
2
|
+
THIS IS A GENERATED/BUNDLED FILE BY ESBUILD
|
|
3
|
+
if you want to view the source, please visit the github repository of this plugin
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
(function initCjs() {
|
|
7
|
+
// eslint-disable-next-line obsidianmd/no-global-this -- Actively use globalThis.
|
|
8
|
+
const globalThisRecord = globalThis;
|
|
9
|
+
globalThisRecord['__name'] ??= name;
|
|
10
|
+
const originalRequire = require;
|
|
11
|
+
if (originalRequire && !originalRequire.__isPatched) {
|
|
12
|
+
// eslint-disable-next-line no-global-assign, no-implicit-globals -- We need to patch the `require()` function.
|
|
13
|
+
require = Object.assign(
|
|
14
|
+
(id) => requirePatched(id),
|
|
15
|
+
originalRequire,
|
|
16
|
+
{
|
|
17
|
+
__isPatched: true
|
|
18
|
+
}
|
|
19
|
+
);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
const newFuncs = {
|
|
23
|
+
__extractDefault() {
|
|
24
|
+
return extractDefault;
|
|
25
|
+
},
|
|
26
|
+
process() {
|
|
27
|
+
const browserProcess = {
|
|
28
|
+
browser: true,
|
|
29
|
+
cwd() {
|
|
30
|
+
return '/';
|
|
31
|
+
},
|
|
32
|
+
env: {},
|
|
33
|
+
platform: 'android'
|
|
34
|
+
};
|
|
35
|
+
return browserProcess;
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
for (const key of Object.keys(newFuncs)) {
|
|
40
|
+
globalThisRecord[key] ??= newFuncs[key]?.();
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
function name(obj) {
|
|
44
|
+
return obj;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
function extractDefault(module) {
|
|
48
|
+
return module && module.__esModule && 'default' in module ? module.default : module;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
const OBSIDIAN_BUILT_IN_MODULE_NAMES = [
|
|
52
|
+
'obsidian',
|
|
53
|
+
'@codemirror/autocomplete',
|
|
54
|
+
'@codemirror/collab',
|
|
55
|
+
'@codemirror/commands',
|
|
56
|
+
'@codemirror/language',
|
|
57
|
+
'@codemirror/lint',
|
|
58
|
+
'@codemirror/search',
|
|
59
|
+
'@codemirror/state',
|
|
60
|
+
'@codemirror/text',
|
|
61
|
+
'@codemirror/view',
|
|
62
|
+
'@lezer/common',
|
|
63
|
+
'@lezer/lr',
|
|
64
|
+
'@lezer/highlight'];
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
const DEPRECATED_OBSIDIAN_BUILT_IN_MODULE_NAMES = [
|
|
68
|
+
'@codemirror/closebrackets',
|
|
69
|
+
'@codemirror/comment',
|
|
70
|
+
'@codemirror/fold',
|
|
71
|
+
'@codemirror/gutter',
|
|
72
|
+
'@codemirror/highlight',
|
|
73
|
+
'@codemirror/history',
|
|
74
|
+
'@codemirror/matchbrackets',
|
|
75
|
+
'@codemirror/panel',
|
|
76
|
+
'@codemirror/rangeset',
|
|
77
|
+
'@codemirror/rectangular-selection',
|
|
78
|
+
'@codemirror/stream-parser',
|
|
79
|
+
'@codemirror/tooltip'];
|
|
80
|
+
|
|
81
|
+
|
|
82
|
+
function requirePatched(id) {
|
|
83
|
+
if (OBSIDIAN_BUILT_IN_MODULE_NAMES.includes(id) || DEPRECATED_OBSIDIAN_BUILT_IN_MODULE_NAMES.includes(id)) {
|
|
84
|
+
return originalRequire?.(id);
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
// eslint-disable-next-line @typescript-eslint/no-deprecated, obsidianmd/no-global-this -- Need access to app. Actively use globalThis.
|
|
88
|
+
if (globalThis.app.isMobile) {
|
|
89
|
+
if (id === 'process' || id === 'node:process') {
|
|
90
|
+
// eslint-disable-next-line no-console -- Valid usage.
|
|
91
|
+
console.debug(`The most likely you can safely ignore this error. Module not found: ${id}. Fake process object is returned instead.`);
|
|
92
|
+
// eslint-disable-next-line obsidianmd/no-global-this -- Actively use globalThis.
|
|
93
|
+
return globalThis.process;
|
|
94
|
+
}
|
|
95
|
+
} else {
|
|
96
|
+
const module = originalRequire?.(id);
|
|
97
|
+
if (module) {
|
|
98
|
+
return extractDefault(module);
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
// eslint-disable-next-line no-console -- Valid usage.
|
|
103
|
+
console.debug(`The most likely you can safely ignore this error. Module not found: ${id}. Empty object is returned instead.`);
|
|
104
|
+
return {};
|
|
105
|
+
}
|
|
106
|
+
})();
|
|
107
|
+
|
|
108
|
+
"use strict";
|
|
109
|
+
var __defProp = Object.defineProperty;
|
|
110
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
111
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
112
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
113
|
+
var __export = (target, all) => {
|
|
114
|
+
for (var name in all)
|
|
115
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
116
|
+
};
|
|
117
|
+
var __copyProps = (to, from, except, desc) => {
|
|
118
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
119
|
+
for (let key of __getOwnPropNames(from))
|
|
120
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
121
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
122
|
+
}
|
|
123
|
+
return to;
|
|
124
|
+
};
|
|
125
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
126
|
+
var extensions_registrar_exports = {};
|
|
127
|
+
__export(extensions_registrar_exports, {
|
|
128
|
+
PluginExtensionsRegistrar: () => PluginExtensionsRegistrar
|
|
129
|
+
});
|
|
130
|
+
module.exports = __toCommonJS(extensions_registrar_exports);
|
|
131
|
+
var import_obsidian = require('obsidian');
|
|
132
|
+
class PluginExtensionsRegistrar {
|
|
133
|
+
/**
|
|
134
|
+
* Creates a new instance of the {@link PluginExtensionsRegistrar} class.
|
|
135
|
+
*
|
|
136
|
+
* @param plugin - The Obsidian plugin instance.
|
|
137
|
+
*/
|
|
138
|
+
constructor(plugin) {
|
|
139
|
+
this.plugin = plugin;
|
|
140
|
+
}
|
|
141
|
+
plugin;
|
|
142
|
+
/**
|
|
143
|
+
* Registers extensions.
|
|
144
|
+
*
|
|
145
|
+
* @param params - The parameters for the extensions registration.
|
|
146
|
+
*/
|
|
147
|
+
registerExtensions(params) {
|
|
148
|
+
this.plugin.registerExtensions(params.extensions, params.viewType);
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
152
|
+
0 && (module.exports = {
|
|
153
|
+
PluginExtensionsRegistrar
|
|
154
|
+
});
|
|
155
|
+
//# sourceMappingURL=data:application/json;base64,ewogICJ2ZXJzaW9uIjogMywKICAic291cmNlcyI6IFsiLi4vLi4vLi4vLi4vc3JjL29ic2lkaWFuL2V4dGVuc2lvbnMtcmVnaXN0cmFyLnRzIl0sCiAgInNvdXJjZXNDb250ZW50IjogWyIvKipcbiAqIEBmaWxlXG4gKlxuICogRXh0ZW5zaW9ucyByZWdpc3RyYXJzLlxuICovXG5cbmltcG9ydCB7IFBsdWdpbiB9IGZyb20gJ29ic2lkaWFuJztcblxuLyoqXG4gKiBFeHRlbnNpb25zIHJlZ2lzdHJhci5cbiAqL1xuZXhwb3J0IGludGVyZmFjZSBFeHRlbnNpb25zUmVnaXN0cmFyIHtcbiAgLyoqXG4gICAqIFJlZ2lzdGVycyBleHRlbnNpb25zLlxuICAgKlxuICAgKiBAcGFyYW0gcGFyYW1zIC0gVGhlIHBhcmFtZXRlcnMgZm9yIHRoZSBleHRlbnNpb25zIHJlZ2lzdHJhdGlvbi5cbiAgICovXG4gIHJlZ2lzdGVyRXh0ZW5zaW9ucyhwYXJhbXM6IEV4dGVuc2lvbnNS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/>
|
|
2
|
+
/**
|
|
3
|
+
* @file
|
|
4
|
+
*
|
|
5
|
+
* Extensions registrars.
|
|
6
|
+
*/
|
|
7
|
+
import { Plugin } from 'obsidian';
|
|
8
|
+
/**
|
|
9
|
+
* Extensions registrar.
|
|
10
|
+
*/
|
|
11
|
+
export interface ExtensionsRegistrar {
|
|
12
|
+
/**
|
|
13
|
+
* Registers extensions.
|
|
14
|
+
*
|
|
15
|
+
* @param params - The parameters for the extensions registration.
|
|
16
|
+
*/
|
|
17
|
+
registerExtensions(params: ExtensionsRegistrarRegisterExtensionsParams): void;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Parameters for registering extensions.
|
|
21
|
+
*/
|
|
22
|
+
export interface ExtensionsRegistrarRegisterExtensionsParams {
|
|
23
|
+
/**
|
|
24
|
+
* The extensions to register.
|
|
25
|
+
*/
|
|
26
|
+
readonly extensions: string[];
|
|
27
|
+
/**
|
|
28
|
+
* The view type to register the extensions for.
|
|
29
|
+
*/
|
|
30
|
+
readonly viewType: string;
|
|
31
|
+
}
|
|
32
|
+
type PluginExtensionsRegistrarRegisterExtensionsParams = ExtensionsRegistrarRegisterExtensionsParams;
|
|
33
|
+
/**
|
|
34
|
+
* Extensions registrar in an Obsidian plugin.
|
|
35
|
+
*/
|
|
36
|
+
export declare class PluginExtensionsRegistrar implements ExtensionsRegistrar {
|
|
37
|
+
private readonly plugin;
|
|
38
|
+
/**
|
|
39
|
+
* Creates a new instance of the {@link PluginExtensionsRegistrar} class.
|
|
40
|
+
*
|
|
41
|
+
* @param plugin - The Obsidian plugin instance.
|
|
42
|
+
*/
|
|
43
|
+
constructor(plugin: Plugin);
|
|
44
|
+
/**
|
|
45
|
+
* Registers extensions.
|
|
46
|
+
*
|
|
47
|
+
* @param params - The parameters for the extensions registration.
|
|
48
|
+
*/
|
|
49
|
+
registerExtensions(params: PluginExtensionsRegistrarRegisterExtensionsParams): void;
|
|
50
|
+
}
|
|
51
|
+
export {};
|