import { z } from 'zod';
import type { Openapi, OpenapiAuthMethod, OpenapiOperation, OpenapiSchema } from './openapi/types.js';
import { type CodeSample, type CodeSampleDefinition, type ResourceSample, type ResourceSampleDefinition, type SyntaxName } from './samples/index.js';
import { type SeamAuthMethod, type SeamWorkspaceScope } from './seam.js';
export interface Blueprint {
    title: string;
    routes: Route[];
    namespaces: Namespace[];
    resources: Resource[];
    pagination: Pagination | null;
    events: EventResource[];
    actionAttempts: ActionAttempt[];
}
export interface Route {
    path: string;
    name: string;
    namespacePath: string | null;
    endpoints: Endpoint[];
    parentPath: string | null;
    isUndocumented: boolean;
    isDeprecated: boolean;
    isDraft: boolean;
}
export interface Resource {
    resourceType: string;
    properties: Property[];
    description: string;
    routePath: string;
    isDeprecated: boolean;
    deprecationMessage: string;
    isUndocumented: boolean;
    undocumentedMessage: string;
    isDraft: boolean;
    draftMessage: string;
    propertyGroups: PropertyGroup[];
    resourceSamples: ResourceSample[];
}
export interface PropertyGroup {
    name: string;
    propertyGroupKey: string;
}
export interface VariantGroup {
    name: string;
    variantGroupKey: string;
}
export interface Pagination {
    properties: Property[];
    description: string;
    responseKey: string;
}
export interface EventResource extends Resource {
    resourceType: 'event';
    eventType: string;
}
export interface ActionAttempt extends Resource {
    resourceType: 'action_attempt';
    actionAttemptType: string;
}
export interface Namespace {
    name: string;
    path: string;
    parentPath: string | null;
    isDeprecated: boolean;
    isUndocumented: boolean;
    isDraft: boolean;
}
export interface Endpoint {
    title: string;
    path: string;
    name: string;
    parentPath: string | null;
    description: string;
    isDeprecated: boolean;
    deprecationMessage: string;
    isUndocumented: boolean;
    undocumentedMessage: string;
    isDraft: boolean;
    draftMessage: string;
    request: Request;
    response: Response;
    hasPagination: boolean;
    codeSamples: CodeSample[];
    authMethods: SeamAuthMethod[];
    workspaceScope: SeamWorkspaceScope;
}
interface BaseParameter {
    name: string;
    description: string;
    isRequired: boolean;
    isDeprecated: boolean;
    deprecationMessage: string;
    isUndocumented: boolean;
    undocumentedMessage: string;
    isDraft: boolean;
    draftMessage: string;
    hasDefault: boolean;
}
interface StringParameter extends BaseParameter {
    format: 'string';
    jsonType: 'string';
    default?: string | null;
}
interface NumberParameter extends BaseParameter {
    format: 'number';
    jsonType: 'number';
    default?: number | null;
}
interface EnumParameter extends BaseParameter {
    format: 'enum';
    jsonType: 'string';
    values: EnumValue[];
    default?: string | null;
}
interface RecordParameter extends BaseParameter {
    format: 'record';
    jsonType: 'object';
}
interface BaseListParameter extends BaseParameter {
    format: 'list';
    jsonType: 'array';
}
type ListParameter = StringListParameter | NumberListParameter | BooleanListParameter | DatetimeListParameter | IdListParameter | EnumListParameter | ObjectListParameter | RecordListParameter | DiscriminatedListParameter;
interface StringListParameter extends BaseListParameter {
    itemFormat: 'string';
    default?: string[];
}
interface NumberListParameter extends BaseListParameter {
    itemFormat: 'number';
    default?: number[];
}
interface BooleanListParameter extends BaseListParameter {
    itemFormat: 'boolean';
    default?: boolean[];
}
interface DatetimeListParameter extends BaseListParameter {
    itemFormat: 'datetime';
    default?: string[];
}
interface IdListParameter extends BaseListParameter {
    itemFormat: 'id';
    default?: string[];
}
interface EnumListParameter extends BaseListParameter {
    itemFormat: 'enum';
    itemEnumValues: EnumValue[];
    default?: EnumValue[];
}
interface ObjectListParameter extends BaseListParameter {
    itemFormat: 'object';
    itemParameters: Parameter[];
}
interface RecordListParameter extends BaseListParameter {
    itemFormat: 'record';
}
interface DiscriminatedListParameter extends BaseListParameter {
    itemFormat: 'discriminated_object';
    discriminator: string;
    variants: Array<{
        parameters: Parameter[];
        description: BaseParameter['description'];
    }>;
}
interface BooleanParameter extends BaseParameter {
    format: 'boolean';
    jsonType: 'boolean';
    default?: boolean | null;
}
interface ObjectParameter extends BaseParameter {
    format: 'object';
    jsonType: 'object';
    parameters: Parameter[];
}
interface DatetimeParameter extends BaseParameter {
    format: 'datetime';
    jsonType: 'string';
    default?: string | null;
}
interface IdParameter extends BaseParameter {
    format: 'id';
    jsonType: 'string';
    default?: string | null;
}
export type Parameter = StringParameter | NumberParameter | EnumParameter | RecordParameter | ListParameter | BooleanParameter | ObjectParameter | DatetimeParameter | IdParameter;
export interface Request {
    methods: Method[];
    semanticMethod: Method;
    preferredMethod: Method;
    parameters: Parameter[];
}
export type Response = VoidResponse | ResourceResponse | ResourceListResponse;
interface BaseResponse {
    description: string;
}
interface VoidResponse extends BaseResponse {
    responseType: 'void';
}
interface ResourceResponse extends BaseResponse {
    responseType: 'resource';
    responseKey: string;
    resourceType: string;
    actionAttemptType: string | null;
    batchResourceTypes: Array<{
        batchKey: string;
        resourceType: string;
    }> | null;
}
interface ResourceListResponse extends BaseResponse {
    responseType: 'resource_list';
    responseKey: string;
    resourceType: string;
}
interface BaseProperty {
    name: string;
    description: string;
    isDeprecated: boolean;
    deprecationMessage: string;
    isUndocumented: boolean;
    undocumentedMessage: string;
    isDraft: boolean;
    draftMessage: string;
    propertyGroupKey: string | null;
}
export type Property = StringProperty | NumberProperty | EnumProperty | RecordProperty | ListProperty | ObjectProperty | BooleanProperty | DatetimeProperty | IdProperty | BatchResourceProperty;
interface StringProperty extends BaseProperty {
    format: 'string';
    jsonType: 'string';
}
interface NumberProperty extends BaseProperty {
    format: 'number';
    jsonType: 'number';
}
export interface EnumProperty extends BaseProperty {
    format: 'enum';
    jsonType: 'string';
    values: EnumValue[];
}
type EnumValue = BaseProperty;
interface RecordProperty extends BaseProperty {
    format: 'record';
    jsonType: 'object';
}
interface BaseListProperty extends BaseProperty {
    format: 'list';
    jsonType: 'array';
}
interface StringListProperty extends BaseListProperty {
    itemFormat: 'string';
}
interface NumberListProperty extends BaseListProperty {
    itemFormat: 'number';
}
interface BooleanListProperty extends BaseListProperty {
    itemFormat: 'boolean';
}
interface DatetimeListProperty extends BaseListProperty {
    itemFormat: 'datetime';
}
interface IdListProperty extends BaseListProperty {
    itemFormat: 'id';
}
interface BatchResourceProperty extends BaseProperty {
    format: 'record';
    jsonType: 'object';
    resourceType: string;
}
interface EnumListProperty extends BaseListProperty {
    itemFormat: 'enum';
    itemEnumValues: EnumValue[];
}
interface ObjectListProperty extends BaseListProperty {
    itemFormat: 'object';
    itemProperties: Property[];
}
interface RecordListProperty extends BaseListProperty {
    itemFormat: 'record';
}
export interface DiscriminatedListProperty extends BaseListProperty {
    itemFormat: 'discriminated_object';
    discriminator: string;
    variantGroups: VariantGroup[];
    variants: Array<{
        resourceType: string | null;
        variantGroupKey: string | null;
        properties: Property[];
        description: BaseProperty['description'];
    }>;
}
type ListProperty = StringListProperty | NumberListProperty | BooleanListProperty | DatetimeListProperty | IdListProperty | EnumListProperty | ObjectListProperty | RecordListProperty | DiscriminatedListProperty;
interface BooleanProperty extends BaseProperty {
    format: 'boolean';
    jsonType: 'boolean';
}
interface ObjectProperty extends BaseProperty {
    format: 'object';
    jsonType: 'object';
    properties: Property[];
    propertyGroups: PropertyGroup[];
}
interface DatetimeProperty extends BaseProperty {
    format: 'datetime';
    jsonType: 'string';
}
interface IdProperty extends BaseProperty {
    format: 'id';
    jsonType: 'string';
}
export type Method = 'GET' | 'POST' | 'PUT' | 'DELETE' | 'PATCH';
interface Context extends Required<BlueprintOptions> {
    codeSampleDefinitions: CodeSampleDefinition[];
    resourceSampleDefinitions: ResourceSampleDefinition[];
    validActionAttemptTypes: string[];
    validResourceTypes: string[];
    schemas: Record<string, unknown>;
}
export declare const TypesModuleSchema: z.ZodObject<{
    codeSampleDefinitions: z.ZodDefault<z.ZodArray<z.ZodObject<{
        title: z.ZodString;
        description: z.ZodString;
        request: z.ZodObject<{
            path: z.ZodString;
            parameters: z.ZodDefault<z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<import("./json.js").Json, z.ZodTypeDef, import("./json.js").Json>>>>;
        }, "strip", z.ZodTypeAny, {
            path: string;
            parameters: Record<string, import("./json.js").Json>;
        }, {
            path: string;
            parameters?: Record<string, import("./json.js").Json> | undefined;
        }>;
        response: z.ZodObject<{
            body: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodType<import("./json.js").Json, z.ZodTypeDef, import("./json.js").Json>>>;
        }, "strip", z.ZodTypeAny, {
            body: Record<string, import("./json.js").Json> | null;
        }, {
            body: Record<string, import("./json.js").Json> | null;
        }>;
    }, "strip", z.ZodTypeAny, {
        description: string;
        title: string;
        request: {
            path: string;
            parameters: Record<string, import("./json.js").Json>;
        };
        response: {
            body: Record<string, import("./json.js").Json> | null;
        };
    }, {
        description: string;
        title: string;
        request: {
            path: string;
            parameters?: Record<string, import("./json.js").Json> | undefined;
        };
        response: {
            body: Record<string, import("./json.js").Json> | null;
        };
    }>, "many">>;
    resourceSampleDefinitions: z.ZodDefault<z.ZodArray<z.ZodObject<{
        title: z.ZodString;
        description: z.ZodString;
        resource_type: z.ZodString;
        properties: z.ZodRecord<z.ZodString, z.ZodType<import("./json.js").Json, z.ZodTypeDef, import("./json.js").Json>>;
    }, "strip", z.ZodTypeAny, {
        description: string;
        properties: Record<string, import("./json.js").Json>;
        title: string;
        resource_type: string;
    }, {
        description: string;
        properties: Record<string, import("./json.js").Json>;
        title: string;
        resource_type: string;
    }>, "many">>;
    openapi: z.ZodAny;
    schemas: z.ZodDefault<z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
}, "strip", z.ZodTypeAny, {
    codeSampleDefinitions: {
        description: string;
        title: string;
        request: {
            path: string;
            parameters: Record<string, import("./json.js").Json>;
        };
        response: {
            body: Record<string, import("./json.js").Json> | null;
        };
    }[];
    resourceSampleDefinitions: {
        description: string;
        properties: Record<string, import("./json.js").Json>;
        title: string;
        resource_type: string;
    }[];
    schemas: Record<string, unknown>;
    openapi?: any;
}, {
    codeSampleDefinitions?: {
        description: string;
        title: string;
        request: {
            path: string;
            parameters?: Record<string, import("./json.js").Json> | undefined;
        };
        response: {
            body: Record<string, import("./json.js").Json> | null;
        };
    }[] | undefined;
    resourceSampleDefinitions?: {
        description: string;
        properties: Record<string, import("./json.js").Json>;
        title: string;
        resource_type: string;
    }[] | undefined;
    openapi?: any;
    schemas?: Record<string, unknown> | undefined;
}>;
export type TypesModuleInput = z.input<typeof TypesModuleSchema>;
export type TypesModule = z.output<typeof TypesModuleSchema>;
export interface BlueprintOptions {
    formatCode?: (content: string, syntax: SyntaxName) => Promise<string>;
}
export declare const createBlueprint: (typesModule: TypesModuleInput, { formatCode }?: BlueprintOptions) => Promise<Blueprint>;
export declare const getWorkspaceScope: (authMethods: OpenapiAuthMethod[]) => SeamWorkspaceScope;
export declare const createResources: (schemas: Openapi["components"]["schemas"], routes: Route[], context: Context) => Promise<Resource[]>;
export declare const createProperties: (properties: Record<string, OpenapiSchema>, parentPaths: string[], propertyGroups: PropertyGroup[], schemas: Openapi["components"]["schemas"]) => Property[];
export declare const getSemanticMethod: (methods: Method[]) => Method;
export declare const getPreferredMethod: (methods: Method[], semanticMethod: Method, operation: OpenapiOperation) => Method;
export {};
