import type { ComponentConfig, DocGeneratorConfig, WebComponentConfig } from './component-types';
import type { CspConfig } from './csp-types';
import type { CustomDirective, Middleware } from './directive-types';
import type { HeatmapConfig } from '../heatmap';
import type { MediaConfig } from '../media/types';
import type { MiddlewareMode } from '../route-middleware';
import type { PwaConfig } from './pwa-types';
/**
 * Internationalization (i18n) configuration
 */
export declare interface I18nConfig {
  defaultLocale: string
  locale: string
  translationsDir: string
  format: 'json' | 'yaml' | 'yml' | 'js'
  fallbackToKey: boolean
  cache: boolean
}
/**
 * Streaming configuration
 */
export declare interface StreamingConfig {
  enabled: boolean
  bufferSize: number
  strategy: 'auto' | 'manual' | 'sections'
  timeout: number
}
/**
 * Stream renderer for progressive loading
 */
export declare interface StreamRenderer {
  renderShell: (data?: Record<string, unknown>) => Promise<string>
  renderSection: (section: string, data?: Record<string, unknown>) => Promise<string>
  getSections: () => string[]
  getTemplate: () => string
}
/**
 * Hydration configuration
 */
export declare interface HydrationConfig {
  enabled: boolean
  mode: 'progressive' | 'islands'
  clientEntry: string
  autoMarkers: boolean
  preload: 'none' | 'eager' | 'lazy'
}
/**
 * Island definition for partial hydration
 */
export declare interface Island {
  id: string
  component: string
  props?: Record<string, unknown>
  priority?: 'eager' | 'lazy'
  shadowDOM?: boolean
}
/**
 * Accessibility configuration
 */
export declare interface A11yConfig {
  enabled: boolean
  addSrOnlyStyles: boolean
  level: 'AA' | 'AAA'
  ignoreChecks?: string[]
  autoFix: boolean
}
/**
 * SEO OpenGraph configuration
 */
export declare interface OpenGraphConfig {
  type?: string
  title?: string
  description?: string
  url?: string
  image?: string
  imageAlt?: string
  imageWidth?: number
  imageHeight?: number
  siteName?: string
}
/**
 * SEO Twitter card configuration
 */
export declare interface TwitterConfig {
  card?: 'summary' | 'summary_large_image' | 'app' | 'player'
  title?: string
  description?: string
  image?: string
  site?: string
  creator?: string
}
/**
 * SEO configuration
 */
export declare interface SeoConfig {
  title?: string
  description?: string
  keywords?: string[] | string
  robots?: string
  canonical?: string
  openGraph?: OpenGraphConfig
  twitter?: TwitterConfig
  structuredData?: Record<string, unknown>
}
/**
 * SEO features configuration
 */
export declare interface SeoFeatureConfig {
  enabled: boolean
  defaultConfig?: SeoConfig
  socialPreview?: boolean
  defaultImage?: string
}
/**
 * Analytics configuration for automatic script injection
 */
export declare interface AnalyticsConfig {
  enabled: boolean
  driver: AnalyticsDriver
  fathom?: {
    siteId: string
    scriptUrl?: string
    honorDnt?: boolean
    defer?: boolean
    spa?: boolean
    canonical?: string
    auto?: boolean
  }
  googleAnalytics?: {
    measurementId: string
    debug?: boolean
  }
  plausible?: {
    domain: string
    scriptUrl?: string
    trackLocalhost?: boolean
    hashMode?: boolean
  }
  selfHosted?: {
    siteId: string
    apiEndpoint: string
    honorDnt?: boolean
    trackHashChanges?: boolean
    trackOutboundLinks?: boolean
  }
  custom?: {
    scriptUrl: string
    scriptId?: string
    attributes?: Record<string, string>
    inlineScript?: string
  }
}
/**
 * Animation configuration
 */
export declare interface AnimationConfig {
  enabled: boolean
  defaultDuration: number
  defaultEase: string
  respectMotionPreferences: boolean
  staggerDelay: number
}
/**
 * Route middleware configuration
 */
export declare interface RouteMiddlewareConfig {
  enabled: boolean
  dir: string
  global?: string[]
  defaultMode: MiddlewareMode
}
/**
 * Loop directive configuration
 */
export declare interface LoopConfig {
  maxWhileIterations: number
  useAltLoopVariable: boolean
}
/**
 * Syntax highlighting configuration
 */
export declare interface SyntaxHighlightingConfig {
  enabled: boolean
  serverSide: boolean
  defaultTheme: SyntaxHighlightTheme
  highlightUnknownLanguages: boolean
  additionalThemes?: SyntaxHighlightTheme[]
}
/**
 * Markdown configuration
 */
export declare interface MarkdownConfig {
  enabled: boolean
  dir?: string
  syntaxHighlighting?: Partial<SyntaxHighlightingConfig>
}
/**
 * Configuration for form directives
 */
export declare interface FormConfig {
  classes?: {
    input?: string
    inputError?: string
    checkInput?: string
    label?: string
    errorFeedback?: string
  }
}
/**
 * Strict mode configuration for DOM API validation.
 * When enabled, stx warns (or errors) when client scripts use raw browser APIs
 * instead of framework composables.
 */
export declare interface StrictModeConfig {
  enabled: boolean
  failOnViolation?: boolean
  allowPatterns?: string[]
}
/**
 * Real-time broadcasting configuration.
 *
 * When enabled, stx starts a ts-broadcasting WebSocket server
 * alongside the dev server so pages can receive push events.
 */
