mirror of
https://github.com/zen-browser/plugin.git
synced 2025-07-08 17:30:11 +02:00
Some formatting changes
This commit is contained in:
parent
2561cfb10d
commit
5296d86c05
1 changed files with 23 additions and 15 deletions
36
lib/main.d.ts
vendored
36
lib/main.d.ts
vendored
|
@ -1,4 +1,3 @@
|
||||||
|
|
||||||
export interface IZenPlugin {
|
export interface IZenPlugin {
|
||||||
name: string;
|
name: string;
|
||||||
version: string;
|
version: string;
|
||||||
|
@ -37,23 +36,31 @@ export interface ISandboxedTab {
|
||||||
readonly isSelected: boolean;
|
readonly isSelected: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
export type IPluginEventKey = "onInit" | "onUnload" | "onTabChange" | "onTabClose"
|
export type IPluginEventKey =
|
||||||
| "onTabOpen" | "onWorkspaceChange" | "onWorkspaceClose"
|
| "onInit"
|
||||||
| "onWorkspaceOpen" | "onPreferencesChange";
|
| "onUnload"
|
||||||
|
| "onTabChange"
|
||||||
|
| "onTabClose"
|
||||||
|
| "onTabOpen"
|
||||||
|
| "onWorkspaceChange"
|
||||||
|
| "onWorkspaceClose"
|
||||||
|
| "onWorkspaceOpen"
|
||||||
|
| "onPreferencesChange";
|
||||||
|
|
||||||
export type IPluginEventProps<T extends IPluginEventKey> =
|
export type IPluginEventProps<T extends IPluginEventKey> =
|
||||||
T extends "onInit" ? { }
|
T extends "onInit" ? {} :
|
||||||
: T extends "onUnload" ? { }
|
T extends "onUnload" ? {} :
|
||||||
: T extends "onTabChange" ? { tabId: string }
|
T extends "onTabChange" ? { tabId: string } :
|
||||||
: T extends "onTabClose" ? { tabId: string }
|
T extends "onTabClose" ? { tabId: string } :
|
||||||
: T extends "onTabOpen" ? { tabId: string }
|
T extends "onTabOpen" ? { tabId: string } :
|
||||||
: T extends "onWorkspaceChange" ? { workspace: IWorkspace }
|
T extends "onWorkspaceChange" ? { workspace: IWorkspace } :
|
||||||
: T extends "onWorkspaceClose" ? { workspace: IWorkspace }
|
T extends "onWorkspaceClose" ? { workspace: IWorkspace } :
|
||||||
: T extends "onWorkspaceOpen" ? { workspace: IWorkspace }
|
T extends "onWorkspaceOpen" ? { workspace: IWorkspace } :
|
||||||
: T extends "onPreferencesChange" ? { settings: IPluginSettings }
|
T extends "onPreferencesChange" ? { settings: IPluginSettings } :
|
||||||
: never;
|
never;
|
||||||
|
|
||||||
export type IPluginEvent<T extends IPluginEventKey> = (props: IPluginEventProps<T>) => void;
|
export type IPluginEvent<T extends IPluginEventKey> = (props: IPluginEventProps<T>) => void;
|
||||||
|
|
||||||
export type IPluginEvents = {
|
export type IPluginEvents = {
|
||||||
[K in IPluginEventKey]?: IPluginEvent<K>;
|
[K in IPluginEventKey]?: IPluginEvent<K>;
|
||||||
};
|
};
|
||||||
|
@ -69,6 +76,7 @@ export type IPluginContextMenu = {
|
||||||
};
|
};
|
||||||
|
|
||||||
export type IPluginSettings = IPluginSetting[];
|
export type IPluginSettings = IPluginSetting[];
|
||||||
|
|
||||||
export default IZenPlugin;
|
export default IZenPlugin;
|
||||||
|
|
||||||
// API
|
// API
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue