import type { SelectOption } from '../composables/cwa-select-input.js'; import type { ImageDownscaleOptions } from '../files/image-downscale.js'; import type { DefineComponent, GlobalComponents } from 'vue'; import type { CwaComponentName } from '#build/cwa-component-names'; export type GlobalComponentNames = keyof GlobalComponents; export type CwaAllowedComponent = CwaComponentName | `/${string}`; export type ManagerTab = GlobalComponentNames | DefineComponent; export type ComponentUi = GlobalComponentNames; export interface CwaResourceMeta { name?: string; description?: string; instantAdd?: boolean; defaultData?: Record; managerTabs?: ManagerTab[]; ui?: ComponentUi[]; } export interface CwaResourcesMeta { [type: string]: CwaResourceMeta; } export interface CwaUiMeta { name?: string; classes?: { [name: string]: string[] | string; }; } export type SiteConfigParams = { indexable: boolean; robotsAllowNonSeoCrawlers: boolean; robotsAllowAiBots: boolean; robotsText: string; robotsRemoveSitemap: boolean; sitemapEnabled: boolean; siteName: string; fallbackTitle: boolean; concatTitle: boolean; maintenanceModeEnabled: boolean; sitemapXml: string; canonicalUrl: string; }; export interface CwaModuleOptions { storeName: string; siteConfig: Partial; resources: CwaResourcesMeta; pagesDepth?: number; routeCacheLimit?: number; staticRender?: boolean; auth?: { clearCachesOnSessionEnd?: string[]; }; realtime?: { enabled?: boolean; }; upload?: { image?: Partial; }; pageCache?: { enabled?: boolean; sharedMaxAge?: number; staleWhileRevalidate?: number; }; sitemapCache?: { sharedMaxAge?: number; staleWhileRevalidate?: number; }; layouts?: { [type: string]: CwaUiMeta; }; pages?: { [type: string]: CwaUiMeta; }; pageData?: { [resourceClass: string]: Pick & { properties?: { [propertyName: string]: string; }; metaFields?: { field: string; type: 'input' | 'select'; label: string; options?: SelectOption[]; }[]; }; }; layoutName?: string; }