import { Seed } from "../rng.js"; import { Genome, Overrides } from "../types.js"; import { PlateCell } from "../plate.js"; import { Keyframe, Orientation, POSE_NAMES, Pose, PoseName, definePose, poseAt, poses, resolvePose } from "../poses.js"; import { FaceOptions, PlateOptions, faceSVG, pickFace, plateSVG, pointerToCanvas } from "../integrations/core.js"; import { ImageFileOptions, ImageFormat, PlateFileOptions, VideoFileOptions, canRecordVideo, faceFile, faceVideoFile, pickVideoMime, plateFile } from "../integrations/export.js"; import { ComputedRef, MaybeRefOrGetter, PropType, Ref } from "vue"; //#region src/vue/index.d.ts interface UseFaceResult { svg: ComputedRef; genome: ComputedRef; /** A one-line summary -- good alt text. */ description: ComputedRef; } /** * One face as SVG. Pass refs, a getter, or a plain object -- anything * reactive re-renders, and nothing else recomputes. */ declare function useFace(options?: MaybeRefOrGetter): UseFaceResult; interface UsePlateResult { svg: ComputedRef; faces: ComputedRef; } /** A grid of faces as SVG, plus where each face landed. */ declare function usePlate(options?: MaybeRefOrGetter): UsePlateResult; interface TurntableOptions { yaw?: number; pitch?: number; /** Degrees of turn per pixel dragged. */ sensitivity?: number; maxYaw?: number; maxPitch?: number; } interface Turntable { yaw: Ref; pitch: Ref; dragging: Ref; reset: () => void; /** `v-bind` this onto the element that should respond to dragging. */ bind: ComputedRef>; } /** Drag-to-turn, in the units `` takes. */ declare function useTurntable(options?: TurntableOptions): Turntable; interface FileState { /** Build the file. Pass overrides to tweak this one call. */ create: (overrides?: Partial) => Promise; /** Build it and hand it straight to the browser as a download. */ download: (overrides?: Partial) => Promise; /** The most recent result, and an object URL for previewing it. */ file: Ref; url: Ref; pending: Ref; error: Ref; reset: () => void; } /** * A face as a downloadable `File` -- png, jpeg, webp or svg. * * const { download, url, pending } = useFaceFile(() => ({ seed, format: 'webp' })) */ declare function useFaceFile(options?: MaybeRefOrGetter): FileState; /** A whole plate as a downloadable `File`. */ declare function usePlateFile(options?: MaybeRefOrGetter): FileState; interface VideoState extends FileState { /** 0 -> 1 while recording. Recording runs in real time. */ progress: Ref; /** Stop early. The clip so far is discarded. */ cancel: () => void; /** False when the browser has no webm recorder. */ supported: boolean; } /** * A looping webm of the face moving through a pose. * * const { create, progress, supported } = useFaceVideo(() => ({ seed, pose: 'nod' })) * * Recording is real time, so a ten second clip takes ten seconds; `progress` * and `pending` are there to say so. */ declare function useFaceVideo(options?: MaybeRefOrGetter): VideoState; /** * One doodle face. * * * */ declare const Face: import("vue").DefineComponent; readonly default: "naives"; }; readonly genome: { readonly type: PropType; readonly default: null; }; readonly traits: { readonly type: PropType; readonly default: undefined; }; /** Degrees. */ readonly yaw: { readonly type: NumberConstructor; readonly default: 0; }; readonly pitch: { readonly type: NumberConstructor; readonly default: 0; }; readonly roll: { readonly type: NumberConstructor; readonly default: 0; }; readonly width: { readonly type: NumberConstructor; readonly default: undefined; }; readonly height: { readonly type: NumberConstructor; readonly default: undefined; }; readonly scale: { readonly type: NumberConstructor; readonly default: undefined; }; readonly background: { readonly type: PropType; readonly default: null; }; readonly paper: { readonly type: PropType; readonly default: undefined; }; readonly backdrop: { readonly type: BooleanConstructor; readonly default: true; }; readonly rough: { readonly type: NumberConstructor; readonly default: 1; }; readonly focal: { readonly type: NumberConstructor; readonly default: 7; }; readonly rig: { readonly type: BooleanConstructor; readonly default: false; }; /** * `svg` inlines a vector drawing and works during server rendering; * `canvas` paints, which is cheaper to re-run every frame. */ readonly as: { readonly type: PropType<"svg" | "canvas">; readonly default: "svg"; }; /** Overrides the generated description used as the accessible label. */ readonly label: { readonly type: StringConstructor; readonly default: undefined; }; }>, () => import("vue").VNode, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, { genome: (g: Genome) => true; }, string, import("vue").PublicProps, Readonly; readonly default: "naives"; }; readonly genome: { readonly type: PropType; readonly default: null; }; readonly traits: { readonly type: PropType; readonly default: undefined; }; /** Degrees. */ readonly yaw: { readonly type: NumberConstructor; readonly default: 0; }; readonly pitch: { readonly type: NumberConstructor; readonly default: 0; }; readonly roll: { readonly type: NumberConstructor; readonly default: 0; }; readonly width: { readonly type: NumberConstructor; readonly default: undefined; }; readonly height: { readonly type: NumberConstructor; readonly default: undefined; }; readonly scale: { readonly type: NumberConstructor; readonly default: undefined; }; readonly background: { readonly type: PropType; readonly default: null; }; readonly paper: { readonly type: PropType; readonly default: undefined; }; readonly backdrop: { readonly type: BooleanConstructor; readonly default: true; }; readonly rough: { readonly type: NumberConstructor; readonly default: 1; }; readonly focal: { readonly type: NumberConstructor; readonly default: 7; }; readonly rig: { readonly type: BooleanConstructor; readonly default: false; }; /** * `svg` inlines a vector drawing and works during server rendering; * `canvas` paints, which is cheaper to re-run every frame. */ readonly as: { readonly type: PropType<"svg" | "canvas">; readonly default: "svg"; }; /** Overrides the generated description used as the accessible label. */ readonly label: { readonly type: StringConstructor; readonly default: undefined; }; }>> & Readonly<{ onGenome?: ((g: Genome) => any) | undefined; }>, { readonly genome: Genome | null; readonly seed: Seed; readonly traits: Overrides; readonly yaw: number; readonly pitch: number; readonly roll: number; readonly width: number; readonly height: number; readonly scale: number; readonly background: string | null; readonly paper: number | boolean; readonly backdrop: boolean; readonly rough: number; readonly focal: number; readonly rig: boolean; readonly as: "svg" | "canvas"; readonly label: string; }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>; /** * A sheet of faces. * * */ declare const Plate: import("vue").DefineComponent; readonly default: "plate"; }; readonly traits: { readonly type: PropType; readonly default: undefined; }; /** Degrees: the widest each face may turn, tilt and lean. */ readonly turn: { readonly type: NumberConstructor; readonly default: 0; }; readonly tilt: { readonly type: NumberConstructor; readonly default: 0; }; readonly lean: { readonly type: NumberConstructor; readonly default: 3; }; readonly width: { readonly type: NumberConstructor; readonly default: undefined; }; readonly height: { readonly type: NumberConstructor; readonly default: undefined; }; readonly scaleFactor: { readonly type: NumberConstructor; readonly default: 0.3; }; readonly background: { readonly type: PropType; readonly default: null; }; readonly paper: { readonly type: PropType; readonly default: undefined; }; readonly rough: { readonly type: NumberConstructor; readonly default: 1; }; readonly as: { readonly type: PropType<"svg" | "canvas">; readonly default: "svg"; }; readonly label: { readonly type: StringConstructor; readonly default: undefined; }; }>, () => import("vue").VNode, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, { select: (cell: PlateCell) => true; faces: (cells: PlateCell[]) => boolean; }, string, import("vue").PublicProps, Readonly; readonly default: "plate"; }; readonly traits: { readonly type: PropType; readonly default: undefined; }; /** Degrees: the widest each face may turn, tilt and lean. */ readonly turn: { readonly type: NumberConstructor; readonly default: 0; }; readonly tilt: { readonly type: NumberConstructor; readonly default: 0; }; readonly lean: { readonly type: NumberConstructor; readonly default: 3; }; readonly width: { readonly type: NumberConstructor; readonly default: undefined; }; readonly height: { readonly type: NumberConstructor; readonly default: undefined; }; readonly scaleFactor: { readonly type: NumberConstructor; readonly default: 0.3; }; readonly background: { readonly type: PropType; readonly default: null; }; readonly paper: { readonly type: PropType; readonly default: undefined; }; readonly rough: { readonly type: NumberConstructor; readonly default: 1; }; readonly as: { readonly type: PropType<"svg" | "canvas">; readonly default: "svg"; }; readonly label: { readonly type: StringConstructor; readonly default: undefined; }; }>> & Readonly<{ onSelect?: ((cell: PlateCell) => any) | undefined; onFaces?: ((cells: PlateCell[]) => any) | undefined; }>, { readonly seed: Seed; readonly traits: Overrides; readonly width: number; readonly height: number; readonly background: string | null; readonly paper: number | boolean; readonly rough: number; readonly as: "svg" | "canvas"; readonly label: string; readonly cols: number; readonly rows: number; readonly turn: number; readonly tilt: number; readonly lean: number; readonly scaleFactor: number; }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>; //#endregion export { Face, type FaceOptions, FileState, type ImageFileOptions, type ImageFormat, type Keyframe, type Orientation, POSE_NAMES, Plate, type PlateFileOptions, type PlateOptions, type Pose, type PoseName, Turntable, TurntableOptions, UseFaceResult, UsePlateResult, type VideoFileOptions, VideoState, canRecordVideo, definePose, faceFile, faceSVG, faceVideoFile, pickFace, pickVideoMime, plateFile, plateSVG, pointerToCanvas, poseAt, poses, resolvePose, useFace, useFaceFile, useFaceVideo, usePlate, usePlateFile, useTurntable };