import sharp, { Sharp } from 'sharp';
import { D as Dimensions, C as CalculatorOptions, a as Calculated, I as ImageGeometry, M as MaxDimensions, b as ContentResult, P as ProcessorResult, V as VersionModule } from './contracts-C2hhwNOb.js';
export { E as ErrorResult, R as RedirectResult } from './contracts-C2hhwNOb.js';

declare class IIIFError extends Error {
    statusCode?: number;
    constructor(message: string, opts?: {
        statusCode?: number;
    });
}

declare class Operations {
    private keepMetadata?;
    private pages;
    private sharpOptions?;
    private calculator;
    private pageThreshold;
    constructor(version: number, dims: Dimensions[], opts: CalculatorOptions & {
        sharp?: Record<string, unknown>;
        pageThreshold?: number;
    });
    region(v: string): this;
    size(v: string): this;
    rotation(v: string): this;
    quality(v: string): this;
    format(v: string, density?: number): this;
    info(): Calculated;
    canonicalPath(): string;
    withMetadata(v: boolean): this;
    private computePage;
    pipeline(): Sharp;
}

type GeometryFunction = (input: {
    id: string;
    baseUrl: string;
}) => Promise<ImageGeometry>;
type StreamResolver = (input: {
    id: string;
    baseUrl: string;
}) => Promise<NodeJS.ReadableStream>;
type StreamResolverWithCallback = (input: {
    id: string;
    baseUrl: string;
}, callback: (stream: NodeJS.ReadableStream) => Promise<unknown>) => Promise<unknown>;
type ProcessorOptions = {
    geometryFunction?: GeometryFunction;
    max?: {
        width: number;
        height?: number;
        area?: number;
    };
    includeMetadata?: boolean;
    density?: number;
    debugBorder?: boolean;
    iiifVersion?: number;
    pageThreshold?: number;
    pathPrefix?: string;
    sharpOptions?: Record<string, unknown>;
    request?: string;
};
declare class Processor {
    private errorClass;
    private Implementation;
    private imageGeometry?;
    private sharpOptions?;
    id: string;
    baseUrl: string;
    version: number;
    request: string;
    streamResolver: StreamResolver | StreamResolverWithCallback;
    filename?: string;
    info?: string;
    region: string;
    size: string;
    rotation: string;
    quality: string;
    format: string;
    geometryFunction: GeometryFunction;
    max?: MaxDimensions;
    includeMetadata: boolean;
    density?: number | null;
    debugBorder: boolean;
    pageThreshold?: number;
    constructor(url: string, streamResolver: StreamResolver | StreamResolverWithCallback, opts?: ProcessorOptions);
    setOpts(opts: any): this;
    initialize(streamResolver: StreamResolver | StreamResolverWithCallback): this;
    withStream(callback: (s: NodeJS.ReadableStream) => Promise<unknown>): Promise<unknown>;
    geometry(includeTile?: boolean): Promise<ImageGeometry>;
    infoJson(): Promise<ContentResult>;
    operations({ sizes }: ImageGeometry): Operations;
    applyBorder(transformed: sharp.Sharp): Promise<sharp.Sharp>;
    iiifImage(): Promise<ContentResult>;
    execute(): Promise<ProcessorResult>;
}

declare const Versions: Record<2 | 3, VersionModule>;

export { ContentResult, type GeometryFunction, IIIFError, ImageGeometry, Processor, type ProcessorOptions, ProcessorResult, type StreamResolver, type StreamResolverWithCallback, Versions };
