export type HookName =
  | "mail.compose.toolbar"
  | "mail.compose.attachments"
  | "mail.sidebar.apps"
  | "admin.settings.panels"
  | "auth.post_login"
  | "message.pre_send";

export type ContributionType = "button" | "panel" | "modal" | "script";

export interface PluginEntrypoints {
  menu?: string;
  api?: string;
  ui?: string;
}

export interface HookContribution {
  hook: HookName;
  type: ContributionType;
  id: string;
  label: string;
  icon?: string;
  description?: string;
  order?: number;
  mount?: string;
  css?: string;
  permissions?: string[];
}

export interface PluginManifest {
  id: string;
  name: string;
  version: string;
  description?: string;
  entrypoints?: PluginEntrypoints;
  permissions?: string[];
  hooks?: HookName[];
  contributions?: Partial<Record<HookName, HookContribution[]>>;
  enabledByDefault?: boolean;
}

export interface ResolvedHookContribution extends HookContribution {
  pluginId: string;
  pluginName: string;
  pluginVersion: string;
  apiBase: string;
  uiBase: string;
  mountUrl?: string;
  cssUrl?: string;
}
