plugin.ts 758 B

123456789101112131415161718192021222324252627282930313233
  1. import { GrowiThemeMetadata } from '@growi/core';
  2. export const GrowiPluginResourceType = {
  3. Template: 'template',
  4. Style: 'style',
  5. Theme: 'theme',
  6. Script: 'script',
  7. } as const;
  8. export type GrowiPluginResourceType = typeof GrowiPluginResourceType[keyof typeof GrowiPluginResourceType];
  9. export type GrowiPluginOrigin = {
  10. url: string,
  11. ghBranch?: string,
  12. ghTag?: string,
  13. }
  14. export type GrowiPlugin<M extends GrowiPluginMeta = GrowiPluginMeta> = {
  15. isEnabled: boolean,
  16. installedPath: string,
  17. origin: GrowiPluginOrigin,
  18. meta: M,
  19. }
  20. export type GrowiPluginMeta = {
  21. name: string,
  22. types: GrowiPluginResourceType[],
  23. desc?: string,
  24. author?: string,
  25. }
  26. export type GrowiThemePluginMeta = GrowiPluginMeta & {
  27. themes: GrowiThemeMetadata[]
  28. }