mirror of
https://github.com/zen-browser/plugin.git
synced 2025-07-08 17:30:11 +02:00
Merge 62defc15ee
into 2561cfb10d
This commit is contained in:
commit
c6fde6dfff
6 changed files with 36 additions and 19 deletions
2
.github/FUNDING.yml
vendored
Normal file
2
.github/FUNDING.yml
vendored
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
patreon: zen_browser
|
||||||
|
ko_fi: zen_browser
|
6
.github/dependabot.yml
vendored
Normal file
6
.github/dependabot.yml
vendored
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
version: 2
|
||||||
|
updates:
|
||||||
|
- package-ecosystem: "npm"
|
||||||
|
directory: "/"
|
||||||
|
schedule:
|
||||||
|
interval: "daily"
|
2
LICENSE
2
LICENSE
|
@ -1,6 +1,6 @@
|
||||||
MIT License
|
MIT License
|
||||||
|
|
||||||
Copyright (c) 2024 Zen Browser
|
Copyright (c) 2025 Zen Browser
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
of this software and associated documentation files (the "Software"), to deal
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
|
|
|
@ -1,2 +1,3 @@
|
||||||
# plugin
|
# Plugin Library Interface
|
||||||
📦 A plugin library interface for typescript projects
|
|
||||||
|
📦 A plugin library interface for TypeScript projects.
|
||||||
|
|
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
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
{
|
{
|
||||||
"name": "plugin",
|
"name": "plugin",
|
||||||
"version": "1.0.0",
|
"version": "1.0.0",
|
||||||
"description": "📦 A plugin library interface for typescript projects",
|
"description": "📦 A plugin library interface for TypeScript projects",
|
||||||
"types": "./lib/main.d.ts",
|
"types": "./lib/main.d.ts",
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue