summaryrefslogtreecommitdiff
path: root/frontend/src/plugin.ts
blob: 21d45654302ba8c510722f4377c7237bec1bd9f2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
export interface Plugin {
  name: string;
  version?: string;
  icon: JSX.Element;
  content?: JSX.Element;
  onDismount?(): void;
  alwaysRender?: boolean;
  titleView?: JSX.Element;
}

export enum InstallType {
  INSTALL,
  REINSTALL,
  UPDATE,
}

type installPluginArgs = [
  artifact: string,
  name?: string,
  version?: string,
  hash?: string | boolean,
  installType?: InstallType,
];

export let installPlugin = window.DeckyBackend.callable<installPluginArgs>('utilities/install_plugin');

type installPluginsArgs = [
  requests: {
    artifact: string;
    name?: string;
    version?: string;
    hash?: string | boolean;
    installType?: InstallType;
  }[],
];

export let installPlugins = window.DeckyBackend.callable<installPluginsArgs>('utilities/install_plugins');

export let uninstallPlugin = window.DeckyBackend.callable<[name: string]>('utilities/uninstall_plugin');