type CameraFacingMode = "user" | "environment";

interface TypedEventListenerDisposalToken {
    dispose(): void;
}
declare class TypedEventDispatcher<Events> {
    private _dispatcher;
    private _routeTargets;
    addEventListener<Type extends keyof Events>(type: Type, listener: (eventPayload: Events[Type]) => void): TypedEventListenerDisposalToken;
    dispatchEvent<Type extends keyof Events>(type: Type, payload: Events[Type]): void;
    addEventDispatchTarget<T extends Events>(target: TypedEventDispatcher<T>): void;
    removeEventDispatchTarget<T extends Events>(target: TypedEventDispatcher<T>): void;
}

declare interface Avatar {
    pose: Matrix4x4f;
    beta: Array<number>;
}

declare interface AvatarBoostResult {
    avatars: Avatar[];
}

declare interface BachAlgorithmConfiguration {
    keyMaps?: BachAlgorithmParameters;
}

declare type BachAlgorithmNodeType =
| "imageProducer"
| "face"
| "neck"
| "matting"
| "head_fitting"
| "slam_nail"
| "face_new_landmark"
| "ava_boost"
| "face_fitting"
| "sky_seg"
| "watch_tryon"
| "hand"
| "ear_seg"
| "expression_detect";

declare interface BachAlgorithmParameters {
    intParam?: {
        [key: string]: number;
    };
    floatParam?: {
        [key: string]: number;
    };
    stringParam?: {
        [key: string]: string;
    };
}

declare interface BachResults {
    imageBuffer: Uint8Array;
    isPitchBlack?: boolean;
    faceResult?: FaceResult;
    mattingResult?: MattingResult;
    neckResult?: NeckResult;
    slamResult?: SLAMResult;
    headFittingResult?: HeadFittingResult;
    avatarBoostResult?: AvatarBoostResult;
    faceFittingResult?: FaceFittingResult;
    skySegmentationResult?: SkySegmentationResult;
    watchTryonResult?: WatchTryonResult;
    handDetectRingResult?: HandDetectRingResult;
    handDetectGestureResult?: HandDetectGestureResult;
    faceAttributesResult?: FaceAttributesResult;
}

declare interface BachWasmBinaries {
    readonly normal: BachWasmBinary;
    readonly simd: BachWasmBinary;
}

declare const BachWasmBinaries: {
    readonly defaultBinaries: BachWasmBinaries;
};

declare interface BachWasmBinary {
    readonly url: string;
    readonly sha256: string;
}

declare interface Face {
    id: number;
    landmarks106: Array<Vec2f>;
    pitch: number;
    roll: number;
    yaw: number;
    score: number;
    extra?: FaceExtra;
    mask?: FaceMask;
    action: number;
}

declare interface FaceAttributes {
    id: number;
    age: number;
    gender: "male" | "female" | "unknown";
    maleProbability: number;
}

declare interface FaceAttributesResult {
    faces: FaceAttributes[];
}

declare interface FaceExtra {
    eyeCount: number;
    leftEyeLandmarks: Array<Vec2f>;
    rightEyeLandmarks: Array<Vec2f>;

    eyebrowCount: number;
    leftEyebrowLandmarks: Array<Vec2f>;
    rightEyebrowLandmarks: Array<Vec2f>;

    lipsCount: number;
    lipsLandmarks: Array<Vec2f>;

    irisCount: number;
    leftIrisLandmarks: Array<Vec2f>;
    rightIrisLandmarks: Array<Vec2f>;
}

declare interface FaceFittingFace {
    id: number;
    mvp: Matrix4x4f;
    modelMatrix: Matrix4x4f;
    vertices: Float32Array;
    normals: Float32Array;
}

declare interface FaceFittingResult {
    uv: Float32Array;
    indices: Uint16Array;
    faces: FaceFittingFace[];
}

declare interface FaceMask {
    width: number;
    height: number;
    data: Uint8Array;
    affineTransform: number[];
}

declare interface FaceResult {
    faces: Face[];
    imageWidth: number;
    imageHeight: number;
}

declare interface HandDetectGestureResult {
    handGestures: HandGesture[];
}

declare interface HandDetectRingResult {
    handRings: HandRing[];
}

declare interface HandGesture {
    action: number;
    handRect: Rect;
    keyPoints: Array<Vec2f>;
    keyPointsDetect: Uint8Array;
}

declare interface HandRing {
    thumbFingerTrans: Matrix4x4f;
    foreFingerTrans: Matrix4x4f;
    middleFingerTrans: Matrix4x4f;
    ringFingerTrans: Matrix4x4f;
    littleFingerTrans: Matrix4x4f;
    handCountForRing: number;
    ringRenderMode: number;
    occluderRenderMode: Uint8Array;
}

declare interface Head {
    id: number;
    mvp: Matrix4x4f;
    modelMatrix: Matrix4x4f;
    viewMatrix: Matrix4x4f;
    projectMatrix: Matrix4x4f;
    vertices: Float32Array;
    indices: Uint16Array;
}

declare interface HeadFittingResult {
    heads: Head[];
}

declare interface Matrix4x4f {
    data: Array<number>;
}

declare interface MattingResult {
    width: number;
    height: number;
    resultRect: Rect;
    maskData: Uint8Array;
}

declare interface Neck {
    transform: Matrix4x4f;
    landmarks: Array<Vec2f>;
    resultRect: Rect;
}

declare interface NeckResult {
    necks: Neck[];
}

declare interface Rect {
    x: number;
    y: number;
    width: number;
    height: number;
}

declare interface SkySegmentationResult {
    width: number;
    height: number;
    hasSky: boolean;
    channels: number;
    maskData: Uint8Array;
}

declare interface SLAMResult {
    isPlaneDetected: boolean;
    trackStatus: number;
    projectionMatrix: Matrix4x4f;
    viewMatrix: Matrix4x4f;
    planeTransform: Matrix4x4f;
    isPlaneUpdated: boolean;
}

declare interface Vec2f {
    x: number;
    y: number;
}

declare interface WatchTryonInfo {
    modelViewMatrix: Matrix4x4f;
    isLeftHand: boolean;
    indices: Uint16Array;
    vertices: Float32Array;
    scaleAlpha: number;
}

declare interface WatchTryonResult {
    watchTryons: WatchTryonInfo[];
}

interface BachAlgorithmModelInfo {
    readonly name: string;
    readonly url: string;
    readonly sha256: string;
    readonly tag?: string;
}
type BachPresetAlgorithmType = Exclude<BachAlgorithmNodeType, "hand" | "expression_detect"> | "hand_gesture" | "hand_ring" | "gender_detection";
type BachAlgorithmPreset = {
    readonly [key in BachPresetAlgorithmType]: {
        readonly type: BachAlgorithmNodeType;
        readonly configuration?: Readonly<BachAlgorithmConfiguration>;
        readonly models: Readonly<BachAlgorithmModelInfo[]>;
        readonly dependencies: Readonly<(BachPresetAlgorithmType | null)[]>;
    };
};

declare type Primitive = string | number | symbol | bigint | boolean | null | undefined;

declare namespace util {
    type AssertEqual<T, U> = (<V>() => V extends T ? 1 : 2) extends <V>() => V extends U ? 1 : 2 ? true : false;
    export type isAny<T> = 0 extends 1 & T ? true : false;
    export const assertEqual: <A, B>(val: AssertEqual<A, B>) => AssertEqual<A, B>;
    export function assertIs<T>(_arg: T): void;
    export function assertNever(_x: never): never;
    export type Omit<T, K extends keyof T> = Pick<T, Exclude<keyof T, K>>;
    export type OmitKeys<T, K extends string> = Pick<T, Exclude<keyof T, K>>;
    export type MakePartial<T, K extends keyof T> = Omit<T, K> & Partial<Pick<T, K>>;
    export const arrayToEnum: <T extends string, U extends [T, ...T[]]>(items: U) => { [k in U[number]]: k; };
    export const getValidEnumValues: (obj: any) => any[];
    export const objectValues: (obj: any) => any[];
    export const objectKeys: ObjectConstructor["keys"];
    export const find: <T>(arr: T[], checker: (arg: T) => any) => T | undefined;
    export type identity<T> = objectUtil.identity<T>;
    export type flatten<T> = objectUtil.flatten<T>;
    export type noUndefined<T> = T extends undefined ? never : T;
    export const isInteger: NumberConstructor["isInteger"];
    export function joinValues<T extends any[]>(array: T, separator?: string): string;
    export const jsonStringifyReplacer: (_: string, value: any) => any;
    export {};
}
declare namespace objectUtil {
    export type MergeShapes<U, V> = {
        [k in Exclude<keyof U, keyof V>]: U[k];
    } & V;
    type requiredKeys<T extends object> = {
        [k in keyof T]: undefined extends T[k] ? never : k;
    }[keyof T];
    export type addQuestionMarks<T extends object, R extends keyof T = requiredKeys<T>> = Pick<Required<T>, R> & Partial<T>;
    export type identity<T> = T;
    export type flatten<T> = identity<{
        [k in keyof T]: T[k];
    }>;
    export type noNeverKeys<T> = {
        [k in keyof T]: [T[k]] extends [never] ? never : k;
    }[keyof T];
    export type noNever<T> = identity<{
        [k in noNeverKeys<T>]: k extends keyof T ? T[k] : never;
    }>;
    export const mergeShapes: <U, T>(first: U, second: T) => T & U;
    export type extendShape<A, B> = flatten<Omit<A, keyof B> & B>;
    export {};
}
declare const ZodParsedType: {
    function: "function";
    number: "number";
    string: "string";
    nan: "nan";
    integer: "integer";
    float: "float";
    boolean: "boolean";
    date: "date";
    bigint: "bigint";
    symbol: "symbol";
    undefined: "undefined";
    null: "null";
    array: "array";
    object: "object";
    unknown: "unknown";
    promise: "promise";
    void: "void";
    never: "never";
    map: "map";
    set: "set";
};
declare type ZodParsedType = keyof typeof ZodParsedType;

declare type allKeys<T> = T extends any ? keyof T : never;
declare type typeToFlattenedError<T, U = string> = {
    formErrors: U[];
    fieldErrors: {
        [P in allKeys<T>]?: U[];
    };
};
declare const ZodIssueCode: {
    invalid_type: "invalid_type";
    invalid_literal: "invalid_literal";
    custom: "custom";
    invalid_union: "invalid_union";
    invalid_union_discriminator: "invalid_union_discriminator";
    invalid_enum_value: "invalid_enum_value";
    unrecognized_keys: "unrecognized_keys";
    invalid_arguments: "invalid_arguments";
    invalid_return_type: "invalid_return_type";
    invalid_date: "invalid_date";
    invalid_string: "invalid_string";
    too_small: "too_small";
    too_big: "too_big";
    invalid_intersection_types: "invalid_intersection_types";
    not_multiple_of: "not_multiple_of";
    not_finite: "not_finite";
};
declare type ZodIssueCode = keyof typeof ZodIssueCode;
declare type ZodIssueBase = {
    path: (string | number)[];
    message?: string;
};
interface ZodInvalidTypeIssue extends ZodIssueBase {
    code: typeof ZodIssueCode.invalid_type;
    expected: ZodParsedType;
    received: ZodParsedType;
}
interface ZodInvalidLiteralIssue extends ZodIssueBase {
    code: typeof ZodIssueCode.invalid_literal;
    expected: unknown;
    received: unknown;
}
interface ZodUnrecognizedKeysIssue extends ZodIssueBase {
    code: typeof ZodIssueCode.unrecognized_keys;
    keys: string[];
}
interface ZodInvalidUnionIssue extends ZodIssueBase {
    code: typeof ZodIssueCode.invalid_union;
    unionErrors: ZodError[];
}
interface ZodInvalidUnionDiscriminatorIssue extends ZodIssueBase {
    code: typeof ZodIssueCode.invalid_union_discriminator;
    options: Primitive[];
}
interface ZodInvalidEnumValueIssue extends ZodIssueBase {
    received: string | number;
    code: typeof ZodIssueCode.invalid_enum_value;
    options: (string | number)[];
}
interface ZodInvalidArgumentsIssue extends ZodIssueBase {
    code: typeof ZodIssueCode.invalid_arguments;
    argumentsError: ZodError;
}
interface ZodInvalidReturnTypeIssue extends ZodIssueBase {
    code: typeof ZodIssueCode.invalid_return_type;
    returnTypeError: ZodError;
}
interface ZodInvalidDateIssue extends ZodIssueBase {
    code: typeof ZodIssueCode.invalid_date;
}
declare type StringValidation = "email" | "url" | "emoji" | "uuid" | "regex" | "cuid" | "cuid2" | "ulid" | "datetime" | "ip" | {
    includes: string;
    position?: number;
} | {
    startsWith: string;
} | {
    endsWith: string;
};
interface ZodInvalidStringIssue extends ZodIssueBase {
    code: typeof ZodIssueCode.invalid_string;
    validation: StringValidation;
}
interface ZodTooSmallIssue extends ZodIssueBase {
    code: typeof ZodIssueCode.too_small;
    minimum: number | bigint;
    inclusive: boolean;
    exact?: boolean;
    type: "array" | "string" | "number" | "set" | "date" | "bigint";
}
interface ZodTooBigIssue extends ZodIssueBase {
    code: typeof ZodIssueCode.too_big;
    maximum: number | bigint;
    inclusive: boolean;
    exact?: boolean;
    type: "array" | "string" | "number" | "set" | "date" | "bigint";
}
interface ZodInvalidIntersectionTypesIssue extends ZodIssueBase {
    code: typeof ZodIssueCode.invalid_intersection_types;
}
interface ZodNotMultipleOfIssue extends ZodIssueBase {
    code: typeof ZodIssueCode.not_multiple_of;
    multipleOf: number | bigint;
}
interface ZodNotFiniteIssue extends ZodIssueBase {
    code: typeof ZodIssueCode.not_finite;
}
interface ZodCustomIssue extends ZodIssueBase {
    code: typeof ZodIssueCode.custom;
    params?: {
        [k: string]: any;
    };
}
declare type ZodIssueOptionalMessage = ZodInvalidTypeIssue | ZodInvalidLiteralIssue | ZodUnrecognizedKeysIssue | ZodInvalidUnionIssue | ZodInvalidUnionDiscriminatorIssue | ZodInvalidEnumValueIssue | ZodInvalidArgumentsIssue | ZodInvalidReturnTypeIssue | ZodInvalidDateIssue | ZodInvalidStringIssue | ZodTooSmallIssue | ZodTooBigIssue | ZodInvalidIntersectionTypesIssue | ZodNotMultipleOfIssue | ZodNotFiniteIssue | ZodCustomIssue;
declare type ZodIssue = ZodIssueOptionalMessage & {
    fatal?: boolean;
    message: string;
};
declare type recursiveZodFormattedError<T> = T extends [any, ...any[]] ? {
    [K in keyof T]?: ZodFormattedError<T[K]>;
} : T extends any[] ? {
    [k: number]: ZodFormattedError<T[number]>;
} : T extends object ? {
    [K in keyof T]?: ZodFormattedError<T[K]>;
} : unknown;
declare type ZodFormattedError<T, U = string> = {
    _errors: U[];
} & recursiveZodFormattedError<NonNullable<T>>;
declare class ZodError<T = any> extends Error {
    issues: ZodIssue[];
    get errors(): ZodIssue[];
    constructor(issues: ZodIssue[]);
    format(): ZodFormattedError<T>;
    format<U>(mapper: (issue: ZodIssue) => U): ZodFormattedError<T, U>;
    static create: (issues: ZodIssue[]) => ZodError<any>;
    toString(): string;
    get message(): string;
    get isEmpty(): boolean;
    addIssue: (sub: ZodIssue) => void;
    addIssues: (subs?: ZodIssue[]) => void;
    flatten(): typeToFlattenedError<T>;
    flatten<U>(mapper?: (issue: ZodIssue) => U): typeToFlattenedError<T, U>;
    get formErrors(): typeToFlattenedError<T, string>;
}
declare type stripPath<T extends object> = T extends any ? util.OmitKeys<T, "path"> : never;
declare type IssueData = stripPath<ZodIssueOptionalMessage> & {
    path?: (string | number)[];
    fatal?: boolean;
};
declare type ErrorMapCtx = {
    defaultError: string;
    data: any;
};
declare type ZodErrorMap = (issue: ZodIssueOptionalMessage, _ctx: ErrorMapCtx) => {
    message: string;
};

declare type ParseParams = {
    path: (string | number)[];
    errorMap: ZodErrorMap;
    async: boolean;
};
declare type ParsePathComponent = string | number;
declare type ParsePath = ParsePathComponent[];
interface ParseContext {
    readonly common: {
        readonly issues: ZodIssue[];
        readonly contextualErrorMap?: ZodErrorMap;
        readonly async: boolean;
    };
    readonly path: ParsePath;
    readonly schemaErrorMap?: ZodErrorMap;
    readonly parent: ParseContext | null;
    readonly data: any;
    readonly parsedType: ZodParsedType;
}
declare type ParseInput = {
    data: any;
    path: (string | number)[];
    parent: ParseContext;
};
declare class ParseStatus {
    value: "aborted" | "dirty" | "valid";
    dirty(): void;
    abort(): void;
    static mergeArray(status: ParseStatus, results: SyncParseReturnType<any>[]): SyncParseReturnType;
    static mergeObjectAsync(status: ParseStatus, pairs: {
        key: ParseReturnType<any>;
        value: ParseReturnType<any>;
    }[]): Promise<SyncParseReturnType<any>>;
    static mergeObjectSync(status: ParseStatus, pairs: {
        key: SyncParseReturnType<any>;
        value: SyncParseReturnType<any>;
        alwaysSet?: boolean;
    }[]): SyncParseReturnType;
}
declare type INVALID = {
    status: "aborted";
};
declare const INVALID: INVALID;
declare type DIRTY<T> = {
    status: "dirty";
    value: T;
};
declare const DIRTY: <T>(value: T) => DIRTY<T>;
declare type OK<T> = {
    status: "valid";
    value: T;
};
declare const OK: <T>(value: T) => OK<T>;
declare type SyncParseReturnType<T = any> = OK<T> | DIRTY<T> | INVALID;
declare type AsyncParseReturnType<T> = Promise<SyncParseReturnType<T>>;
declare type ParseReturnType<T> = SyncParseReturnType<T> | AsyncParseReturnType<T>;

declare namespace enumUtil {
    type UnionToIntersectionFn<T> = (T extends unknown ? (k: () => T) => void : never) extends (k: infer Intersection) => void ? Intersection : never;
    type GetUnionLast<T> = UnionToIntersectionFn<T> extends () => infer Last ? Last : never;
    type UnionToTuple<T, Tuple extends unknown[] = []> = [T] extends [never] ? Tuple : UnionToTuple<Exclude<T, GetUnionLast<T>>, [GetUnionLast<T>, ...Tuple]>;
    type CastToStringTuple<T> = T extends [string, ...string[]] ? T : never;
    export type UnionToTupleString<T> = CastToStringTuple<UnionToTuple<T>>;
    export {};
}

declare namespace errorUtil {
    type ErrMessage = string | {
        message?: string;
    };
    const errToObj: (message?: ErrMessage | undefined) => {
        message?: string | undefined;
    };
    const toString: (message?: ErrMessage | undefined) => string | undefined;
}

declare namespace partialUtil {
    type DeepPartial<T extends ZodTypeAny> = T extends ZodObject<ZodRawShape> ? ZodObject<{
        [k in keyof T["shape"]]: ZodOptional<DeepPartial<T["shape"][k]>>;
    }, T["_def"]["unknownKeys"], T["_def"]["catchall"]> : T extends ZodArray<infer Type, infer Card> ? ZodArray<DeepPartial<Type>, Card> : T extends ZodOptional<infer Type> ? ZodOptional<DeepPartial<Type>> : T extends ZodNullable<infer Type> ? ZodNullable<DeepPartial<Type>> : T extends ZodTuple<infer Items> ? {
        [k in keyof Items]: Items[k] extends ZodTypeAny ? DeepPartial<Items[k]> : never;
    } extends infer PI ? PI extends ZodTupleItems ? ZodTuple<PI> : never : never : T;
}

declare type RefinementCtx = {
    addIssue: (arg: IssueData) => void;
    path: (string | number)[];
};
declare type ZodRawShape = {
    [k: string]: ZodTypeAny;
};
declare type ZodTypeAny = ZodType<any, any, any>;
declare type TypeOf<T extends ZodType<any, any, any>> = T["_output"];
declare type input<T extends ZodType<any, any, any>> = T["_input"];
declare type output<T extends ZodType<any, any, any>> = T["_output"];

declare type CustomErrorParams = Partial<util.Omit<ZodCustomIssue, "code">>;
interface ZodTypeDef {
    errorMap?: ZodErrorMap;
    description?: string;
}
declare type RawCreateParams = {
    errorMap?: ZodErrorMap;
    invalid_type_error?: string;
    required_error?: string;
    description?: string;
} | undefined;
declare type SafeParseSuccess<Output> = {
    success: true;
    data: Output;
};
declare type SafeParseError<Input> = {
    success: false;
    error: ZodError<Input>;
};
declare type SafeParseReturnType<Input, Output> = SafeParseSuccess<Output> | SafeParseError<Input>;
declare abstract class ZodType<Output = any, Def extends ZodTypeDef = ZodTypeDef, Input = Output> {
    readonly _type: Output;
    readonly _output: Output;
    readonly _input: Input;
    readonly _def: Def;
    get description(): string | undefined;
    abstract _parse(input: ParseInput): ParseReturnType<Output>;
    _getType(input: ParseInput): string;
    _getOrReturnCtx(input: ParseInput, ctx?: ParseContext | undefined): ParseContext;
    _processInputParams(input: ParseInput): {
        status: ParseStatus;
        ctx: ParseContext;
    };
    _parseSync(input: ParseInput): SyncParseReturnType<Output>;
    _parseAsync(input: ParseInput): AsyncParseReturnType<Output>;
    parse(data: unknown, params?: Partial<ParseParams>): Output;
    safeParse(data: unknown, params?: Partial<ParseParams>): SafeParseReturnType<Input, Output>;
    parseAsync(data: unknown, params?: Partial<ParseParams>): Promise<Output>;
    safeParseAsync(data: unknown, params?: Partial<ParseParams>): Promise<SafeParseReturnType<Input, Output>>;
    /** Alias of safeParseAsync */
    spa: (data: unknown, params?: Partial<ParseParams> | undefined) => Promise<SafeParseReturnType<Input, Output>>;
    refine<RefinedOutput extends Output>(check: (arg: Output) => arg is RefinedOutput, message?: string | CustomErrorParams | ((arg: Output) => CustomErrorParams)): ZodEffects<this, RefinedOutput, Input>;
    refine(check: (arg: Output) => unknown | Promise<unknown>, message?: string | CustomErrorParams | ((arg: Output) => CustomErrorParams)): ZodEffects<this, Output, Input>;
    refinement<RefinedOutput extends Output>(check: (arg: Output) => arg is RefinedOutput, refinementData: IssueData | ((arg: Output, ctx: RefinementCtx) => IssueData)): ZodEffects<this, RefinedOutput, Input>;
    refinement(check: (arg: Output) => boolean, refinementData: IssueData | ((arg: Output, ctx: RefinementCtx) => IssueData)): ZodEffects<this, Output, Input>;
    _refinement(refinement: RefinementEffect<Output>["refinement"]): ZodEffects<this, Output, Input>;
    superRefine<RefinedOutput extends Output>(refinement: (arg: Output, ctx: RefinementCtx) => arg is RefinedOutput): ZodEffects<this, RefinedOutput, Input>;
    superRefine(refinement: (arg: Output, ctx: RefinementCtx) => void): ZodEffects<this, Output, Input>;
    superRefine(refinement: (arg: Output, ctx: RefinementCtx) => Promise<void>): ZodEffects<this, Output, Input>;
    constructor(def: Def);
    optional(): ZodOptional<this>;
    nullable(): ZodNullable<this>;
    nullish(): ZodOptional<ZodNullable<this>>;
    array(): ZodArray<this>;
    promise(): ZodPromise<this>;
    or<T extends ZodTypeAny>(option: T): ZodUnion<[this, T]>;
    and<T extends ZodTypeAny>(incoming: T): ZodIntersection<this, T>;
    transform<NewOut>(transform: (arg: Output, ctx: RefinementCtx) => NewOut | Promise<NewOut>): ZodEffects<this, NewOut>;
    default(def: util.noUndefined<Input>): ZodDefault<this>;
    default(def: () => util.noUndefined<Input>): ZodDefault<this>;
    brand<B extends string | number | symbol>(brand?: B): ZodBranded<this, B>;
    catch(def: Output): ZodCatch<this>;
    catch(def: (ctx: {
        error: ZodError;
        input: Input;
    }) => Output): ZodCatch<this>;
    describe(description: string): this;
    pipe<T extends ZodTypeAny>(target: T): ZodPipeline<this, T>;
    readonly(): ZodReadonly<this>;
    isOptional(): boolean;
    isNullable(): boolean;
}
interface ZodAnyDef extends ZodTypeDef {
    typeName: ZodFirstPartyTypeKind.ZodAny;
}
declare class ZodAny extends ZodType<any, ZodAnyDef> {
    _any: true;
    _parse(input: ParseInput): ParseReturnType<this["_output"]>;
    static create: (params?: RawCreateParams) => ZodAny;
}
interface ZodArrayDef<T extends ZodTypeAny = ZodTypeAny> extends ZodTypeDef {
    type: T;
    typeName: ZodFirstPartyTypeKind.ZodArray;
    exactLength: {
        value: number;
        message?: string;
    } | null;
    minLength: {
        value: number;
        message?: string;
    } | null;
    maxLength: {
        value: number;
        message?: string;
    } | null;
}
declare type ArrayCardinality = "many" | "atleastone";
declare type arrayOutputType<T extends ZodTypeAny, Cardinality extends ArrayCardinality = "many"> = Cardinality extends "atleastone" ? [T["_output"], ...T["_output"][]] : T["_output"][];
declare class ZodArray<T extends ZodTypeAny, Cardinality extends ArrayCardinality = "many"> extends ZodType<arrayOutputType<T, Cardinality>, ZodArrayDef<T>, Cardinality extends "atleastone" ? [T["_input"], ...T["_input"][]] : T["_input"][]> {
    _parse(input: ParseInput): ParseReturnType<this["_output"]>;
    get element(): T;
    min(minLength: number, message?: errorUtil.ErrMessage): this;
    max(maxLength: number, message?: errorUtil.ErrMessage): this;
    length(len: number, message?: errorUtil.ErrMessage): this;
    nonempty(message?: errorUtil.ErrMessage): ZodArray<T, "atleastone">;
    static create: <T_1 extends ZodTypeAny>(schema: T_1, params?: RawCreateParams) => ZodArray<T_1, "many">;
}
declare type UnknownKeysParam = "passthrough" | "strict" | "strip";
interface ZodObjectDef<T extends ZodRawShape = ZodRawShape, UnknownKeys extends UnknownKeysParam = UnknownKeysParam, Catchall extends ZodTypeAny = ZodTypeAny> extends ZodTypeDef {
    typeName: ZodFirstPartyTypeKind.ZodObject;
    shape: () => T;
    catchall: Catchall;
    unknownKeys: UnknownKeys;
}
declare type objectOutputType<Shape extends ZodRawShape, Catchall extends ZodTypeAny, UnknownKeys extends UnknownKeysParam = UnknownKeysParam> = objectUtil.flatten<objectUtil.addQuestionMarks<baseObjectOutputType<Shape>>> & CatchallOutput<Catchall> & PassthroughType<UnknownKeys>;
declare type baseObjectOutputType<Shape extends ZodRawShape> = {
    [k in keyof Shape]: Shape[k]["_output"];
};
declare type objectInputType<Shape extends ZodRawShape, Catchall extends ZodTypeAny, UnknownKeys extends UnknownKeysParam = UnknownKeysParam> = objectUtil.flatten<baseObjectInputType<Shape>> & CatchallInput<Catchall> & PassthroughType<UnknownKeys>;
declare type baseObjectInputType<Shape extends ZodRawShape> = objectUtil.addQuestionMarks<{
    [k in keyof Shape]: Shape[k]["_input"];
}>;
declare type CatchallOutput<T extends ZodTypeAny> = ZodTypeAny extends T ? unknown : {
    [k: string]: T["_output"];
};
declare type CatchallInput<T extends ZodTypeAny> = ZodTypeAny extends T ? unknown : {
    [k: string]: T["_input"];
};
declare type PassthroughType<T extends UnknownKeysParam> = T extends "passthrough" ? {
    [k: string]: unknown;
} : unknown;
declare type deoptional<T extends ZodTypeAny> = T extends ZodOptional<infer U> ? deoptional<U> : T extends ZodNullable<infer U> ? ZodNullable<deoptional<U>> : T;
declare class ZodObject<T extends ZodRawShape, UnknownKeys extends UnknownKeysParam = UnknownKeysParam, Catchall extends ZodTypeAny = ZodTypeAny, Output = objectOutputType<T, Catchall, UnknownKeys>, Input = objectInputType<T, Catchall, UnknownKeys>> extends ZodType<Output, ZodObjectDef<T, UnknownKeys, Catchall>, Input> {
    private _cached;
    _getCached(): {
        shape: T;
        keys: string[];
    };
    _parse(input: ParseInput): ParseReturnType<this["_output"]>;
    get shape(): T;
    strict(message?: errorUtil.ErrMessage): ZodObject<T, "strict", Catchall>;
    strip(): ZodObject<T, "strip", Catchall>;
    passthrough(): ZodObject<T, "passthrough", Catchall>;
    /**
     * @deprecated In most cases, this is no longer needed - unknown properties are now silently stripped.
     * If you want to pass through unknown properties, use `.passthrough()` instead.
     */
    nonstrict: () => ZodObject<T, "passthrough", Catchall>;
    extend<Augmentation extends ZodRawShape>(augmentation: Augmentation): ZodObject<objectUtil.extendShape<T, Augmentation>, UnknownKeys, Catchall>;
    /**
     * @deprecated Use `.extend` instead
     *  */
    augment: <Augmentation extends ZodRawShape>(augmentation: Augmentation) => ZodObject<{ [k in keyof (Omit<T, keyof Augmentation> & Augmentation)]: (Omit<T, keyof Augmentation> & Augmentation)[k]; }, UnknownKeys, Catchall, objectOutputType<{ [k in keyof (Omit<T, keyof Augmentation> & Augmentation)]: (Omit<T, keyof Augmentation> & Augmentation)[k]; }, Catchall, UnknownKeys>, objectInputType<{ [k in keyof (Omit<T, keyof Augmentation> & Augmentation)]: (Omit<T, keyof Augmentation> & Augmentation)[k]; }, Catchall, UnknownKeys>>;
    /**
     * Prior to zod@1.0.12 there was a bug in the
     * inferred type of merged objects. Please
     * upgrade if you are experiencing issues.
     */
    merge<Incoming extends AnyZodObject, Augmentation extends Incoming["shape"]>(merging: Incoming): ZodObject<objectUtil.extendShape<T, Augmentation>, Incoming["_def"]["unknownKeys"], Incoming["_def"]["catchall"]>;
    setKey<Key extends string, Schema extends ZodTypeAny>(key: Key, schema: Schema): ZodObject<T & {
        [k in Key]: Schema;
    }, UnknownKeys, Catchall>;
    catchall<Index extends ZodTypeAny>(index: Index): ZodObject<T, UnknownKeys, Index>;
    pick<Mask extends {
        [k in keyof T]?: true;
    }>(mask: Mask): ZodObject<Pick<T, Extract<keyof T, keyof Mask>>, UnknownKeys, Catchall>;
    omit<Mask extends {
        [k in keyof T]?: true;
    }>(mask: Mask): ZodObject<Omit<T, keyof Mask>, UnknownKeys, Catchall>;
    /**
     * @deprecated
     */
    deepPartial(): partialUtil.DeepPartial<this>;
    partial(): ZodObject<{
        [k in keyof T]: ZodOptional<T[k]>;
    }, UnknownKeys, Catchall>;
    partial<Mask extends {
        [k in keyof T]?: true;
    }>(mask: Mask): ZodObject<objectUtil.noNever<{
        [k in keyof T]: k extends keyof Mask ? ZodOptional<T[k]> : T[k];
    }>, UnknownKeys, Catchall>;
    required(): ZodObject<{
        [k in keyof T]: deoptional<T[k]>;
    }, UnknownKeys, Catchall>;
    required<Mask extends {
        [k in keyof T]?: true;
    }>(mask: Mask): ZodObject<objectUtil.noNever<{
        [k in keyof T]: k extends keyof Mask ? deoptional<T[k]> : T[k];
    }>, UnknownKeys, Catchall>;
    keyof(): ZodEnum<enumUtil.UnionToTupleString<keyof T>>;
    static create: <T_1 extends ZodRawShape>(shape: T_1, params?: RawCreateParams) => ZodObject<T_1, "strip", ZodTypeAny, { [k_1 in keyof objectUtil.addQuestionMarks<baseObjectOutputType<T_1>, { [k in keyof baseObjectOutputType<T_1>]: undefined extends baseObjectOutputType<T_1>[k] ? never : k; }[keyof T_1]>]: objectUtil.addQuestionMarks<baseObjectOutputType<T_1>, { [k in keyof baseObjectOutputType<T_1>]: undefined extends baseObjectOutputType<T_1>[k] ? never : k; }[keyof T_1]>[k_1]; }, { [k_2 in keyof baseObjectInputType<T_1>]: baseObjectInputType<T_1>[k_2]; }>;
    static strictCreate: <T_1 extends ZodRawShape>(shape: T_1, params?: RawCreateParams) => ZodObject<T_1, "strict", ZodTypeAny, { [k_1 in keyof objectUtil.addQuestionMarks<baseObjectOutputType<T_1>, { [k in keyof baseObjectOutputType<T_1>]: undefined extends baseObjectOutputType<T_1>[k] ? never : k; }[keyof T_1]>]: objectUtil.addQuestionMarks<baseObjectOutputType<T_1>, { [k in keyof baseObjectOutputType<T_1>]: undefined extends baseObjectOutputType<T_1>[k] ? never : k; }[keyof T_1]>[k_1]; }, { [k_2 in keyof baseObjectInputType<T_1>]: baseObjectInputType<T_1>[k_2]; }>;
    static lazycreate: <T_1 extends ZodRawShape>(shape: () => T_1, params?: RawCreateParams) => ZodObject<T_1, "strip", ZodTypeAny, { [k_1 in keyof objectUtil.addQuestionMarks<baseObjectOutputType<T_1>, { [k in keyof baseObjectOutputType<T_1>]: undefined extends baseObjectOutputType<T_1>[k] ? never : k; }[keyof T_1]>]: objectUtil.addQuestionMarks<baseObjectOutputType<T_1>, { [k in keyof baseObjectOutputType<T_1>]: undefined extends baseObjectOutputType<T_1>[k] ? never : k; }[keyof T_1]>[k_1]; }, { [k_2 in keyof baseObjectInputType<T_1>]: baseObjectInputType<T_1>[k_2]; }>;
}
declare type AnyZodObject = ZodObject<any, any, any>;
declare type ZodUnionOptions = Readonly<[ZodTypeAny, ...ZodTypeAny[]]>;
interface ZodUnionDef<T extends ZodUnionOptions = Readonly<[
    ZodTypeAny,
    ZodTypeAny,
    ...ZodTypeAny[]
]>> extends ZodTypeDef {
    options: T;
    typeName: ZodFirstPartyTypeKind.ZodUnion;
}
declare class ZodUnion<T extends ZodUnionOptions> extends ZodType<T[number]["_output"], ZodUnionDef<T>, T[number]["_input"]> {
    _parse(input: ParseInput): ParseReturnType<this["_output"]>;
    get options(): T;
    static create: <T_1 extends readonly [ZodTypeAny, ZodTypeAny, ...ZodTypeAny[]]>(types: T_1, params?: RawCreateParams) => ZodUnion<T_1>;
}
interface ZodIntersectionDef<T extends ZodTypeAny = ZodTypeAny, U extends ZodTypeAny = ZodTypeAny> extends ZodTypeDef {
    left: T;
    right: U;
    typeName: ZodFirstPartyTypeKind.ZodIntersection;
}
declare class ZodIntersection<T extends ZodTypeAny, U extends ZodTypeAny> extends ZodType<T["_output"] & U["_output"], ZodIntersectionDef<T, U>, T["_input"] & U["_input"]> {
    _parse(input: ParseInput): ParseReturnType<this["_output"]>;
    static create: <T_1 extends ZodTypeAny, U_1 extends ZodTypeAny>(left: T_1, right: U_1, params?: RawCreateParams) => ZodIntersection<T_1, U_1>;
}
declare type ZodTupleItems = [ZodTypeAny, ...ZodTypeAny[]];
declare type AssertArray<T> = T extends any[] ? T : never;
declare type OutputTypeOfTuple<T extends ZodTupleItems | []> = AssertArray<{
    [k in keyof T]: T[k] extends ZodType<any, any> ? T[k]["_output"] : never;
}>;
declare type OutputTypeOfTupleWithRest<T extends ZodTupleItems | [], Rest extends ZodTypeAny | null = null> = Rest extends ZodTypeAny ? [...OutputTypeOfTuple<T>, ...Rest["_output"][]] : OutputTypeOfTuple<T>;
declare type InputTypeOfTuple<T extends ZodTupleItems | []> = AssertArray<{
    [k in keyof T]: T[k] extends ZodType<any, any> ? T[k]["_input"] : never;
}>;
declare type InputTypeOfTupleWithRest<T extends ZodTupleItems | [], Rest extends ZodTypeAny | null = null> = Rest extends ZodTypeAny ? [...InputTypeOfTuple<T>, ...Rest["_input"][]] : InputTypeOfTuple<T>;
interface ZodTupleDef<T extends ZodTupleItems | [] = ZodTupleItems, Rest extends ZodTypeAny | null = null> extends ZodTypeDef {
    items: T;
    rest: Rest;
    typeName: ZodFirstPartyTypeKind.ZodTuple;
}
declare class ZodTuple<T extends [ZodTypeAny, ...ZodTypeAny[]] | [] = [ZodTypeAny, ...ZodTypeAny[]], Rest extends ZodTypeAny | null = null> extends ZodType<OutputTypeOfTupleWithRest<T, Rest>, ZodTupleDef<T, Rest>, InputTypeOfTupleWithRest<T, Rest>> {
    _parse(input: ParseInput): ParseReturnType<this["_output"]>;
    get items(): T;
    rest<Rest extends ZodTypeAny>(rest: Rest): ZodTuple<T, Rest>;
    static create: <T_1 extends [] | [ZodTypeAny, ...ZodTypeAny[]]>(schemas: T_1, params?: RawCreateParams) => ZodTuple<T_1, null>;
}
declare type EnumValues = [string, ...string[]];
declare type Values<T extends EnumValues> = {
    [k in T[number]]: k;
};
interface ZodEnumDef<T extends EnumValues = EnumValues> extends ZodTypeDef {
    values: T;
    typeName: ZodFirstPartyTypeKind.ZodEnum;
}
declare type Writeable<T> = {
    -readonly [P in keyof T]: T[P];
};
declare type FilterEnum<Values, ToExclude> = Values extends [] ? [] : Values extends [infer Head, ...infer Rest] ? Head extends ToExclude ? FilterEnum<Rest, ToExclude> : [Head, ...FilterEnum<Rest, ToExclude>] : never;
declare type typecast<A, T> = A extends T ? A : never;
declare function createZodEnum<U extends string, T extends Readonly<[U, ...U[]]>>(values: T, params?: RawCreateParams): ZodEnum<Writeable<T>>;
declare function createZodEnum<U extends string, T extends [U, ...U[]]>(values: T, params?: RawCreateParams): ZodEnum<T>;
declare class ZodEnum<T extends [string, ...string[]]> extends ZodType<T[number], ZodEnumDef<T>> {
    _parse(input: ParseInput): ParseReturnType<this["_output"]>;
    get options(): T;
    get enum(): Values<T>;
    get Values(): Values<T>;
    get Enum(): Values<T>;
    extract<ToExtract extends readonly [T[number], ...T[number][]]>(values: ToExtract): ZodEnum<Writeable<ToExtract>>;
    exclude<ToExclude extends readonly [T[number], ...T[number][]]>(values: ToExclude): ZodEnum<typecast<Writeable<FilterEnum<T, ToExclude[number]>>, [string, ...string[]]>>;
    static create: typeof createZodEnum;
}
interface ZodPromiseDef<T extends ZodTypeAny = ZodTypeAny> extends ZodTypeDef {
    type: T;
    typeName: ZodFirstPartyTypeKind.ZodPromise;
}
declare class ZodPromise<T extends ZodTypeAny> extends ZodType<Promise<T["_output"]>, ZodPromiseDef<T>, Promise<T["_input"]>> {
    unwrap(): T;
    _parse(input: ParseInput): ParseReturnType<this["_output"]>;
    static create: <T_1 extends ZodTypeAny>(schema: T_1, params?: RawCreateParams) => ZodPromise<T_1>;
}
declare type RefinementEffect<T> = {
    type: "refinement";
    refinement: (arg: T, ctx: RefinementCtx) => any;
};
declare type TransformEffect<T> = {
    type: "transform";
    transform: (arg: T, ctx: RefinementCtx) => any;
};
declare type PreprocessEffect<T> = {
    type: "preprocess";
    transform: (arg: T, ctx: RefinementCtx) => any;
};
declare type Effect<T> = RefinementEffect<T> | TransformEffect<T> | PreprocessEffect<T>;
interface ZodEffectsDef<T extends ZodTypeAny = ZodTypeAny> extends ZodTypeDef {
    schema: T;
    typeName: ZodFirstPartyTypeKind.ZodEffects;
    effect: Effect<any>;
}
declare class ZodEffects<T extends ZodTypeAny, Output = output<T>, Input = input<T>> extends ZodType<Output, ZodEffectsDef<T>, Input> {
    innerType(): T;
    sourceType(): T;
    _parse(input: ParseInput): ParseReturnType<this["_output"]>;
    static create: <I extends ZodTypeAny>(schema: I, effect: Effect<I["_output"]>, params?: RawCreateParams) => ZodEffects<I, I["_output"], input<I>>;
    static createWithPreprocess: <I extends ZodTypeAny>(preprocess: (arg: unknown, ctx: RefinementCtx) => unknown, schema: I, params?: RawCreateParams) => ZodEffects<I, I["_output"], unknown>;
}

interface ZodOptionalDef<T extends ZodTypeAny = ZodTypeAny> extends ZodTypeDef {
    innerType: T;
    typeName: ZodFirstPartyTypeKind.ZodOptional;
}
declare class ZodOptional<T extends ZodTypeAny> extends ZodType<T["_output"] | undefined, ZodOptionalDef<T>, T["_input"] | undefined> {
    _parse(input: ParseInput): ParseReturnType<this["_output"]>;
    unwrap(): T;
    static create: <T_1 extends ZodTypeAny>(type: T_1, params?: RawCreateParams) => ZodOptional<T_1>;
}
interface ZodNullableDef<T extends ZodTypeAny = ZodTypeAny> extends ZodTypeDef {
    innerType: T;
    typeName: ZodFirstPartyTypeKind.ZodNullable;
}
declare class ZodNullable<T extends ZodTypeAny> extends ZodType<T["_output"] | null, ZodNullableDef<T>, T["_input"] | null> {
    _parse(input: ParseInput): ParseReturnType<this["_output"]>;
    unwrap(): T;
    static create: <T_1 extends ZodTypeAny>(type: T_1, params?: RawCreateParams) => ZodNullable<T_1>;
}
interface ZodDefaultDef<T extends ZodTypeAny = ZodTypeAny> extends ZodTypeDef {
    innerType: T;
    defaultValue: () => util.noUndefined<T["_input"]>;
    typeName: ZodFirstPartyTypeKind.ZodDefault;
}
declare class ZodDefault<T extends ZodTypeAny> extends ZodType<util.noUndefined<T["_output"]>, ZodDefaultDef<T>, T["_input"] | undefined> {
    _parse(input: ParseInput): ParseReturnType<this["_output"]>;
    removeDefault(): T;
    static create: <T_1 extends ZodTypeAny>(type: T_1, params: {
        errorMap?: ZodErrorMap | undefined;
        invalid_type_error?: string | undefined;
        required_error?: string | undefined;
        description?: string | undefined;
    } & {
        default: T_1["_input"] | (() => util.noUndefined<T_1["_input"]>);
    }) => ZodDefault<T_1>;
}
interface ZodCatchDef<T extends ZodTypeAny = ZodTypeAny> extends ZodTypeDef {
    innerType: T;
    catchValue: (ctx: {
        error: ZodError;
        input: unknown;
    }) => T["_input"];
    typeName: ZodFirstPartyTypeKind.ZodCatch;
}
declare class ZodCatch<T extends ZodTypeAny> extends ZodType<T["_output"], ZodCatchDef<T>, unknown> {
    _parse(input: ParseInput): ParseReturnType<this["_output"]>;
    removeCatch(): T;
    static create: <T_1 extends ZodTypeAny>(type: T_1, params: {
        errorMap?: ZodErrorMap | undefined;
        invalid_type_error?: string | undefined;
        required_error?: string | undefined;
        description?: string | undefined;
    } & {
        catch: T_1["_output"] | (() => T_1["_output"]);
    }) => ZodCatch<T_1>;
}
interface ZodBrandedDef<T extends ZodTypeAny> extends ZodTypeDef {
    type: T;
    typeName: ZodFirstPartyTypeKind.ZodBranded;
}
declare const BRAND: unique symbol;
declare type BRAND<T extends string | number | symbol> = {
    [BRAND]: {
        [k in T]: true;
    };
};
declare class ZodBranded<T extends ZodTypeAny, B extends string | number | symbol> extends ZodType<T["_output"] & BRAND<B>, ZodBrandedDef<T>, T["_input"]> {
    _parse(input: ParseInput): ParseReturnType<any>;
    unwrap(): T;
}
interface ZodPipelineDef<A extends ZodTypeAny, B extends ZodTypeAny> extends ZodTypeDef {
    in: A;
    out: B;
    typeName: ZodFirstPartyTypeKind.ZodPipeline;
}
declare class ZodPipeline<A extends ZodTypeAny, B extends ZodTypeAny> extends ZodType<B["_output"], ZodPipelineDef<A, B>, A["_input"]> {
    _parse(input: ParseInput): ParseReturnType<any>;
    static create<A extends ZodTypeAny, B extends ZodTypeAny>(a: A, b: B): ZodPipeline<A, B>;
}
declare type BuiltIn = (((...args: any[]) => any) | (new (...args: any[]) => any)) | {
    readonly [Symbol.toStringTag]: string;
} | Date | Error | Generator | Promise<unknown> | RegExp;
declare type MakeReadonly<T> = T extends Map<infer K, infer V> ? ReadonlyMap<K, V> : T extends Set<infer V> ? ReadonlySet<V> : T extends [infer Head, ...infer Tail] ? readonly [Head, ...Tail] : T extends Array<infer V> ? ReadonlyArray<V> : T extends BuiltIn ? T : Readonly<T>;
interface ZodReadonlyDef<T extends ZodTypeAny = ZodTypeAny> extends ZodTypeDef {
    innerType: T;
    typeName: ZodFirstPartyTypeKind.ZodReadonly;
}
declare class ZodReadonly<T extends ZodTypeAny> extends ZodType<MakeReadonly<T["_output"]>, ZodReadonlyDef<T>, T["_input"]> {
    _parse(input: ParseInput): ParseReturnType<this["_output"]>;
    static create: <T_1 extends ZodTypeAny>(type: T_1, params?: RawCreateParams) => ZodReadonly<T_1>;
}
declare enum ZodFirstPartyTypeKind {
    ZodString = "ZodString",
    ZodNumber = "ZodNumber",
    ZodNaN = "ZodNaN",
    ZodBigInt = "ZodBigInt",
    ZodBoolean = "ZodBoolean",
    ZodDate = "ZodDate",
    ZodSymbol = "ZodSymbol",
    ZodUndefined = "ZodUndefined",
    ZodNull = "ZodNull",
    ZodAny = "ZodAny",
    ZodUnknown = "ZodUnknown",
    ZodNever = "ZodNever",
    ZodVoid = "ZodVoid",
    ZodArray = "ZodArray",
    ZodObject = "ZodObject",
    ZodUnion = "ZodUnion",
    ZodDiscriminatedUnion = "ZodDiscriminatedUnion",
    ZodIntersection = "ZodIntersection",
    ZodTuple = "ZodTuple",
    ZodRecord = "ZodRecord",
    ZodMap = "ZodMap",
    ZodSet = "ZodSet",
    ZodFunction = "ZodFunction",
    ZodLazy = "ZodLazy",
    ZodLiteral = "ZodLiteral",
    ZodEnum = "ZodEnum",
    ZodEffects = "ZodEffects",
    ZodNativeEnum = "ZodNativeEnum",
    ZodOptional = "ZodOptional",
    ZodNullable = "ZodNullable",
    ZodDefault = "ZodDefault",
    ZodCatch = "ZodCatch",
    ZodPromise = "ZodPromise",
    ZodBranded = "ZodBranded",
    ZodPipeline = "ZodPipeline",
    ZodReadonly = "ZodReadonly"
}

declare abstract class FileSystemDebugSupport {
    static isDebugLogEnabled: boolean;
}

declare enum DistortionType {
    Bulge = 1,
    Pinch = 2,
    Shift = 3,
    Twist = 4,
    BulgeEx = 5,
    Stretch = 8
}
interface ParamsBulge extends BaseParams, RangeScaleSign {
}
interface ParamsPinch extends ParamsBulge {
}
interface ParamsTwist extends ParamsBulge {
}
interface ParamsShift extends BaseParams, CurveTScale, TargetPoint {
}
interface ParamsBulgeEx extends ParamsBulge, ExtScale {
}
interface ParamsStretch extends BaseParams, TargetPoint {
}
interface BaseParams {
    readonly type: DistortionType;
    readonly c_idx1: number;
    readonly c_idx2: number;
    readonly c_idx3: number;
    readonly c_lamda1: number;
    readonly c_lamda2: number;
    readonly rx_cood: number;
    readonly rx_idx1: number;
    readonly rx_idx2: number;
    readonly rx_scale: number;
    readonly ry_cood: number;
    readonly ry_idx1: number;
    readonly ry_idx2: number;
    readonly ry_scale: number;
    readonly angle_type: number;
    readonly angle_dir_end_idx: number;
    readonly angle_dir_start_idx: number;
}
interface RangeScaleSign {
    range_max: number;
    range_min: number;
    scale_x: number;
    scale_y: number;
    sign_x: number;
    sign_y: number;
}
interface CurveTScale {
    readonly curve: number;
    readonly t_scale: number;
}
interface TargetPoint {
    readonly t_idx1: number;
    readonly t_idx2: number;
    readonly t_idx3: number;
    readonly t_lamda1: number;
    readonly t_lamda2: number;
}
interface ExtScale {
    readonly ext_s0_x: number;
    readonly ext_s0_y: number;
    readonly ext_px: number;
    readonly ext_py: number;
    readonly ext_curve0_x: number;
    readonly ext_curve0_y: number;
    readonly ext_curve1_x: number;
    readonly ext_curve1_y: number;
}

declare const FaceLiquefy: ZodReadonly<ZodObject<{
    distortions: ZodArray<ZodEffects<ZodAny, ParamsBulge | ParamsPinch | ParamsTwist | ParamsShift | ParamsBulgeEx | ParamsStretch, any>, "many">;
}, "strip", ZodTypeAny, {
    distortions: (ParamsBulge | ParamsPinch | ParamsTwist | ParamsShift | ParamsBulgeEx | ParamsStretch)[];
}, {
    distortions: any[];
}>>;
type FaceLiquefy = TypeOf<typeof FaceLiquefy>;

type NodeEvent = {
    type: NodeEventType.EXECUTING;
    data: {
        id: string;
        type: string;
    };
} | {
    type: NodeEventType.ACTIVE;
    data: {
        id?: string;
        type: string;
    };
} | {
    type: NodeEventType.EXEC_COMPLETED;
    data: {
        id: string;
        type: string;
    };
} | {
    type: `event/${string}`;
    data?: unknown;
};
declare enum NodeEventType {
    EXECUTING = "EXECUTING",
    ACTIVE = "ACTIVE",
    EXEC_COMPLETED = "EXEC_COMPLETED"
}

interface NodeJSON {
    id: ID;
    label: string;
    type: string;
    inputs: Socket[];
    outputs: Socket[];
}

interface GraphJSON {
    nodes: NodeJSON[];
}

// 定义节点的 schema, 定义节点类型和拥有的端口等信息
// 可以被通过该 schema 校验 graphNode 是否符合预期
type NodeSpec = {
    label: readonly string;
    type: readonly string;
    inputs: readonly Omit<Socket, "links">[];
    outputs: readonly Omit<Socket, "links">[];
};

// 引擎运行的上下文

interface RuntimeContext {
    [key: string | number | symbol]: any;
}

type SocketMapType<T extends readonly Omit<Socket, "links">[]> = {
    [K in T[number] as K["name"]]: SocketType[K["type"]];
};

type SocketReader<T extends readonly Omit<Socket, "links">[]> = <N extends keyof SocketMapType<T>>(socketName: N) => SocketMapType<T>[N];
type SocketWriter<T extends readonly Omit<Socket, "links">[]> = <N extends keyof SocketMapType<T>>(
    socketName: N,
    value: SocketMapType<T>[N]
) => void;
type CommitNext<T extends readonly Omit<Socket, "links">[]> = <N extends keyof SocketMapType<T>>(nextName: N, callback?: () => void) => void;

interface NodeMethodArgs<T extends NodeSpec, D, C> {
    read: SocketReader<[...T["inputs"], ...T["outputs"]]>;
    write: SocketWriter<[...T["outputs"]]>;
    deps: { [K in D[number]]: C[K] };
    socketName?: T["inputs"][number]["name"]; // 当前节点的激活是由哪个端口进入的
    id: string; // 当前节点的 id
    event?: NodeEvent; // 事件节点触发的事件
}

// 节点构造器，由用户定义
interface NodeConstructor<
    Spec extends NodeSpec = NodeSpec,
    D extends readonly (keyof RuntimeContext)[] = readonly (keyof RuntimeContext)[],
    C extends RuntimeContext = RuntimeContext
> {
    run?(args: NodeMethodArgs<Spec, D, C> & { next: CommitNext<Spec["outputs"]> }): void | Promise<void>;
    // 实例化该节点时调用
    init?(args: NodeMethodArgs<Spec, D, C>): void;
    dispose?(args: NodeMethodArgs<Spec, D, C>): void;
}

// 包含节点构造器，节点定义, 以及上下文依赖
type NodeDefinition<C extends RuntimeContext = any, Spec extends NodeSpec = any, D = readonly (keyof C)[]> = {
    spec: Spec;
    deps?: D; // 节点的依赖，节点运行时引擎会从 RuntimeContext 中获取相关依赖供及节点使用
    constructor?: NodeConstructor<Spec, D, C>;
};

type ID = string;

interface SocketType {
    flow: undefined;
    number: number;
    string: string;
    boolean: boolean;
    any: any;
}

interface Link {
    nodeId: ID;
    socketName: string;
}

interface Socket {
    name: string;
    type: keyof SocketType;
    value?: string | number | boolean; // flow 没有 value
    links: Link[];
}

declare class ReusableArrayBuffer {
    private _buffer;
    private readonly _pool;
    private readonly _bufferByteLength;
    private _retainCount;
    constructor(buffer: ArrayBuffer, pool: ArrayBufferPool);
    get buffer(): ArrayBuffer | null;
    reuseTransferredBackBuffer(buffer: ArrayBuffer): void;
    retain(): void;
    release(): void;
}
declare class ArrayBufferPool {
    readonly bufferByteLength: number;
    private _size;
    private readonly _buffers;
    constructor(bufferByteLength: number);
    get size(): number;
    fetchBuffer(): ReusableArrayBuffer;
    __reuseBuffer(buffer: ArrayBuffer): void;
    reclaimResources(): void;
}

declare interface TrackingARResult {
    status: number;
    pose: number[];
    projection: number[];
    accuracy: number;
}

declare interface TrackingARWasmBinary {
    readonly url: string;
    readonly sha256: string;
}

declare const TrackingARWasmBinary: {
    readonly defaultBinary: TrackingARWasmBinary;
};

declare interface EarFittingHead {
    id: number;
    modelMatrix: {
        data: number[];
    };
    projectMatrix: {
        data: number[];
    };
    vertices: Float32Array;
    indices: Uint16Array;
    rightEarProbability: number;
    leftEarProbability: number;
}

declare interface EarFittingResult {
    imageBuffer: ArrayBuffer;
    heads: EarFittingHead[];
}

interface FrameAnalyzerAssets {
    readonly bachWasmBinaries: BachWasmBinaries;
    readonly bachWorkerURL: string;
    readonly trackingARWasmBinary: TrackingARWasmBinary;
    readonly trackingARWorkerURL: string;
}
declare const FrameAnalyzerAssets: {
    readonly defaultAssets: FrameAnalyzerAssets;
};
interface TrackingARMixin {
    trackingARResult?: TrackingARResult;
}
interface EarFittingMixin {
    earFittingResult?: Omit<EarFittingResult, "imageBuffer">;
}
type FrameAnalysisResult = Omit<BachResults, "imageBuffer"> & TrackingARMixin & EarFittingMixin;
interface FrameAnalyzerInputFrame {
    readonly pixelBuffer: ReusableArrayBuffer;
    readonly width: number;
    readonly height: number;
    readonly frameTime: number;
    readonly isMirrored: boolean;
}
declare const PortraitMattingModelTypes: readonly ["accurate-l2", "accurate", "fast"];
type PortraitMattingModelType = (typeof PortraitMattingModelTypes)[number];
declare const PortraitMattingInferenceBackends: readonly ["cpu", "gpu"];
type PortraitMattingInferenceBackend = (typeof PortraitMattingInferenceBackends)[number];

interface FrameRatePreferred {
    readonly type: "preferred";
    readonly frameRate: number;
}
interface FrameRateMatchSource {
    readonly type: "match-source";
}
type FrameRateControl = FrameRatePreferred | FrameRateMatchSource;

interface VirtualBackgroundBlurSettings {
    radius: number;
    brightness: number;
    apertureRotation: number;
}
interface VirtualBackgroundBlur extends VirtualBackgroundBlurSettings {
    readonly type: "blur";
}
interface VirtualBackgroundImage {
    readonly type: "image";
    readonly image: HTMLImageElement;
}
interface VirtualBackgroundVideo {
    readonly type: "video";
    readonly video: HTMLVideoElement;
}
interface VirtualBackgroundColor {
    readonly type: "color";
    readonly r: number;
    readonly g: number;
    readonly b: number;
    readonly a: number;
}

interface VirtualBackgroundImageURL {
    readonly type: "image-url";
    readonly url: string;
}
interface VirtualBackgroundImageFile {
    readonly type: "image-file";
    readonly buffer: ArrayBuffer;
}
interface VirtualBackgroundVideoURL {
    readonly type: "video-url";
    readonly url: string;
}
interface VirtualBackgroundVideoFile {
    readonly type: "video-file";
    readonly buffer: ArrayBuffer;
    readonly mimeType: string;
}
type VirtualBackground = VirtualBackgroundImageURL | VirtualBackgroundImage | VirtualBackgroundColor | Omit<VirtualBackgroundBlur, keyof VirtualBackgroundBlurSettings> | VirtualBackgroundVideo | VirtualBackgroundVideoURL | VirtualBackgroundImageFile | VirtualBackgroundVideoFile;
interface PortraitMattingSettingOptions {
    readonly targetFrameRate: number;
}
interface PortraitMattingSettings {
    readonly inferenceBackend: PortraitMattingInferenceBackend;
    readonly modelType: PortraitMattingModelType;
}
declare class VirtualBackgroundController {
    private readonly _blurSettings;
    private readonly _analyzer;
    private readonly _renderModule;
    private readonly _taskQueue;
    private readonly _videoLoader;
    get blurSettings(): VirtualBackgroundBlurSettings;
    set blurSettings(blur: VirtualBackgroundBlurSettings);
    get portraitMattingModelType(): PortraitMattingModelType;
    updatePortraitMattingModelType(type: PortraitMattingModelType): Promise<void>;
    get preferredPortraitMattingInferenceBackend(): PortraitMattingInferenceBackend;
    updatePreferredPortraitMattingInferenceBackend(type: PortraitMattingInferenceBackend): Promise<void>;
    automaticallyPickPortraitMattingSettings(options: PortraitMattingSettingOptions): Promise<PortraitMattingSettings>;
    updateVirtualBackground(background: VirtualBackground | null): Promise<void>;
    private _updateVirtualBackground;
}

interface FrameRendererAssets {
    readonly faceBeautyWhitenLUTURL: string;
    readonly fingerOccluderURL: string;
    readonly physicsEngineLibraryURL: string;
}
declare const FrameRendererAssets: {
    readonly defaultAssets: FrameRendererAssets;
};

/**
 * Defines the settings for face reshaping.
 */
interface FaceReshapeSettings {
    /**
     * The amount of slimming to apply to the face.
     * @remarks
     * This value should be between 0 and 1, where 0 means no slimming and 1 means maximum slimming.
     */
    faceSlimming: number;
    /**
     * The amount to decrease the size of the face.
     * @remarks
     * This value should be between 0 and 1, where 0 means no decrease and 1 means maximum decrease.
     */
    faceSizeDown: number;
    /**
     * The amount of narrowing to apply to the face.
     * @remarks
     * This value should be between 0 and 1, where 0 means no narrowing and 1 means maximum narrowing.
     */
    faceNarrowing: number;
    /**
     * The amount of slimming to apply to the cheekbones.
     * @remarks
     * This value should be between 0 and 1, where 0 means no slimming and 1 means maximum slimming.
     */
    cheekbone: number;
    /**
     * The amount of slimming to apply to the jawline.
     * @remarks
     * This value should be between 0 and 1, where 0 means no slimming and 1 means maximum slimming.
     */
    jawline: number;
    /**
     * The amount of movement to apply to the chin, where 0 means no movement and negative values mean moving the chin up.
     * @remarks
     * This value should be between -0.5 and 0.5.
     */
    chin: number;
    /**
     * The amount of movement to apply to the hairline, where 0 means no movement and negative values mean moving the hairline down.
     * @remarks
     * This value should be between -0.5 and 0.5.
     */
    hairline: number;
    /**
     * The amount of resizing to apply to the eyes.
     * @remarks
     * This value should be between 0 and 1, where 0 means no resizing and 1 means maximum resizing.
     */
    eyeSize: number;
    /**
     * The amount of movement to apply to the eyes.
     * @remarks
     * This value should be between 0 and 1.
     */
    eyePosition: number;
    /**
     * The amount of spacing to apply to the eyes.
     * @remarks
     * This value should be between 0 and 1.
     */
    eyeDistance: number;
    /**
     * The amount of rotation to apply to the eyes.
     * @remarks
     * This value should be between 0 and 1.
     */
    eyeRotation: number;
    /**
     * The amount of slimming to apply to the nose wings.
     * @remarks
     * This value should be between -0.5 and 0.5.
     */
    noseWings: number;
    /**
     * The amount of movement to apply to the nose.
     * @remarks
     * This value should be between -0.5 and 0.5, where 0 means no movement and negative values mean moving the nose down.
     */
    nosePosition: number;
    /**
     * The amount of resizing to apply to the mouth.
     * @remarks
     * This value should be between -0.5 and 0.5, where 0 means no resizing and positive values mean narrowing.
     */
    mouthSize: number;
    /**
     * The amount of movement to apply to the mouth.
     * @remarks
     * This value should be between 0 and 1, where 0 means no movement and 1 means maximum movement.
     */
    mouthPosition: number;
    /**
     * The amount of smiling to apply to the mouth.
     * @remarks
     * This value should be between 0 and 1.
     */
    smiling: number;
    /**
     * Set all settings to 0.
     */
    clear(): void;
    /**
     * Set all settings to recommended values.
     */
    setToRecommended(): void;
}
declare class FaceAdjustmentController {
    get faceReshapeSettings(): FaceReshapeSettings;
    get faceStretchAmount(): number;
    set faceStretchAmount(value: number);
    private _analyzer;
    private _reshapeSettings;
    private _changeObserver;
    private _previousFaceIdentityValue;
    private _renderModule;
    private reshapeSettingsDidChange;
}

interface ColorLookupTableImageURL {
    readonly type: "url";
    readonly url: string;
}
interface ColorLookupTableImageFile {
    readonly type: "file";
    readonly buffer: ArrayBuffer;
}
type ColorLookupTable = HTMLImageElement | HTMLCanvasElement | ImageData | ColorLookupTableImageURL | ColorLookupTableImageFile | null;
declare class ColorLookupTableController {
    private readonly _renderModule;
    get intensity(): number;
    set intensity(value: number);
    updateColorLookupTable(lut: ColorLookupTable): Promise<void>;
}

declare class FaceDetectorController {
    get maximumFaceCount(): number;
    updateMaximumFaceCount(value: number): Promise<void>;
    private _analyzer;
}

declare class HandDetectorController {
    private _renderModule;
    get handRingPosition(): number;
    updateHandRingPosition(value: number): Promise<void>;
    private _analyzer;
}

/**
 * The controller for face makeup effects.
 */
declare class MakeupController {
    private _renderModule;
    get intensity(): number;
    set intensity(value: number);
}

type WorldTrackerTrackingResetReason = "discontinuous-frame-time" | "frame-orientation-changed";
interface WorldTrackerEvents {
    worldTrackingNeedsReset: {
        readonly reason: WorldTrackerTrackingResetReason;
    };
}
declare class WorldTrackerController {
    private readonly _renderModule;
    private readonly _analyzer;
    private readonly _trackingResetEventToken;
    private readonly _events;
    private readonly _canvasToImagePointConverter;
    get events(): Pick<TypedEventDispatcher<WorldTrackerEvents>, "addEventListener">;
    isWorldTrackingAvailable(): boolean;
    /** Place scene at the specified position. Pass 0.5, 0.5 to place scene in the center. */
    placeScene(normalizedX: number, normalizedY: number): Promise<boolean>;
    updateWorldTransformForPlacementPosition(normalizedX: number, normalizedY: number): Promise<Matrix4x4f | null>;
    get isScenePlaced(): boolean;
    removeScene(): void;
    updateScale(scale: number): void;
    get sceneScale(): number;
    set sceneScale(scale: number);
    get sceneRotationY(): number;
    set sceneRotationY(angle: number);
    dispose(): void;
    __updateDeviceOrientationData(event: DeviceOrientationEvent): void;
    __updateDeviceMotionData(event: DeviceMotionEvent): void;
}

/**
 * Defines the settings for face beauty.
 */
interface FaceBeautySettings {
    /**
     * The amount of skin smoothing to apply.
     */
    skinSmoothingAmount: number;
    /**
     * The sharpness of the skin smoothing effect.
     */
    skinSmoothingSharpness: number;
    /**
     * The amount of whitening to apply.
     */
    whitenAmount: number;
    /**
     * Clears all settings to 0.
     */
    clear(): void;
    /**
     * Set all settings to recommended values.
     */
    setToRecommended(): void;
}

/**
 * The controller for face beauty effects.
 */
declare class FaceBeautyController {
    get settings(): FaceBeautySettings;
    private _renderModule;
}

type ARPipelineDriver = "raf" | "worker";

/** Controls the video mirroring behavior of the renderer.
 * - `auto` The renderer mirrors the video only if the video is from a user-facing camera.
 * - `always-mirror` The renderer always mirrors the video.
 * - `donot-mirror` The renderer does not mirror the video.
 */
type VideoMirroringMode = "auto" | "always-mirror" | "donot-mirror";

/**
 * The content scale mode for the AR content.
 * - `aspect-fill`: The content is scaled to fill the canvas while maintaining the aspect ratio. Some portion of the content may be clipped in order to fill the canvas.
 * - `aspect-fit`: The content is scaled to fit the canvas while maintaining the aspect ratio. Areas of the canvas that do not contain the content are transparent.
 */
type ARContentScaleMode = "aspect-fill" | "aspect-fit";

declare class Color {
    readonly r: number;
    readonly g: number;
    readonly b: number;
    readonly a: number;
    constructor(r: number, g: number, b: number, a: number);
}

interface ARSnapshot {
    toDataURL(type?: string, quality?: number): string;
    getImageData(settings?: ImageDataSettings): ImageData;
    createImageBitmap(options?: ImageBitmapOptions): Promise<ImageBitmap>;
}

interface RenderPluginCanvasDrawingOptions {
    readonly premultipliedAlpha: boolean;
}
interface PostprocessingRenderPluginRenderContext {
    drawCanvas(canvas: HTMLCanvasElement, options?: RenderPluginCanvasDrawingOptions): void;
}
interface PostprocessingRenderPlugin {
    readonly type: RenderPluginType;
    render(renderContext: PostprocessingRenderPluginRenderContext, analysisResult: FrameAnalysisResult, frameInfo: ARPipelineFrameInfo): void | Promise<void>;
}
type RenderPluginType = "postprocessing";
type RenderPlugin = PostprocessingRenderPlugin;

interface ARContentRect {
    readonly x: number;
    readonly y: number;
    readonly width: number;
    readonly height: number;
}

interface __ARFaceAdjustmentsPreviewSource {
    readonly imageURL: string;
    readonly faceInfo: Face;
}
declare class __ARFaceAdjustmentsPreview {
    private readonly _canvas;
    private readonly _source;
    private readonly _sourceImagePersistToken;
    private readonly _renderContext;
    private _filter;
    private _rafID;
    private _isDirty;
    private _lastRenderedCanvasWidth;
    private _lastRenderedCanvasHeight;
    private readonly _taskQueue;
    get sourceImageWidth(): number;
    get sourceImageHeight(): number;
    private constructor();
    static createPreview(canvas: HTMLCanvasElement, source: __ARFaceAdjustmentsPreviewSource): Promise<__ARFaceAdjustmentsPreview>;
    private _renderLoop;
    private _render;
    updateFaceLiquefySettings(faceLiquefy: FaceLiquefy | null | undefined): void;
    dispose(): void;
}

declare abstract class ARScriptSystemNodeDefinition {
    static get definitions(): IterableIterator<NodeDefinition>;
}

interface DebugRenderConfiguration {
    showsFaceLandmarks: boolean;
    showsPortraitMattingMask: boolean;
    showsSkySegmentationMask: boolean;
    showsHandKeyPoints: boolean;
}

interface ARPipelineFrameInfo {
    readonly width: number;
    readonly height: number;
    readonly frameTime: number;
    readonly facingMode?: CameraFacingMode;
}
type ARPipelineFrameDropReason = "empty-video-output";
interface ARPipelineEvents {
    readonly frameDropped: {
        readonly reason: ARPipelineFrameDropReason;
    };
    readonly frameProcessingWillBegin: ARPipelineFrameInfo;
    readonly frameProcessingFailed: {
        readonly frameInfo: ARPipelineFrameInfo;
        readonly error: unknown;
    };
    readonly frameProcessingDidEnd: ARPipelineFrameInfo;
    readonly __frameAnalysisWillBegin: {
        readonly frameInfo: ARPipelineFrameInfo;
        readonly inputFrame: FrameAnalyzerInputFrame;
    };
    readonly frameAnalyzed: {
        readonly frameInfo: ARPipelineFrameInfo;
        readonly analysisResult: Readonly<FrameAnalysisResult>;
    };
    readonly frameRendered: {
        readonly frameInfo: ARPipelineFrameInfo;
        readonly analysisResult: Readonly<FrameAnalysisResult>;
    };
    readonly didClearCanvas: {
        readonly clearColor: Color;
    };
}

type WebVideoUserInteractionRequiredCallback = (continueInUserInteractionCallback: () => void, cancel: () => void) => void;

/**
 * 脚本系统的控制器，用于控制脚本系统模块的运行以及脚本的更新
 */

interface __ARScriptEditorGraph {
    readonly graph: GraphJSON;
    readonly flow: unknown;
}
declare class ARScriptSystemController {
    private _renderModule;
    private _editorGraph;
    private readonly _canvasToImagePointConverter;
    __updateEditorGraph(graph: __ARScriptEditorGraph): void;
    __getEditorGraph(): __ARScriptEditorGraph | undefined;
}

interface ARSessionAuthorizationSettings {
    readonly file: string;
    readonly serviceEndpoint: string;
}
interface ARSessionOptions {
    readonly canvas: HTMLCanvasElement;
    readonly videoSource?: ARVideoSource;
    readonly authorization: ARSessionAuthorizationSettings;
    readonly mediaPlaybackUserInteractionRequiredCallback?: WebVideoUserInteractionRequiredCallback;
    readonly __videoPlayerSettings?: {
        shouldAttachVideoElementToDOM: boolean;
    };
    readonly algorithmPreset: BachAlgorithmPreset;
    readonly analyzerAssets: FrameAnalyzerAssets;
    readonly rendererAssets: FrameRendererAssets;
}
interface ARCameraSource {
    readonly type: "camera";
    readonly facingMode: CameraFacingMode;
}
interface ARVideoURLSource {
    readonly type: "video-url";
    readonly url: string;
}
interface ARVideoStreamSource {
    readonly type: "video-stream";
    readonly stream: MediaStream;
}
interface ARVideoElementSource {
    readonly type: "video";
    readonly element: HTMLVideoElement;
}
interface AREffectLoadingOptions {
    onProgress: (progress: number) => void;
}
/** Video source for the ARSession. You can use a camera (`ARCameraSource`), a video url (`ARVideoURLSource`) or a video stream (`ARVideoStreamSource`) as video source. */
type ARVideoSource = ARCameraSource | ARVideoURLSource | ARVideoStreamSource | ARVideoElementSource;
declare const ARVideoSourceUtilities: Readonly<{
    /** Obtain the description of a video source. */
    describe(source: ARVideoSource): string;
}>;
/**
 * `ARSessionEvents` contains only `ARPipelineEvents` currently.
 * We may extend the `ARSessionEvents` to contain more events in the future.
 */
type ARSessionEvents = ARPipelineEvents;
/** An ARSession object coordinates the major processes of creating an augmented reality experience. */
declare class ARSession {
    private _camera;
    private _video;
    private _externalVideo;
    private _videoSource;
    private _isStarted;
    private _effect;
    private _isDisposed;
    private readonly _mediaPlaybackUserInteractionRequiredCallback;
    private readonly _shouldAttachVideoElementToDOM;
    private readonly _pipeline;
    private readonly _authorizer;
    private readonly _eventDispatcher;
    private readonly _pipelineFrameAnalyzedListener;
    private readonly _cameraStreamRecoverer;
    private readonly _motionSource;
    private readonly _gestureRecognizer;
    private readonly _taskQueue;
    /** The canvas where the renderer draws its output. */
    readonly canvas: HTMLCanvasElement;
    /** Returns event dispatcher of the ARSession. You can listen to session related events using {@link TypedEventDispatcher.addEventListener | `TypedEventDispatcher.addEventListener`} method. */
    get events(): Pick<TypedEventDispatcher<ARSessionEvents>, "addEventListener">;
    /** Returns the video source currently attached to the session. */
    get videoSource(): ARVideoSource;
    /** A boolean that indicates whether an ARSession is running. */
    get isStarted(): boolean;
    /**
     * Create a session object using the speicfied options.
     *
     * You do not need to call this method to create an ARSession object typically.
     * The {@link ARSDK.createSession | `ARSDK.createSession`} method provides an easier way to create an ARSession object.
     */
    constructor(options: ARSessionOptions);
    private _setupGestureRecognizers;
    private _tryRecoveringCameraStream;
    /** Switch the session's video source to the specified one. */
    switchVideoSource(source: ARVideoSource): Promise<void>;
    private _switchVideoSource;
    /** Starts AR processing for the session. */
    start(): Promise<void>;
    private _start;
    /** Stops AR processing for the session. */
    stop(): Promise<void>;
    private _stop;
    /** Load effect from a url. */
    loadEffect(url: string, options?: AREffectLoadingOptions): Promise<void>;
    loadUnpackedEffect(files: Record<string, ArrayBuffer>): Promise<void>;
    /** Clear the current effect. */
    clearEffect(): Promise<void>;
    cancelLoadingEffects(): void;
    private _loadEffect;
    /** Preload a effect from a url. */
    preloadEffect(url: string): Promise<void>;
    private _preloadEffect;
    /**
     * Clears the current effect and remove all downloaded effect from disk cache.
     */
    clearEffectCache(): Promise<void>;
    /** Returns the frame rate control strategy. */
    get frameRateControl(): FrameRateControl;
    /** Set the frame rate control strategy. */
    set frameRateControl(value: FrameRateControl);
    /** Returns the virtual background controller. */
    get virtualBackgroundController(): VirtualBackgroundController;
    get debugRenderConfiguration(): DebugRenderConfiguration;
    /** Returns the face beauty controller. */
    get faceBeautyController(): FaceBeautyController;
    /** Returns the face adjustment controller. */
    get faceAdjustmentController(): FaceAdjustmentController;
    /** Returns the color lookup table controller. */
    get colorLookupTableController(): ColorLookupTableController;
    /** Returns the face detector controller. */
    get faceDetectorController(): FaceDetectorController;
    /** Returns the hand detector controller. */
    get handDetectorController(): HandDetectorController;
    /** Returns the makeup controller. */
    get makeupController(): MakeupController;
    get scriptSystemController(): ARScriptSystemController;
    /** Returns the world tracking controller. */
    get worldTrackerController(): WorldTrackerController;
    get pipelineDriver(): ARPipelineDriver;
    /** Set the ARPipelineDriver. */
    set pipelineDriver(value: ARPipelineDriver);
    /** Returns the video mirroring mode. */
    get videoMirroringMode(): VideoMirroringMode;
    /** Set the video mirroring mode. */
    set videoMirroringMode(mode: VideoMirroringMode);
    /** Returns the content scale mode. */
    get contentScaleMode(): ARContentScaleMode;
    /** Set the content scale mode. */
    set contentScaleMode(mode: ARContentScaleMode);
    get contentRect(): ARContentRect;
    /** Take a snapshot of the AR content. */
    snapshot(): ARSnapshot;
    /**
     * Redraws the last rendered frame onto the canvas. Useful when the canvas is resized.
     */
    redraw(): void;
    addRenderPlugin(plugin: RenderPlugin): void;
    removeRenderPlugin(plugin: RenderPlugin): void;
    /** request motion permission before load slam effect. */
    requestMotionDevicePermission(): Promise<boolean>;
    /**
     * Releases the resources used by the current instance of the ARSession class.
     */
    dispose(): Promise<void>;
    __resetAnalyzerTrackingState(): Promise<void>;
}

/** ARSDK version information. */
declare const ARSDKVersion: Readonly<{
    /** The human readable product version for this SDK. */
    readonly version: string;
    /** A unique identifier for this SDK build. */
    readonly build: string;
    /** The git commit hash of the source code. */
    readonly git: string;
}>;

/**
 * You use `ARSessionContentDuplicator` to duplicate the content of a `ARSession`'s primary canvas to other canvases.
 */
declare class ARSessionContentDuplicator {
    private readonly _targets;
    private readonly _session;
    private readonly _renderEventListener;
    private readonly _clearEventListener;
    private _currentFrameInfo;
    constructor(session: ARSession);
    addTarget(target: HTMLCanvasElement, contentScaleMode?: ARContentScaleMode): void;
    removeTarget(target: HTMLCanvasElement): void;
    private clearToTransparent;
    private duplicateCanvas;
    update(): void;
    dispose(): void;
}

