/**
 * IR Type System
 *
 * Explicitly typed, ownership-aware intermediate representation
 */
export declare enum Ownership {
    /** Unique ownership - exclusive access */
    Own = "own",
    /** Shared ownership - reference counted */
    Share = "share",
    /** Borrowed reference - non-owning pointer */
    Use = "use",
    /** Stack value - no ownership semantics */
    Value = "value"
}
export type IRType = {
    kind: 'primitive';
    type: PrimitiveType;
} | {
    kind: 'class';
    name: string;
    ownership: Ownership;
    typeArgs?: IRType[];
} | {
    kind: 'interface';
    name: string;
    ownership: Ownership;
    typeArgs?: IRType[];
} | {
    kind: 'struct';
    fields: Array<{
        name: string;
        type: IRType;
    }>;
    ownership: Ownership;
} | {
    kind: 'array';
    element: IRType;
    ownership: Ownership;
} | {
    kind: 'map';
    key: IRType;
    value: IRType;
    ownership: Ownership;
} | {
    kind: 'promise';
    resultType: IRType;
} | {
    kind: 'function';
    params: IRType[];
    returnType: IRType;
} | {
    kind: 'union';
    types: IRType[];
} | {
    kind: 'intersection';
    types: IRType[];
} | {
    kind: 'typeAlias';
    name: string;
    aliasedType: IRType;
} | {
    kind: 'nullable';
    inner: IRType;
};
export declare enum PrimitiveType {
    Number = "number",
    Integer = "integer",
    Integer53 = "integer53",
    String = "string",
    Boolean = "boolean",
    Void = "void",
    Never = "never"
}
/**
 * Source location for debugging and error reporting
 */
export interface SourceLocation {
    file: string;
    line: number;
    column: number;
}
export interface IRProgram {
    modules: IRModule[];
}
export interface IRModule {
    path: string;
    declarations: IRDeclaration[];
    imports: IRImport[];
    initStatements?: IRStatement[];
}
export interface IRImport {
    from: string;
    names: Array<{
        name: string;
        alias?: string;
    }>;
}
export interface IRExport {
    name: string;
    declaration?: IRDeclaration;
}
export type IRDeclaration = IRFunctionDecl | IRClassDecl | IRInterfaceDecl | IRTypeAliasDecl | IRConstDecl;
export interface IRConstDecl {
    kind: 'const';
    name: string;
    type: IRType;
    value: IRExpr;
    source?: SourceLocation;
}
export interface IRFunctionDecl {
    kind: 'function';
    name: string;
    params: IRParam[];
    returnType: IRType;
    body: IRFunctionBody | IRBlock;
    async?: boolean;
    typeParams?: IRTypeParam[];
    source?: SourceLocation;
}
/**
 * Function body containing AST-level statements
 * This is an intermediate form before SSA conversion
 */
