mirror of
https://github.com/vrtmrz/obsidian-livesync.git
synced 2026-05-15 03:51:18 +00:00
20 lines
507 B
TypeScript
20 lines
507 B
TypeScript
/* eslint-disable no-restricted-globals */
|
|
import type { App } from "obsidian";
|
|
|
|
declare global {
|
|
var app: App & {
|
|
plugins: {
|
|
enabledPlugins: Set<string>;
|
|
enablePlugin: (name: string) => Promise<void>;
|
|
};
|
|
};
|
|
}
|
|
|
|
export const enablePlugin = async (pluginName: string) => {
|
|
return await window.app.plugins.enablePlugin(pluginName);
|
|
};
|
|
|
|
export const isPluginEnabled = (pluginName: string) => {
|
|
return window.app.plugins.enabledPlugins.has(pluginName);
|
|
};
|