plugin.ts 858 B

123456789101112131415161718192021222324252627282930313233343536
  1. import { GrowiThemeMetadata, HasObjectId } 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. organizationName: string,
  18. origin: GrowiPluginOrigin,
  19. meta: M,
  20. }
  21. export type GrowiPluginMeta = {
  22. name: string,
  23. types: GrowiPluginResourceType[],
  24. desc?: string,
  25. author?: string,
  26. }
  27. export type GrowiThemePluginMeta = GrowiPluginMeta & {
  28. themes: GrowiThemeMetadata[]
  29. }
  30. export type GrowiPluginHasId = GrowiPlugin & HasObjectId;