/**
 * Binding manifest types - maps JS/TS names to CLR types/members
 * See spec/bindings.md for full manifest format
 */
import type { IrOverloadFamilyMember, IrParameter, IrType } from "../ir/index.js";
/**
 * Parameter modifier for ref/out/in parameters
 * Matches the format from tsbindgen: { index: number, modifier: "ref" | "out" | "in" }
 */
export type ParameterModifier = {
    readonly index: number;
    readonly modifier: "ref" | "out" | "in";
};
export type EmitCallStyle = "receiver" | "static";
export type EmitCallableStaticAccessorKind = "property" | "field";
export type EmitSemantics = {
    readonly callStyle?: EmitCallStyle;
    readonly callableStaticAccessorKind?: EmitCallableStaticAccessorKind;
};
export type TypeSemantics = {
    readonly contributesTypeIdentity: boolean;
};
export type BindingSemanticSignature = {
    readonly typeParameters?: readonly string[];
    readonly parameters: readonly IrParameter[];
    readonly returnType?: IrType;
};
export type BindingOverloadFamily = IrOverloadFamilyMember;
/**
 * Member binding (method/property level)
 */
export type MemberBinding = {
    readonly kind: "method" | "property";
    readonly signature?: string;
    readonly semanticType?: IrType;
    readonly semanticOptional?: boolean;
    readonly semanticSignature?: BindingSemanticSignature;
    readonly receiverExpectedType?: IrType;
    readonly overloadFamily?: BindingOverloadFamily;
    /** Total CLR parameter count (includes extension receiver for extension methods). */
    readonly parameterCount?: number;
    readonly name: string;
    readonly alias: string;
    readonly binding: {
        readonly assembly: string;
        readonly type: string;
        readonly member: string;
    };
    readonly parameterModifiers?: readonly ParameterModifier[];
    readonly isExtensionMethod?: boolean;
    readonly emitSemantics?: EmitSemantics;
    readonly sourceOrigin?: {
        readonly filePath: string;
        readonly exportName: string;
        readonly memberName?: string;
    };
};
/**
 * Type binding (class/interface/struct/enum level)
 */
export type TypeBinding = {
    readonly name: string;
    readonly alias: string;
    readonly kind: "class" | "interface" | "struct" | "enum";
    readonly members: readonly MemberBinding[];
};
/**
 * Namespace binding
 */
export type NamespaceBinding = {
    readonly name: string;
    readonly alias: string;
    readonly types: readonly TypeBinding[];
};
/**
 * Full binding manifest structure (new format from bindings.md)
 */
export type FullBindingManifest = {
    readonly assembly: string;
    readonly namespaces: readonly NamespaceBinding[];
};
/**
 * Simple binding entry for global/module identifiers
 * Maps identifiers like `console`, `Math`, `fs` to CLR types
 */
export type SimpleBindingDescriptor = {
    readonly kind: "global" | "module";
    readonly assembly: string;
    readonly type: string;
    readonly sourceImport?: string;
    readonly staticType?: string;
    readonly csharpName?: string;
    readonly typeSemantics?: TypeSemantics;
};
/**
 * Simple binding file structure for global/module bindings
 */
export type SimpleBindingFile = {
    readonly bindings: Readonly<Record<string, SimpleBindingDescriptor>>;
};
/**
 * tsbindgen format - generated by tsbindgen tool
 * This is the format produced when generating bindings from .NET assemblies
 */
