diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml new file mode 100644 index 0000000..625daa5 --- /dev/null +++ b/.github/FUNDING.yml @@ -0,0 +1,2 @@ +patreon: zen_browser +ko_fi: zen_browser diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..d1f0d08 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,6 @@ +version: 2 +updates: + - package-ecosystem: "npm" + directory: "/" + schedule: + interval: "daily" diff --git a/LICENSE b/LICENSE index c028d70..5d84ec8 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ 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 of this software and associated documentation files (the "Software"), to deal diff --git a/README.md b/README.md index 0e7b7c4..6c9dac5 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,3 @@ -# plugin -📦 A plugin library interface for typescript projects +# Plugin Library Interface + +📦 A plugin library interface for TypeScript projects. diff --git a/lib/main.d.ts b/lib/main.d.ts index 032fbb8..fadae73 100644 --- a/lib/main.d.ts +++ b/lib/main.d.ts @@ -1,4 +1,3 @@ - export interface IZenPlugin { name: string; version: string; @@ -37,23 +36,31 @@ export interface ISandboxedTab { readonly isSelected: boolean; } -export type IPluginEventKey = "onInit" | "onUnload" | "onTabChange" | "onTabClose" - | "onTabOpen" | "onWorkspaceChange" | "onWorkspaceClose" - | "onWorkspaceOpen" | "onPreferencesChange"; +export type IPluginEventKey = + | "onInit" + | "onUnload" + | "onTabChange" + | "onTabClose" + | "onTabOpen" + | "onWorkspaceChange" + | "onWorkspaceClose" + | "onWorkspaceOpen" + | "onPreferencesChange"; -export type IPluginEventProps = - T extends "onInit" ? { } - : T extends "onUnload" ? { } - : T extends "onTabChange" ? { tabId: string } - : T extends "onTabClose" ? { tabId: string } - : T extends "onTabOpen" ? { tabId: string } - : T extends "onWorkspaceChange" ? { workspace: IWorkspace } - : T extends "onWorkspaceClose" ? { workspace: IWorkspace } - : T extends "onWorkspaceOpen" ? { workspace: IWorkspace } - : T extends "onPreferencesChange" ? { settings: IPluginSettings } - : never; +export type IPluginEventProps = + T extends "onInit" ? {} : + T extends "onUnload" ? {} : + T extends "onTabChange" ? { tabId: string } : + T extends "onTabClose" ? { tabId: string } : + T extends "onTabOpen" ? { tabId: string } : + T extends "onWorkspaceChange" ? { workspace: IWorkspace } : + T extends "onWorkspaceClose" ? { workspace: IWorkspace } : + T extends "onWorkspaceOpen" ? { workspace: IWorkspace } : + T extends "onPreferencesChange" ? { settings: IPluginSettings } : + never; export type IPluginEvent = (props: IPluginEventProps) => void; + export type IPluginEvents = { [K in IPluginEventKey]?: IPluginEvent; }; @@ -69,6 +76,7 @@ export type IPluginContextMenu = { }; export type IPluginSettings = IPluginSetting[]; + export default IZenPlugin; // API diff --git a/package.json b/package.json index ec8461a..7bc9caa 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "plugin", "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", "repository": { "type": "git",