import * as _alepha_core1 from "alepha";
import * as _alepha_core0 from "alepha";
import { Alepha, Descriptor, KIND, TObject } from "alepha";
import { ActionDescriptor, RequestConfigSchema, ServerRouterProvider } from "alepha/server";
import { ServerStaticProvider } from "alepha/server/static";
import { OpenAPIV3 } from "openapi-types";

//#region src/descriptors/$swagger.d.ts
/**
 * Create a new OpenAPI.
 */
declare const $swagger: {
  (options: SwaggerDescriptorOptions): SwaggerDescriptor;
  [KIND]: typeof SwaggerDescriptor;
};
interface SwaggerDescriptorOptions {
  info: OpenAPIV3.InfoObject;
  /**
   * @default: "/docs"
   */
  prefix?: string;
  /**
   * If true, docs will be disabled.
   */
  disabled?: boolean;
  excludeTags?: string[];
  ui?: boolean | SwaggerUiOptions;
  rewrite?: (doc: OpenAPIV3.Document) => void;
}
interface SwaggerUiOptions {
  root?: string;
  initOAuth?: {
    /**
     * Default clientId.
     */
    clientId?: string;
    /**
     * realm query parameter (for oauth1) added to authorizationUrl and tokenUrl.
     */
    realm?: string;
    /**
     * application name, displayed in authorization popup.
     */
    appName?: string;
    /**
     * scope separator for passing scopes, encoded before calling, default
     * value is a space (encoded value %20).
     *
     * @default ' '
     */
    scopeSeparator?: string;
    /**
     * string array or scope separator (i.e. space) separated string of
     * initially selected oauth scopes
     *
     * @default []
     */
    scopes?: string | string[];
    /**
     * Additional query parameters added to authorizationUrl and tokenUrl.
     * MUST be an object
     */
    additionalQueryStringParams?: {
      [key: string]: any;
    };
    /**
     * Only activated for the accessCode flow. During the authorization_code
     * request to the tokenUrl, pass the Client Password using the HTTP Basic
     * Authentication scheme (Authorization header with Basic
     * base64encode(client_id + client_secret)).
     *
     * @default false
     */
    useBasicAuthenticationWithAccessCodeGrant?: boolean;
    /**
     * Only applies to Authorization Code flows. Proof Key for Code Exchange
     * brings enhanced security for OAuth public clients.
     *
     * @default false
     */
    usePkceWithAuthorizationCodeGrant?: boolean;
  };
}
declare class SwaggerDescriptor extends Descriptor<SwaggerDescriptorOptions> {}
//# sourceMappingURL=$swagger.d.ts.map
//#endregion
//#region src/ServerSwaggerProvider.d.ts
declare class ServerSwaggerProvider {
  protected readonly serverStaticProvider: ServerStaticProvider;
  protected readonly serverRouterProvider: ServerRouterProvider;
  protected readonly alepha: Alepha;
  json?: OpenAPIV3.Document;
  protected readonly configure: _alepha_core1.HookDescriptor<"configure">;
  createSwagger(options: SwaggerDescriptorOptions): Promise<OpenAPIV3.Document | undefined>;
  protected configureOpenApi(actions: ActionDescriptor<RequestConfigSchema>[], doc: SwaggerDescriptorOptions): OpenAPIV3.Document;
  isBodyMultipart(schema: TObject): boolean;
  replacePathParams(url: string): string;
  getResponseSchema(route: ActionDescriptor<RequestConfigSchema>): {
    type?: string;
    schema?: any;
    status: number;
  } | undefined;
  protected configureSwaggerApi(prefix: string, json: OpenAPIV3.Document): void;
  protected configureSwaggerUi(prefix: string, options: SwaggerDescriptorOptions): Promise<void>;
}
//# sourceMappingURL=ServerSwaggerProvider.d.ts.map
//#endregion
//#region src/index.d.ts
declare module "alepha/server" {
  interface ActionDescriptorOptions<TConfig extends RequestConfigSchema> {
    /**
     * Short description of the route.
     */
    summary?: string;
    /**
     * Don't include this action in the Swagger documentation.
     */
    hide?: boolean;
  }
}
/**
 * Plugin for Alepha Server that provides Swagger documentation capabilities.
 * It generates OpenAPI v3 documentation for the server's endpoints ($action).
 * It also provides a Swagger UI for interactive API documentation.
 *
 * @see {@link ServerSwaggerProvider}
 * @module alepha.server.swagger
 */
declare const AlephaServerSwagger: _alepha_core0.Service<_alepha_core0.Module>;
//# sourceMappingURL=index.d.ts.map

//#endregion
export { $swagger, AlephaServerSwagger, ServerSwaggerProvider, SwaggerDescriptor, SwaggerDescriptorOptions, SwaggerUiOptions };
//# sourceMappingURL=index.d.ts.map