export type TsbindgenMethod = {
    readonly clrName: string;
    /** Normalized signature string (tsbindgen metadata, used for extension receiver inference) */
    readonly normalizedSignature?: string;
    readonly semanticSignature?: BindingSemanticSignature;
    readonly overloadFamily?: BindingOverloadFamily;
    /** Total parameter count in CLR signature (includes extension receiver) */
    readonly parameterCount?: number;
    readonly declaringClrType: string;
    readonly declaringAssemblyName: string;
    readonly parameterModifiers?: readonly ParameterModifier[];
    readonly isExtensionMethod?: boolean;
    readonly emitSemantics?: EmitSemantics;
};
export type TsbindgenProperty = {
    readonly clrName: string;
    readonly normalizedSignature?: string;
    readonly semanticType?: IrType;
    readonly semanticOptional?: boolean;
    readonly declaringClrType: string;
    readonly declaringAssemblyName: string;
    readonly emitSemantics?: EmitSemantics;
};
export type TsbindgenField = {
    readonly clrName: string;
    readonly normalizedSignature?: string;
    readonly semanticType?: IrType;
    readonly semanticOptional?: boolean;
    readonly declaringClrType: string;
    readonly declaringAssemblyName: string;
    readonly emitSemantics?: EmitSemantics;
};
export type TsbindgenTypeRef = {
    readonly stableId?: string;
    readonly clrName: string;
    readonly typeArguments?: readonly string[];
};
export type TsbindgenType = {
    readonly clrName: string;
    readonly alias?: string;
    readonly assemblyName: string;
    readonly baseType?: TsbindgenTypeRef;
    readonly interfaces?: readonly TsbindgenTypeRef[];
    /**
     * CLR type kind from tsbindgen (e.g., "Class", "Interface", "Struct", "Enum").
     *
     * This is used for airplane-grade emission decisions (e.g., whether a name in
     * a TS `implements` clause is a CLR interface and should be emitted in the C#
     * heritage list).
     */
    readonly kind?: "Class" | "Interface" | "Struct" | "Enum";
    readonly methods: readonly TsbindgenMethod[];
    readonly properties: readonly TsbindgenProperty[];
    readonly fields: readonly TsbindgenField[];
};
/**
 * tsbindgen "flattened named export" descriptor.
 *
 * This is an additive surface to support JS-style named imports that bind to
 * a stable declaring CLR type + member (typically module container static types).
 *
 * Example (user code):
 *   import { buildSite } from "@tsumo/engine/Tsumo.Engine.js";
 *   buildSite(req);
 *
 * Example (bindings.json excerpt):
 *   "exports": {
 *     "buildSite": {
 *       "kind": "method",
 *       "clrName": "buildSite",
 *       "declaringClrType": "Tsumo.Engine.BuildSite",
 *       "declaringAssemblyName": "Tsumo.Engine"
 *     }
 *   }
 */
export type TsbindgenExport = {
    readonly kind: "method" | "property" | "field" | "functionType";
    readonly clrName: string;
    readonly declaringClrType: string;
    readonly declaringAssemblyName: string;
    readonly semanticType?: IrType;
    readonly semanticOptional?: boolean;
    readonly semanticSignature?: BindingSemanticSignature;
};
export type TsbindgenBindingFile = {
    readonly namespace: string;
    readonly types: readonly TsbindgenType[];
    readonly exports?: Readonly<Record<string, TsbindgenExport>>;
};
export type FirstPartySemanticSurfaceFile = {
    readonly types: readonly unknown[];
    readonly exports?: Readonly<Record<string, unknown>>;
};
export type FirstPartyBindingsFileV2 = {
    readonly namespace: string;
    readonly contributingAssemblies?: readonly string[];
    readonly producer: {
        readonly tool: "tsonic";
        readonly mode: "tsonic-firstparty";
    };
    readonly semanticSurface: FirstPartySemanticSurfaceFile;
    readonly dotnet: {
        readonly types: readonly TsbindgenType[];
        readonly exports?: Readonly<Record<string, TsbindgenExport>>;
    };
};
/**
 * Union type for all binding formats
 */
export type BindingFile = FullBindingManifest | SimpleBindingFile | TsbindgenBindingFile | FirstPartyBindingsFileV2;
/**
 * Type guard to check if a manifest is the full format
 */
export declare const isFullBindingManifest: (manifest: BindingFile) => manifest is FullBindingManifest;
/**
 * Type guard to check if a manifest is the tsbindgen format
 */
export declare const isTsbindgenBindingFile: (manifest: BindingFile) => manifest is TsbindgenBindingFile;
/**
 * Validate that a parsed JSON object is a valid binding file format.
 * Returns an error message if invalid, undefined if valid.
 */
export declare const validateBindingFile: (obj: unknown, filePath: string) => string | undefined;
//# sourceMappingURL=binding-types.d.ts.map