export declare interface BroadcastingConfig {
  enabled?: boolean
  driver?: 'bun' | 'reverb' | 'pusher' | 'ably' | 'log' | 'null'
  host?: string
  port?: number
  scheme?: 'ws' | 'wss'
  verbose?: boolean
}
/**
 * App head configuration — auto-generates the document shell.
 * No .stx file needs to write <!DOCTYPE>, <html>, <head>, or <body>.
 */
export declare interface AppHeadConfig {
  title?: string
  lang?: string
  meta?: Array<Record<string, string>>
  link?: Array<Record<string, string>>
  script?: Array<{ src?: string, content?: string, [key: string]: any }>
  headRaw?: string
  bodyClass?: string
  bodyAttrs?: Record<string, string>
}
/**
 * stx configuration options
 */
export declare interface StxConfig {
  app?: {
    head?: AppHeadConfig
    window?: {
      width?: number
      height?: number
      darkMode?: boolean
      hotReload?: boolean
    }
  }
  root?: string
  pagesDir?: string
  templatesDir?: string
  defaultTitle?: string
  defaultDescription?: string
  defaultImage?: string
  ssr?: boolean
  cache?: boolean
  cacheDir?: string
  cacheVersion?: string
  enabled: boolean
  partialsDir: string
  componentsDir: string
  layoutsDir?: string
  storesDir?: string
  defaultLayout?: string
  plugins?: Array<string | [string, Record<string, any>]>
  publicDir?: string
  envFile?: string | boolean
  envPrefix?: string
  css?: string | { config?: string, content?: string[], preflight?: boolean, minify?: boolean }
  debug: boolean
  cachePath: string
  customDirectives?: CustomDirective[]
  middleware?: Middleware[]
  i18n?: Partial<I18nConfig>
  webComponents?: Partial<WebComponentConfig>
  docs?: Partial<DocGeneratorConfig>
  streaming?: Partial<StreamingConfig>
  hydration?: Partial<HydrationConfig>
  a11y?: Partial<A11yConfig>
  seo?: Partial<SeoFeatureConfig>
  analytics?: Partial<AnalyticsConfig>
  animation?: Partial<AnimationConfig>
  skipDefaultSeoTags?: boolean
  skipSignalsRuntime?: boolean
  skipEventDirectives?: boolean
  markdown?: Partial<MarkdownConfig>
  loops?: Partial<LoopConfig>
  forms?: Partial<FormConfig>
  csp?: Partial<CspConfig>
  story?: Partial<import('../story/types').StoryConfig>
  pwa?: Partial<PwaConfig>
  components?: Partial<ComponentConfig>
  routeMiddleware?: Partial<RouteMiddlewareConfig>
  heatmap?: Partial<HeatmapConfig>
  build?: Partial<BuildConfig>
  media?: Partial<MediaConfig>
  strict?: boolean | StrictModeConfig
  buildMode?: 'compile' | 'serve'
  autoShell?: boolean
  outputDir?: string
  shell?: string | false
  broadcasting?: Partial<BroadcastingConfig>
  apiRoutes?: Record<string, (request: Request) => Response | Promise<Response>>
  router?: {
    enabled?: boolean
    container?: string
    linkSelector?: string
    viewTransitions?: boolean
    viewTransitionDuration?: number
    viewTransitionEasing?: string
    scrollToTop?: boolean
    prefetch?: boolean
    cache?: boolean
    cacheTTL?: number
    skipSelectors?: string
    viewTransitionCSS?: Record<string, string>
    progressColor?: string
    progressHeight?: string
  }
  apiRouter?: { handleRequest: (request: Request) => Response | Promise<Response> }
}
/**
 * SSG Build configuration for static site generation
 */
export declare interface BuildConfig {
  pagesDir: string
  outputDir: string
  baseUrl: string
  domain?: string
  sitemap: boolean
  rss?: boolean | import('../ssg').RSSConfig
  minify: boolean
  cache: boolean
  cacheDir: string
  concurrency: number
  generate404: boolean
  publicDir: string
  trailingSlash: boolean
  cleanOutput: boolean
  revalidate?: number | false
}
/**
 * Analytics driver type
 */
export type AnalyticsDriver = 'fathom' | 'google-analytics' | 'plausible' | 'self-hosted' | 'custom';
/**
 * Available syntax highlighting themes
 */
export type SyntaxHighlightTheme = | 'css-variables'
  | 'dark-plus'
  | 'dracula'
  | 'dracula-soft'
  | 'github-dark'
  | 'github-dark-dimmed'
  | 'github-light'
  | 'hc_light'
  | 'light-plus'
  | 'material-theme'
  | 'material-theme-darker'
  | 'material-theme-lighter'
  | 'material-theme-ocean'
  | 'material-theme-palenight'
  | 'min-dark'
  | 'min-light'
  | 'monokai'
  | 'nord'
  | 'one-dark-pro'
  | 'poimandres'
  | 'rose-pine'
  | 'rose-pine-dawn'
  | 'rose-pine-moon'
  | 'slack-dark'
  | 'slack-ochin'
  | 'solarized-dark'
  | 'solarized-light'
  | 'vitesse-dark'
  | 'vitesse-light';
export type StxOptions = Partial<StxConfig>;