export interface IRFunctionBody {
    statements: IRStatement[];
}
export interface IRClassDecl {
    kind: 'class';
    name: string;
    fields: IRField[];
    methods: IRMethod[];
    constructor?: IRConstructor;
    extends?: string;
    implements?: string[];
    typeParams?: IRTypeParam[];
    source?: SourceLocation;
}
export interface IRInterfaceDecl {
    kind: 'interface';
    name: string;
    properties: Array<{
        name: string;
        type: IRType;
        location?: SourceLocation;
    }>;
    methods: IRMethodSignature[];
    extends?: string[];
    typeParams?: IRTypeParam[];
}
export interface IRTypeAliasDecl {
    kind: 'typeAlias';
    name: string;
    type: IRType;
    typeParams?: IRTypeParam[];
}
export interface IRField {
    name: string;
    type: IRType;
    initializer?: IRExpr;
    isReadonly: boolean;
}
export interface IRMethod {
    name: string;
    params: IRParam[];
    returnType: IRType;
    body: IRFunctionBody;
    async?: boolean;
    isStatic: boolean;
}
export interface IRMethodSignature {
    name: string;
    params: IRParam[];
    returnType: IRType;
}
export interface IRConstructor {
    params: IRParam[];
    body: IRFunctionBody;
}
export interface IRParam {
    name: string;
    type: IRType;
}
export interface IRTypeParam {
    name: string;
    constraint?: IRType;
}
export interface IRBlock {
    id: number;
    instructions: IRInstruction[];
    terminator: IRTerminator;
}
export type IRInstruction = IRAssign | IRCall | IRFieldAssign | IRIndexAssign | IRMemberAssign | IRExprStmt;
export interface IRExprStmt {
    kind: 'expr';
    value: IRExpr;
}
export interface IRAssign {
    kind: 'assign';
    target: IRVariable;
    value: IRExpr;
    type: IRType;
    isDeclaration?: boolean;
}
export interface IRCall {
    kind: 'call';
    target?: IRVariable;
    callee: IRExpr;
    args: IRExpr[];
    type: IRType;
}
export interface IRFieldAssign {
    kind: 'fieldAssign';
    object: IRExpr;
    field: string;
    value: IRExpr;
}
export interface IRIndexAssign {
    kind: 'indexAssign';
    object: IRExpr;
    index: IRExpr;
    value: IRExpr;
}
export interface IRMemberAssign {
    kind: 'memberAssign';
    object: IRExpr;
    member: string;
    value: IRExpr;
}
export type IRTerminator = {
    kind: 'return';
    value?: IRExpr;
} | {
    kind: 'branch';
    condition: IRExpr;
    trueBranch: number;
    falseBranch: number;
} | {
    kind: 'jump';
    target: number;
} | {
    kind: 'unreachable';
};
export type IRExpr = IRLiteral | IRVariable | IRBinary | IRUnary | IRConditional | IRMemberAccess | IRIndexAccess | IRCallExpr | IRMethodCall | IRNew | IRArrayLiteral | IRObjectLiteral | IRLambda | IRMove | IRBorrow;
export interface IRLiteral {
    kind: 'literal';
    value: number | string | boolean | null;
    type: IRType;
    source?: SourceLocation;
}
export interface IRVariable {
    kind: 'variable';
    name: string;
    version: number;
    type: IRType;
    source?: SourceLocation;
}
export interface IRBinary {
    kind: 'binary';
    op: BinaryOp;
    left: IRExpr;
    right: IRExpr;
    type: IRType;
    source?: SourceLocation;
}
export interface IRUnary {
    kind: 'unary';
    op: UnaryOp;
    operand: IRExpr;
    type: IRType;
    source?: SourceLocation;
}
export interface IRConditional {
    kind: 'conditional';
    condition: IRExpr;
    whenTrue: IRExpr;
    whenFalse: IRExpr;
    type: IRType;
    source?: SourceLocation;
}
export interface IRMemberAccess {
    kind: 'member';
    object: IRExpr;
    member: string;
    optional?: boolean;
    type: IRType;
    source?: SourceLocation;
}
export interface IRIndexAccess {
    kind: 'index';
    object: IRExpr;
    index: IRExpr;
    type: IRType;
    source?: SourceLocation;
}
export interface IRCallExpr {
    kind: 'callExpr';
    callee: IRExpr;
    args: IRExpr[];
    type: IRType;
    source?: SourceLocation;
}
export interface IRMethodCall {
    kind: 'methodCall';
    object: IRExpr;
    method: string;
    args: IRExpr[];
    type: IRType;
    source?: SourceLocation;
}
export interface IRNew {
    kind: 'new';
    className: string;
    args: IRExpr[];
    type: IRType;
}
export interface IRArrayLiteral {
    kind: 'array';
    elements: IRExpr[];
    type: IRType;
}
export interface IRObjectLiteral {
    kind: 'object';
    properties: Array<{
        key: string;
        value: IRExpr;
    }>;
    type: IRType;
}
export interface IRLambda {
    kind: 'lambda';
    params: IRParam[];
    body: IRBlock;
    captures: Array<{
        name: string;
        type: IRType;
    }>;
    type: IRType;
}
export interface IRMove {
    kind: 'move';
    source: IRExpr;
    type: IRType;
}
export interface IRBorrow {
    kind: 'borrow';
    source: IRExpr;
    type: IRType;
}
export declare enum BinaryOp {
    Add = "+",
    Sub = "-",
    Mul = "*",
    Div = "/",
    Mod = "%",
    Eq = "==",
    Ne = "!=",
    Lt = "<",
    Le = "<=",
    Gt = ">",
    Ge = ">=",
    And = "&&",
    Or = "||"
}
export declare enum UnaryOp {
    Not = "!",
    Neg = "-",
    Plus = "+",
    Typeof = "typeof",
    Await = "await"
}
/**
 * AST-level expressions (before lowering to SSA)
 */
export type IRExpression = {
    kind: 'literal';
    value: number | string | boolean | null;
    type: IRType;
    location?: {
        line: number;
        column: number;
    };
} | {
    kind: 'identifier';
    name: string;
    type: IRType;
    location?: {
        line: number;
        column: number;
    };
} | {
    kind: 'binary';
    operator: BinaryOp;
    left: IRExpression;
    right: IRExpression;
    type: IRType;
    location?: {
        line: number;
        column: number;
    };
} | {
    kind: 'unary';
    operator: UnaryOp;
    operand: IRExpression;
    type: IRType;
    location?: {
        line: number;
        column: number;
    };
} | {
    kind: 'call';
    callee: IRExpression;
    arguments: IRExpression[];
    type: IRType;
    location?: {
        line: number;
        column: number;
    };
} | {
    kind: 'memberAccess';
    object: IRExpression;
    member: string;
    optional?: boolean;
    type: IRType;
    location?: {
        line: number;
        column: number;
    };
} | {
    kind: 'indexAccess';
    object: IRExpression;
    index: IRExpression;
    type: IRType;
    location?: {
        line: number;
        column: number;
    };
} | {
    kind: 'assignment';
    left: IRExpression;
    right: IRExpression;
    type: IRType;
    location?: {
        line: number;
        column: number;
    };
} | {
    kind: 'arrayLiteral';
    elements: IRExpression[];
    type: IRType;
    location?: {
        line: number;
        column: number;
    };
} | {
    kind: 'objectLiteral';
    properties: Array<{
        key: string;
        value: IRExpression;
    }>;
    type: IRType;
    location?: {
        line: number;
        column: number;
    };
} | {
    kind: 'newExpression';
    className: string;
    arguments: IRExpression[];
    type: IRType;
    location?: {
        line: number;
        column: number;
    };
} | {
    kind: 'conditional';
    condition: IRExpression;
    thenExpr: IRExpression;
    elseExpr: IRExpression;
    type: IRType;
    location?: {
        line: number;
        column: number;
    };
} | {
    kind: 'lambda';
    params: IRParam[];
    body: IRBlock;
    captures: Array<{
        name: string;
        type: IRType;
    }>;
    type: IRType;
    location?: {
        line: number;
        column: number;
    };
} | {
    kind: 'await';
    expression: IRExpression;
    type: IRType;
    location?: {
        line: number;
        column: number;
    };
};
/**
 * AST-level statements (before lowering to SSA)
 */
export type IRStatement = {
    kind: 'variableDeclaration';
    name: string;
    variableType: IRType;
    initializer?: IRExpression;
    location?: {
        line: number;
        column: number;
    };
} | {
    kind: 'assignment';
    target: string;
    value: IRExpression;
    location?: {
        line: number;
        column: number;
    };
} | {
    kind: 'expressionStatement';
    expression: IRExpression;
    location?: {
        line: number;
        column: number;
    };
} | {
    kind: 'return';
    value?: IRExpression;
    location?: {
        line: number;
        column: number;
    };
} | {
    kind: 'if';
    condition: IRExpression;
    thenBranch: IRStatement[];
    elseBranch?: IRStatement[];
    location?: {
        line: number;
        column: number;
    };
} | {
    kind: 'while';
    condition: IRExpression;
    body: IRStatement[];
    location?: {
        line: number;
        column: number;
    };
} | {
    kind: 'for';
    initializer?: IRStatement;
    condition?: IRExpression;
    increment?: IRExpression;
    body: IRStatement[];
    location?: {
        line: number;
        column: number;
    };
} | {
    kind: 'for-of';
    variable: string;
    variableType: IRType;
    iterable: IRExpression;
    body: IRStatement[];
    location?: {
        line: number;
        column: number;
    };
} | {
    kind: 'break';
    location?: {
        line: number;
        column: number;
    };
} | {
    kind: 'continue';
    location?: {
        line: number;
        column: number;
    };
} | {
    kind: 'try';
    tryBlock: IRStatement[];
    catchClause?: {
        variable: string;
        variableType: IRType;
        body: IRStatement[];
    };
    finallyBlock?: IRStatement[];
    location?: {
        line: number;
        column: number;
    };
} | {
    kind: 'throw';
    expression: IRExpression;
    location?: {
        line: number;
        column: number;
    };
} | {
    kind: 'block';
    statements: IRStatement[];
    location?: {
        line: number;
        column: number;
    };
};
//# sourceMappingURL=types.d.ts.map