Skip to content
Snippets Groups Projects
Commit 394b2183 authored by Christian Bager Bach Houmann's avatar Christian Bager Bach Houmann
Browse files

extend app type so I can remove //@ts-ignore

parent 31a38be1
No related branches found
No related tags found
No related merge requests found
import { App } from "obsidian";
interface Manifest {
author: string;
authorUrl: string;
description: string;
dir: string;
id: string;
isDesktopOnly: boolean;
minAppVersion: string;
name: string;
version: string;
}
// Not everything is implemented.
interface App2 extends App {
plugins: {
app: App;
enabledPlugins: Set<string>;
loadingPluginId: string;
manifests: Record<string, Manifest>;
plugins: Record<string, {
manifest: Manifest;
app: App,
}>;
requestSaveConfig: () => void;
updates: Record<string, any>;
enablePlugin: (id: string) => Promise<void>;
disablePlugin: (id: string) => Promise<void>;
};
}
export default App2;
......@@ -40,10 +40,12 @@ import DownloadedEpisodesController from "./store_controllers/DownloadedEpisodes
import { TFile } from "obsidian";
import { createMediaUrlObjectFromFilePath } from "./utility/createUrlObjectFromFilePath";
import { LocalFilesController } from "./store_controllers/LocalFilesController";
import PartialAppExtension from "./global";
export default class PodNotes extends Plugin implements IPodNotes {
public api: IAPI;
public settings: IPodNotesSettings;
public app: PartialAppExtension;
private view: MainView;
......@@ -176,7 +178,7 @@ export default class PodNotes extends Plugin implements IPodNotes {
name: "Reload PodNotes",
callback: () => {
const id = this.manifest.id;
//@ts-ignore
this.app.plugins
.disablePlugin(id)
.then(() => this.app.plugins.enablePlugin(id));
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment