//#region src/core/facehash-data.d.ts type Variant = "gradient" | "solid"; type FaceType = "round" | "cross" | "line" | "curved"; type FacehashData = { /** The face type to render */ faceType: FaceType; /** Index into the colors array */ colorIndex: number; /** Rotation position for 3D effect (-1, 0, or 1 for each axis) */ rotation: { x: number; y: number; }; /** First letter of the name, uppercase */ initial: string; }; /** * Default color palette using Tailwind CSS color values. */ declare const DEFAULT_COLORS: readonly ["#ec4899", "#f59e0b", "#3b82f6", "#f97316", "#10b981"]; //#endregion //#region src/next/handler.d.ts type FacehashHandlerOptions = { /** * Default image size in pixels. * Can be overridden via `?size=` query param. * @default 400 */ size?: number; /** * Default background style. * Can be overridden via `?variant=` query param. * @default "gradient" */ variant?: Variant; /** * Default for showing initial letter. * Can be overridden via `?showInitial=` query param. * @default true */ showInitial?: boolean; /** * Default color palette (hex colors). * Can be overridden via `?colors=` query param (comma-separated). * @default ["#ec4899", "#f59e0b", "#3b82f6", "#f97316", "#10b981"] */ colors?: string[]; /** * Cache-Control header value. * Set to `null` to disable caching. * @default "public, max-age=31536000, immutable" */ cacheControl?: string | null; }; type FacehashHandler = { GET: (request: Request) => Promise; }; /** * Creates a Next.js route handler for generating Facehash avatar images. * * @example * ```ts * // app/api/avatar/route.ts * import { toFacehashHandler } from "facehash/next"; * * export const { GET } = toFacehashHandler(); * ``` * * @example * ```ts * // With custom defaults * export const { GET } = toFacehashHandler({ * size: 200, * variant: "solid", * colors: ["#ff0000", "#00ff00", "#0000ff"], * }); * ``` * * Query parameters: * - `name` (required): String to generate avatar from * - `size`: Image size in pixels (default: 400) * - `variant`: "gradient" or "solid" (default: "gradient") * - `showInitial`: "true" or "false" (default: "true") * - `colors`: Comma-separated hex colors (e.g., "#ff0000,#00ff00") */ declare function toFacehashHandler(options?: FacehashHandlerOptions): FacehashHandler; //#endregion export { DEFAULT_COLORS, type FaceType, type FacehashData, type FacehashHandler, type FacehashHandlerOptions, type Variant, toFacehashHandler }; //# sourceMappingURL=index.d.ts.map