import type { CompiledTemplate } from './craft-ssr';
/**
 * Compile stx template to native Craft code
 */
export declare function compileToNative(template: string | CompiledTemplate, config?: Partial<CompilerConfig>): Promise<CompiledNativeCode>;
/**
 * Tree shake unused components
 */
declare function treeShake(ir: NativeIRNode, _deps: CompilerDependencyNode[]): NativeIRNode;
/**
 * Create hot reload server
 */
export declare function createHotReloadServer(_config: HotReloadConfig): {
  start: () => Promise<void>
  stop: () => Promise<void>
  notifyChange: (path: string) => void
};
/**
 * Default native component definitions
 */
declare const NATIVE_COMPONENTS: Map<string, NativeComponentDefinition>;
declare const craftCompiler: {
  compileToNative: typeof compileToNative
  createHotReloadServer: typeof createHotReloadServer
  NATIVE_COMPONENTS: typeof NATIVE_COMPONENTS
};
/**
 * Compiler configuration
 */
export declare interface CompilerConfig {
  target: CompilationTarget
  format: CompilationFormat
  optimize: boolean
  treeShake: boolean
  hotReload: boolean
  debug: boolean
  sourceMaps: boolean
  bundle: boolean
  minify: boolean
  components?: Map<string, NativeComponentDefinition>
}
/**
 * Native component definition
 */
export declare interface NativeComponentDefinition {
  name: string
  zigType: string
  props: NativePropDefinition[]
  children?: 'single' | 'multiple' | 'none'
  platform?: CompilationTarget[]
  fallback?: string
}
/**
 * Property definition for native components
 */
export declare interface NativePropDefinition {
  name: string
  type: 'string' | 'number' | 'boolean' | 'color' | 'callback' | 'object' | 'array'
  required: boolean
  default?: unknown
  zigType?: string
}
/**
 * Compiled native code output
 */
export declare interface CompiledNativeCode {
  code: string
  platformCode: Map<CompilationTarget, string>
  dependencies: CompilerDependencyNode[]
  manifest: ComponentManifest
  sourceMaps?: string
  stats: CompilationStats
}
/**
 * Dependency node in the graph
 */
export declare interface CompilerDependencyNode {
  id: string
  type: 'component' | 'style' | 'script' | 'asset'
  path: string
  dependencies: string[]
  size: number
  isStatic: boolean
}
/**
 * Component manifest
 */
export declare interface ComponentManifest {
  version: string
  components: ManifestComponent[]
  entry: string
  assets: ManifestAsset[]
  styles: string[]
}
/**
 * Component entry in manifest
 */
export declare interface ManifestComponent {
  name: string
  hash: string
  props: string[]
  events: string[]
  slots: string[]
  isNative: boolean
}
/**
 * Asset entry in manifest
 */
export declare interface ManifestAsset {
  path: string
  type: 'image' | 'font' | 'icon' | 'other'
  hash: string
  size: number
}
/**
 * Compilation statistics
 */
export declare interface CompilationStats {
  compilationTime: number
  totalComponents: number
  nativeComponents: number
  webComponents: number
  bundleSize: number
  treeShakenSize: number
  warnings: CompilationWarning[]
  errors: CompilationError[]
}
/**
 * Compilation warning
 */
export declare interface CompilationWarning {
  code: string
  message: string
  file?: string
  line?: number
  column?: number
}
/**
 * Compilation error
 */
export declare interface CompilationError extends CompilationWarning {
  fatal: boolean
}
/**
 * Native IR (Intermediate Representation) node
 */
export declare interface NativeIRNode {
  type: 'view' | 'text' | 'image' | 'button' | 'input' | 'scroll' | 'list' | 'custom'
  zigType: string
  props: Record<string, IRValue>
  children: NativeIRNode[]
  events: Map<string, string>
  styles: IRStyle
  id?: string
  key?: string
}
/**
 * IR style definition
 */
export declare interface IRStyle {
  layout: LayoutStyle
  appearance: AppearanceStyle
  text?: TextStyle
}
/**
 * Layout style properties
 */
export declare interface LayoutStyle {
  display?: 'flex' | 'grid' | 'block' | 'none'
  flexDirection?: 'row' | 'column'
  justifyContent?: 'start' | 'center' | 'end' | 'between' | 'around'
  alignItems?: 'start' | 'center' | 'end' | 'stretch'
  gap?: number
  padding?: number | [number, number, number, number]
  margin?: number | [number, number, number, number]
  width?: number | 'auto' | string
  height?: number | 'auto' | string
  minWidth?: number
  maxWidth?: number
  minHeight?: number
  maxHeight?: number
}
/**
 * Appearance style properties
 */
export declare interface AppearanceStyle {
  backgroundColor?: string
  borderColor?: string
  borderWidth?: number
  borderRadius?: number
  opacity?: number
  shadow?: ShadowStyle
}
/**
 * Shadow style
 */
export declare interface ShadowStyle {
  color: string
  offsetX: number
  offsetY: number
  blur: number
  spread: number
}
/**
 * Text style properties
 */
export declare interface TextStyle {
  fontFamily?: string
  fontSize?: number
  fontWeight?: 'normal' | 'bold' | 'light' | number
  color?: string
  textAlign?: 'left' | 'center' | 'right'
  lineHeight?: number
  letterSpacing?: number
}
/**
 * Hot reload configuration
 */
export declare interface HotReloadConfig {
  port: number
  watchPaths: string[]
  debounceMs: number
}
/**
 * Target platform for compilation
 */
export type CompilationTarget = 'macos' | 'windows' | 'linux' | 'ios' | 'android' | 'universal';
/**
 * Output format for compiled code
 */
export type CompilationFormat = 'zig' | 'typescript' | 'json' | 'binary';
/**
 * IR value types
 */
export type IRValue = | { type: 'literal'; value: string | number | boolean }
  | { type: 'binding'; path: string }
  | { type: 'expression'; code: string }
  | { type: 'callback'; handler: string }
// ============================================================================
// Exports
// ============================================================================
export {
  NATIVE_COMPONENTS,
};
export default craftCompiler;
