// TypeScript declarations for SwiftUI IR (Intermediate Representation)

import { Font, Font_TextStyle, Font_Weight } from "./IREnums.generated";
import { IRNodeModifiers } from "./IRModifiers.generated";
import { SwiftUIView } from "./SwiftUI";

export type IRColorParams = string | {
  r: number;
  g: number;
  b: number;
  a: number;
};

export type FontStyle = Font_TextStyle | {
  style: Font_TextStyle;
  size: number;
  weight: Font_Weight;
};

/** IR Node representing a SwiftUI view */
export declare class IRNode extends IRNodeModifiers {
  key: string | null;
  name: string;
  params: Record<string, any>;
  slots: Record<string, IRNode[]>;
  modifiers: Array<{ name: string; params: Record<string, any> }>;

  constructor(
    name: string,
    params?: Record<string, any>,
    slots?: Record<string, IRNode[]>
  );

  /** Set a unique key for diffing */
  setKey(k: string): this;
}

export type IRNodeChild = IRNode | SwiftUIView;

/** State decorator for reactive properties */
export declare const State: any;
export declare const main: any;

declare global {
  const IRNode: typeof import("./IRSwiftUI.d.ts").IRNode;
  const State: typeof import("./IRSwiftUI.d.ts").State;
  const main: typeof import("./IRSwiftUI.d.ts").main;
}
