import { t as __name } from "./chunk--u3MIqq1.js";
import { n as PluginTs } from "./types-Ky865RfZ.js";
import { AsyncEventEmitter, Config, FileMetaBase, Group, KubbEvents, Output, Plugin, PluginFactoryOptions, PluginManager, ResolveNameParams } from "@kubb/core";
import { HttpMethod, Oas, Operation, SchemaObject, contentType } from "@kubb/oas";
import { Fabric, FabricReactNode } from "@kubb/react-fabric/types";
import { OperationNode, SchemaNode } from "@kubb/ast/types";
import { KubbFile } from "@kubb/fabric-core/types";

//#region ../plugin-oas/src/types.d.ts
type GetOasOptions = {
  validate?: boolean;
};
type Context$2 = {
  getOas(options?: GetOasOptions): Promise<Oas>;
  getBaseURL(): Promise<string | undefined>;
};
declare global {
  namespace Kubb {
    interface PluginContext extends Context$2 {}
  }
}
/**
 * `propertyName` is the ref name + resolved with the nameResolver
 *  @example import { Pet } from './Pet'
 *
 * `originalName` is the original name used(in PascalCase), only used to remove duplicates
 *
 * `pluginKey` can be used to override the current plugin being used, handy when you want to import a type/schema out of another plugin
 * @example import a type(plugin-ts) for a mock file(swagger-faker)
 */
type Ref = {
  propertyName: string;
  originalName: string;
  path: KubbFile.Path;
  pluginKey?: Plugin['key'];
};
type Refs = Record<string, Ref>;
type OperationSchema = {
  /**
   * Converted name, contains already `PathParams`, `QueryParams`, ...
   */
  name: string;
  schema: SchemaObject;
  operation?: Operation;
  /**
   * OperationName in PascalCase, only being used in OperationGenerator
   */
  operationName: string;
  description?: string;
  statusCode?: number;
  keys?: string[];
  keysToOmit?: string[];
  withData?: boolean;
};
type OperationSchemas = {
  pathParams?: OperationSchema & {
    keysToOmit?: never;
  };
  queryParams?: OperationSchema & {
    keysToOmit?: never;
  };
  headerParams?: OperationSchema & {
    keysToOmit?: never;
  };
  request?: OperationSchema;
  response: OperationSchema;
  responses: Array<OperationSchema>;
  statusCodes?: Array<OperationSchema>;
  errors?: Array<OperationSchema>;
};
type ByTag = {
  type: 'tag';
  pattern: string | RegExp;
};
type ByOperationId = {
  type: 'operationId';
  pattern: string | RegExp;
};
type ByPath = {
  type: 'path';
  pattern: string | RegExp;
};
type ByMethod = {
  type: 'method';
  pattern: HttpMethod | RegExp;
};
type BySchemaName = {
  type: 'schemaName';
  pattern: string | RegExp;
};
type ByContentType = {
  type: 'contentType';
  pattern: string | RegExp;
};
type Exclude = ByTag | ByOperationId | ByPath | ByMethod | ByContentType;
type Include = ByTag | ByOperationId | ByPath | ByMethod | ByContentType;
type Override<TOptions> = (ByTag | ByOperationId | ByPath | ByMethod | BySchemaName | ByContentType) & {
  options: Partial<TOptions>;
};
//#endregion
//#region ../plugin-oas/src/OperationGenerator.d.ts
type Context$1<TOptions, TPluginOptions extends PluginFactoryOptions> = {
  fabric: Fabric;
  oas: Oas;
  exclude: Array<Exclude> | undefined;
  include: Array<Include> | undefined;
  override: Array<Override<TOptions>> | undefined;
  contentType: contentType | undefined;
  pluginManager: PluginManager;
  events?: AsyncEventEmitter<KubbEvents>;
  /**
   * Current plugin
   */
  plugin: Plugin<TPluginOptions>;
  mode: KubbFile.Mode;
  UNSTABLE_NAMING?: true;
};
declare class OperationGenerator<TPluginOptions extends PluginFactoryOptions = PluginFactoryOptions, TFileMeta extends FileMetaBase = FileMetaBase> {
  #private;
  constructor(options: TPluginOptions['resolvedOptions'], context: Context$1<TPluginOptions['resolvedOptions'], TPluginOptions>);
  get options(): TPluginOptions['resolvedOptions'];
  set options(options: TPluginOptions['resolvedOptions']);
  get context(): Context$1<TPluginOptions['resolvedOptions'], TPluginOptions>;
  getOptions(operation: Operation, method: HttpMethod): Partial<TPluginOptions['resolvedOptions']>;
  getSchemas(operation: Operation, {
    resolveName
  }?: {
    resolveName?: (name: string) => string;
  }): OperationSchemas;
  getOperations(): Promise<Array<{
    path: string;
    method: HttpMethod;
    operation: Operation;
  }>>;
  build(...generators: Array<Generator<TPluginOptions, Version>>): Promise<Array<KubbFile.File<TFileMeta>>>;
}
//#endregion
//#region ../plugin-oas/src/SchemaMapper.d.ts
type SchemaKeywordMapper = {
  object: {
    keyword: 'object';
    args: {
      properties: {
        [x: string]: Schema[];
      };
      additionalProperties: Schema[];
      patternProperties?: Record<string, Schema[]>;
      strict?: boolean;
    };
  };
  url: {
    keyword: 'url';
  };
  readOnly: {
    keyword: 'readOnly';
  };
  writeOnly: {
    keyword: 'writeOnly';
  };
  uuid: {
    keyword: 'uuid';
  };
  email: {
    keyword: 'email';
  };
  firstName: {
    keyword: 'firstName';
  };
  lastName: {
    keyword: 'lastName';
  };
  phone: {
    keyword: 'phone';
  };
  password: {
    keyword: 'password';
  };
  date: {
    keyword: 'date';
    args: {
      type?: 'date' | 'string';
    };
  };
  time: {
    keyword: 'time';
    args: {
      type?: 'date' | 'string';
    };
  };
  datetime: {
    keyword: 'datetime';
    args: {
      offset?: boolean;
      local?: boolean;
    };
  };
  tuple: {
    keyword: 'tuple';
    args: {
      items: Schema[];
      min?: number;
      max?: number;
      rest?: Schema;
    };
  };
  array: {
    keyword: 'array';
    args: {
      items: Schema[];
      min?: number;
      max?: number;
      unique?: boolean;
    };
  };
  enum: {
    keyword: 'enum';
    args: {
      name: string;
      typeName: string;
      asConst: boolean;
      items: Array<{
        name: string | number;
        format: 'string' | 'number' | 'boolean';
        value?: string | number | boolean;
      }>;
    };
  };
  and: {
    keyword: 'and';
    args: Schema[];
  };
  const: {
    keyword: 'const';
    args: {
      name: string | number;
      format: 'string' | 'number' | 'boolean';
      value?: string | number | boolean;
    };
  };
  union: {
    keyword: 'union';
    args: Schema[];
  };
  ref: {
    keyword: 'ref';
    args: {
      name: string;
      $ref: string;
      /**
       * Full qualified path.
       */
      path: KubbFile.Path;
      /**
       * When true `File.Import` is used.
       * When false a reference is used inside the current file.
       */
      isImportable: boolean;
    };
  };
  matches: {
    keyword: 'matches';
    args?: string;
  };
  boolean: {
    keyword: 'boolean';
  };
  default: {
    keyword: 'default';
    args: string | number | boolean;
  };
  string: {
    keyword: 'string';
  };
  integer: {
    keyword: 'integer';
  };
  bigint: {
    keyword: 'bigint';
  };
  number: {
    keyword: 'number';
  };
  max: {
    keyword: 'max';
    args: number;
  };
  min: {
    keyword: 'min';
    args: number;
  };
  exclusiveMaximum: {
    keyword: 'exclusiveMaximum';
    args: number;
  };
  exclusiveMinimum: {
    keyword: 'exclusiveMinimum';
    args: number;
  };
  describe: {
    keyword: 'describe';
    args: string;
  };
  example: {
    keyword: 'example';
    args: string;
  };
  deprecated: {
    keyword: 'deprecated';
  };
  optional: {
    keyword: 'optional';
  };
  undefined: {
    keyword: 'undefined';
  };
  nullish: {
    keyword: 'nullish';
  };
  nullable: {
    keyword: 'nullable';
  };
  null: {
    keyword: 'null';
  };
  any: {
    keyword: 'any';
  };
  unknown: {
    keyword: 'unknown';
  };
  void: {
    keyword: 'void';
  };
  blob: {
    keyword: 'blob';
  };
  schema: {
    keyword: 'schema';
    args: {
      type: 'string' | 'number' | 'integer' | 'boolean' | 'array' | 'object';
      format?: string;
    };
  };
  name: {
    keyword: 'name';
    args: string;
  };
  catchall: {
    keyword: 'catchall';
  };
  interface: {
    keyword: 'interface';
  };
};
type Schema = {
  keyword: string;
} | SchemaKeywordMapper[keyof SchemaKeywordMapper];
//#endregion
//#region ../plugin-oas/src/SchemaGenerator.d.ts
type Context<TOptions, TPluginOptions extends PluginFactoryOptions> = {
  fabric: Fabric;
  oas: Oas;
  pluginManager: PluginManager;
  events?: AsyncEventEmitter<KubbEvents>;
  /**
   * Current plugin
   */
  plugin: Plugin<TPluginOptions>;
  mode: KubbFile.Mode;
  include?: Array<'schemas' | 'responses' | 'requestBodies'>;
  override: Array<Override<TOptions>> | undefined;
  contentType?: contentType;
  output?: string;
};
type SchemaGeneratorOptions = {
  dateType: false | 'string' | 'stringOffset' | 'stringLocal' | 'date';
  integerType?: 'number' | 'bigint';
  unknownType: 'any' | 'unknown' | 'void';
  emptySchemaType: 'any' | 'unknown' | 'void';
  enumType?: 'enum' | 'asConst' | 'asPascalConst' | 'constEnum' | 'literal' | 'inlineLiteral';
  enumSuffix?: string;
  /**
   * @deprecated Will be removed in v5. Use `collisionDetection: true` instead to prevent enum name collisions.
   * When `collisionDetection` is enabled, the rootName-based approach eliminates the need for numeric suffixes.
   * @internal
   */
  usedEnumNames?: Record<string, number>;
  mapper?: Record<string, string>;
  typed?: boolean;
  transformers: {
    /**
     * Customize the names based on the type that is provided by the plugin.
     */
    name?: (name: ResolveNameParams['name'], type?: ResolveNameParams['type']) => string;
    /**
     * Receive schema and name(propertyName) and return Schema array.
     * Return `undefined` to fall through to default schema generation.
     * @beta
     */
    schema?: (schemaProps: SchemaProps$1, defaultSchemas: Schema[]) => Array<Schema> | undefined;
  };
};
type SchemaProps$1 = {
  schema: SchemaObject | null;
  name: string | null;
  parentName: string | null;
  rootName?: string | null;
};
declare class SchemaGenerator<TOptions extends SchemaGeneratorOptions = SchemaGeneratorOptions, TPluginOptions extends PluginFactoryOptions = PluginFactoryOptions, TFileMeta extends FileMetaBase = FileMetaBase> {
  #private;
  constructor(options: TOptions, context: Context<TOptions, TPluginOptions>);
  get options(): TOptions;
  set options(options: TOptions);
  get context(): Context<TOptions, TPluginOptions>;
  refs: Refs;
  /**
   * Creates a type node from a given schema.
   * Delegates to getBaseTypeFromSchema internally and
   * optionally adds a union with null.
   */
  parse(props: SchemaProps$1): Schema[];
  static deepSearch<T extends keyof SchemaKeywordMapper>(tree: Schema[] | undefined, keyword: T): Array<SchemaKeywordMapper[T]>;
  static find<T extends keyof SchemaKeywordMapper>(tree: Schema[] | undefined, keyword: T): SchemaKeywordMapper[T] | undefined;
  static combineObjects(tree: Schema[] | undefined): Schema[];
  build(...generators: Array<Generator<TPluginOptions, Version>>): Promise<Array<KubbFile.File<TFileMeta>>>;
}
//#endregion
//#region ../plugin-oas/src/generators/createGenerator.d.ts
type CoreGenerator<TOptions extends PluginFactoryOptions, TVersion extends Version> = {
  name: string;
  type: 'core';
  version: TVersion;
  operations: (props: OperationsProps<TOptions, TVersion>) => Promise<KubbFile.File[]>;
  operation: (props: OperationProps<TOptions, TVersion>) => Promise<KubbFile.File[]>;
  schema: (props: SchemaProps<TOptions, TVersion>) => Promise<KubbFile.File[]>;
};
//#endregion
//#region ../plugin-oas/src/generators/types.d.ts
type Version = '1' | '2';
type OperationsV1Props<TOptions extends PluginFactoryOptions> = {
  config: Config;
  generator: Omit<OperationGenerator<TOptions>, 'build'>;
  plugin: Plugin<TOptions>;
  operations: Array<Operation>;
};
type OperationsV2Props<TOptions extends PluginFactoryOptions> = {
  config: Config;
  plugin: Plugin<TOptions>;
  nodes: Array<OperationNode>;
};
type OperationV1Props<TOptions extends PluginFactoryOptions> = {
  config: Config;
  generator: Omit<OperationGenerator<TOptions>, 'build'>;
  plugin: Plugin<TOptions>;
  operation: Operation;
};
type OperationV2Props<TOptions extends PluginFactoryOptions> = {
  config: Config;
  plugin: Plugin<TOptions>;
  node: OperationNode;
};
type OperationsProps<TOptions extends PluginFactoryOptions, TVersion extends Version = '1'> = TVersion extends '2' ? OperationsV2Props<TOptions> : OperationsV1Props<TOptions>;
type OperationProps<TOptions extends PluginFactoryOptions, TVersion extends Version = '1'> = TVersion extends '2' ? OperationV2Props<TOptions> : OperationV1Props<TOptions>;
type SchemaV1Props<TOptions extends PluginFactoryOptions> = {
  config: Config;
  generator: Omit<SchemaGenerator<SchemaGeneratorOptions, TOptions>, 'build'>;
  plugin: Plugin<TOptions>;
  schema: {
    name: string;
    tree: Array<Schema>;
    value: SchemaObject;
  };
};
type SchemaV2Props<TOptions extends PluginFactoryOptions> = {
  config: Config;
  plugin: Plugin<TOptions>;
  node: SchemaNode;
};
type SchemaProps<TOptions extends PluginFactoryOptions, TVersion extends Version = '1'> = TVersion extends '2' ? SchemaV2Props<TOptions> : SchemaV1Props<TOptions>;
type Generator<TOptions extends PluginFactoryOptions, TVersion extends Version = Version> = TVersion extends Version ? CoreGenerator<TOptions, TVersion> | ReactGenerator<TOptions, TVersion> : never;
//#endregion
//#region ../plugin-oas/src/generators/createReactGenerator.d.ts
type ReactGenerator<TOptions extends PluginFactoryOptions, TVersion extends Version> = {
  name: string;
  type: 'react';
  version: TVersion;
  Operations: (props: OperationsProps<TOptions, TVersion>) => FabricReactNode;
  Operation: (props: OperationProps<TOptions, TVersion>) => FabricReactNode;
  Schema: (props: SchemaProps<TOptions, TVersion>) => FabricReactNode;
};
//#endregion
//#region src/generators/typeGenerator.d.ts
declare const typeGenerator: ReactGenerator<PluginTs, "1">;
//#endregion
export { typeGenerator };
//# sourceMappingURL=generators.d.ts.map