interface ARCanvasFillWindowLayout {
    readonly type: "fill-window";
}
interface ARCanvasFixedSizeLayout {
    readonly type: "fixed-size";
    readonly size: {
        readonly width: number;
        readonly height: number;
    };
}
interface ARCanvasAspectFittingLayout {
    readonly type: "aspect-fitting";
    readonly boundingSize: {
        readonly width: number;
        readonly height: number;
    };
    readonly defaultAspectRatio?: {
        readonly width: number;
        readonly height: number;
    };
}
type ARCanvasLayout = ARCanvasFillWindowLayout | ARCanvasFixedSizeLayout | ARCanvasAspectFittingLayout;
declare class ARSessionCanvasLayoutHelper {
    private readonly _session;
    private _layout;
    private _currentFrameInfo;
    private _liveLayout;
    private _pixelRatio;
    private _animationFrameRequestID;
    private readonly _renderEventListener;
    constructor(session: ARSession, layout: ARCanvasLayout);
    get pixelRatio(): number;
    set pixelRatio(value: number);
    updateLayout(layout: ARCanvasLayout): void;
    private layoutDidChange;
    private liveLayoutTick;
    private layoutCanvas;
    dispose(): void;
}

declare type BachModelNames = "matting_web_big" | "matting_web_small" | "matting_cc_size2_fp32" | "neck_pose" | "face" | "face_extra_size0" | "head_3d" | "head_3d_fitting" | "face_new_landmarks" | "face_fitting_1220" | "ava_boost" | "sky_seg" | "watch_tryon" | "hand_box_reg" | "hand_crop_forefinger" | "hand_crop_little_finger" | "hand_crop_middle_finger" | "hand_crop_ring_finger" | "hand_det" | "hand_lr" | "hand_ring2" | "hand_tracking_ring" | "hand_kp" | "hand_gesture" | "earsegkp" | "face_attribute_age" | "slam_nail";

type AlgorithmModels = Readonly<Record<BachModelNames, {
    readonly url: string;
    readonly sha256: string;
}>>;

interface ARSDKConfiguration {
    readonly algorithmModels: AlgorithmModels;
    readonly analyzerAssets: FrameAnalyzerAssets;
    readonly rendererAssets: FrameRendererAssets;
}
declare abstract class ARSDKConfigurations {
    private constructor();
    static readonly default: ARSDKConfiguration;
    private static _buildDefaultConfiguration;
    private static _buildConfiguration;
    static defaultConfigurationWithResourceBaseURL(baseURL: string): ARSDKConfiguration;
}

/**
 * Options used to create an ARSession.
 */
type ARSDKSessionCreationOptions = Omit<ARSessionOptions, "algorithmPreset" | "analyzerAssets" | "rendererAssets">;
/** A class containing utility functions for creating ARSessions. */
declare abstract class ARSDK {
    /** You cannot create an ARSDK instance. Please use the {@link ARSDK.createSession | `ARSDK.createSession`} method to create an `ARSession`. */
    private constructor();
    /**
     * Create an ARSession.
     * @param options - The options used to create the session.
     * @param configuration - An ARSDKConfiguration object which controls where the SDK load resources from.
     * @returns An ARSession object.
     */
    static createSession(options: ARSDKSessionCreationOptions, configuration?: ARSDKConfiguration): ARSession;
}

interface ARCloudRecognitionConfiguration {
    readonly key: string;
    readonly token: string;
    readonly recognitionServiceEndpoint: string;
    readonly recognitionInterval?: number;
    readonly pausesRecognitionWhenTracking?: boolean;
}

interface ARCloudRecognitionObserver {
    cloudRecognitionTargetDidChange(controller: ARCloudRecognitionController, targetID: string | null): Promise<void> | void;
    cloudRecognitionDidStart?(controller: ARCloudRecognitionController): void;
    cloudRecognitionDidStop?(controller: ARCloudRecognitionController): void;
    cloudRecognitionDidEncounterError?(controller: ARCloudRecognitionController, error: unknown): void;
    cloudRecognitionControllerDidDetachObserver?(controller: ARCloudRecognitionController): void;
}

declare class ARCloudRecognitionController {
    private readonly _configuration;
    private readonly _recognitionInterval;
    private readonly _pausesRecognitionWhenTracking;
    private readonly _frameObserver;
    private readonly _trackingObserver;
    private readonly _encodingCanvas;
    private readonly _encodingContext;
    private readonly _recognitionQueue;
    private _observer;
    private _lastRecognizeDate;
    private _isStarted;
    private _isTracking;
    private _currentTargetID;
    constructor(session: ARSession, configuration: ARCloudRecognitionConfiguration);
    get observer(): ARCloudRecognitionObserver | null;
    set observer(observer: ARCloudRecognitionObserver | null);
    get isStarted(): boolean;
    startCloudRecognition(): void;
    stopCloudRecognition(): void;
    private analyzeImageBuffer;
    private cloudRecognitionTargetDidChange;
    dispose(): void;
}

interface ARCloudRecognitionPlatformEffectConfiguration {
    readonly assetsServiceEndpoint: string;
}
declare class ARCloudRecognitionPlatformEffectLoader implements ARCloudRecognitionObserver {
    private readonly _session;
    private readonly _configuration;
    private _associationPromise;
    constructor(session: ARSession, configuration: ARCloudRecognitionPlatformEffectConfiguration);
    private _getAssociations;
    private _prepare;
    prepare(): Promise<void>;
    cloudRecognitionDidStop(_controller: ARCloudRecognitionController): void;
    cloudRecognitionControllerDidDetachObserver(_controller: ARCloudRecognitionController): void;
    cloudRecognitionDidEncounterError(_controller: ARCloudRecognitionController, error: unknown): void;
    private clearEffect;
    cloudRecognitionTargetDidChange(_controller: ARCloudRecognitionController, targetID: string | null): Promise<void>;
}

type ARCloudRecognitionTargetIDEffectURLMap = {
    [targetID: string]: string;
};
declare class ARCloudRecognitionCustomEffectLoader implements ARCloudRecognitionObserver {
    private readonly _session;
    private readonly _effects;
    constructor(session: ARSession, effects: ARCloudRecognitionTargetIDEffectURLMap);
    cloudRecognitionDidStop(_controller: ARCloudRecognitionController): void;
    cloudRecognitionControllerDidDetachObserver(_controller: ARCloudRecognitionController): void;
    cloudRecognitionDidEncounterError(_controller: ARCloudRecognitionController, error: unknown): void;
    private clearEffect;
    cloudRecognitionTargetDidChange(_controller: ARCloudRecognitionController, targetID: string | null): Promise<void>;
}

interface ARShowcaseSettings {
    readonly targetObjectName?: string;
    readonly targetObjectUUID?: string;
    readonly fieldOfView: number;
    readonly cameraRotationSpeed: number;
    readonly stopsCameraRotationAfterUserInteraction: boolean;
    readonly cameraPolarAngle: number;
    readonly cameraAzimuthAngle: number;
    readonly cameraDistanceScale: number;
    readonly fromCameraPolarAngle?: number;
    readonly fromCameraDistanceScale?: number;
    readonly fromCameraAzimuthAngle?: number;
    readonly transitionDuration: number;
    readonly sceneRotation: {
        readonly x: number;
        readonly y: number;
        readonly z: number;
    };
}
declare const ARShowcaseSettings: {
    defaultSettings: ARShowcaseSettings;
    clone: (settings: ARShowcaseSettings) => ARShowcaseSettings;
};

interface ARShowcaseCameraRotationSettings {
    readonly rotationSpeed?: number;
    readonly stopsAfterUserInteraction?: boolean;
}
declare const ARShowcaseCameraRotationSettings: {
    clone: (settings: ARShowcaseCameraRotationSettings) => ARShowcaseCameraRotationSettings;
};

interface ARShowcaseAuthorizationSettings {
    readonly file: string;
    readonly serviceEndpoint: string;
}

interface ARShowcaseOptions {
    readonly canvas: HTMLCanvasElement;
    readonly authorization: ARShowcaseAuthorizationSettings;
}
interface ARShowcaseEffectLoadingOptions {
    onProgress: (progress: number) => void;
}
declare class ARShowcase {
    readonly canvas: HTMLCanvasElement;
    private readonly _authorizationFile;
    private readonly _authorizer;
    private readonly _renderer;
    private readonly _taskQueue;
    private _isDisposed;
    private _effect;
    constructor(options: ARShowcaseOptions);
    private _kickoffAuthorization;
    /** Load effect from a url. */
    loadEffect(url: string, options?: ARShowcaseEffectLoadingOptions): Promise<void>;
    loadUnpackedEffect(files: Record<string, ArrayBuffer>): Promise<void>;
    /** Clear the current effect. */
    clearEffect(): Promise<void>;
    cancelLoadingEffects(): void;
    private _loadEffect;
    /** Preload a effect from a url. */
    preloadEffect(url: string): Promise<void>;
    private _preloadEffect;
    __updateSettings(settings: Partial<ARShowcaseSettings>, animated?: boolean): Promise<void>;
    resetCamera(animated?: boolean): Promise<void>;
    get overrideCameraRotationSettings(): ARShowcaseCameraRotationSettings;
    set overrideCameraRotationSettings(settings: ARShowcaseCameraRotationSettings);
    /**
     * Releases the resources used by the current instance of the ARShowcase class.
     */
    dispose(): Promise<void>;
}

export { ARCameraSource, ARCanvasAspectFittingLayout, ARCanvasFillWindowLayout, ARCanvasFixedSizeLayout, ARCanvasLayout, ARCloudRecognitionConfiguration, ARCloudRecognitionController, ARCloudRecognitionCustomEffectLoader, ARCloudRecognitionObserver, ARCloudRecognitionPlatformEffectConfiguration, ARCloudRecognitionPlatformEffectLoader, ARCloudRecognitionTargetIDEffectURLMap, ARContentRect, ARContentScaleMode, AREffectLoadingOptions, ARPipelineDriver, ARPipelineEvents, ARPipelineFrameInfo, ARSDK, ARSDKConfiguration, ARSDKConfigurations, ARSDKSessionCreationOptions, ARSDKVersion, ARScriptSystemNodeDefinition, ARSession, ARSessionAuthorizationSettings, ARSessionCanvasLayoutHelper, ARSessionContentDuplicator, ARSessionEvents, ARSessionOptions, ARShowcase, ARShowcaseAuthorizationSettings, ARShowcaseCameraRotationSettings, ARShowcaseEffectLoadingOptions, ARShowcaseOptions, ARSnapshot, ARVideoElementSource, ARVideoSource, ARVideoSourceUtilities, ARVideoStreamSource, ARVideoURLSource, CameraFacingMode, ColorLookupTable, ColorLookupTableController, ColorLookupTableImageFile, ColorLookupTableImageURL, FaceAdjustmentController, FaceBeautyController, FaceBeautySettings, FaceDetectorController, FaceReshapeSettings, FileSystemDebugSupport, FrameAnalysisResult, FrameRateControl, FrameRateMatchSource, FrameRatePreferred, HandDetectorController, MakeupController, PortraitMattingInferenceBackend, PortraitMattingInferenceBackends, PortraitMattingModelType, PortraitMattingModelTypes, PostprocessingRenderPlugin, PostprocessingRenderPluginRenderContext, RenderPlugin, RenderPluginCanvasDrawingOptions, RenderPluginType, TypedEventDispatcher, TypedEventListenerDisposalToken, VideoMirroringMode, VirtualBackground, VirtualBackgroundBlur, VirtualBackgroundBlurSettings, VirtualBackgroundController, VirtualBackgroundImage, VirtualBackgroundImageFile, VirtualBackgroundImageURL, VirtualBackgroundVideo, VirtualBackgroundVideoURL, WebVideoUserInteractionRequiredCallback, WorldTrackerController, __ARFaceAdjustmentsPreview, __ARFaceAdjustmentsPreviewSource };
