import { type Animate } from "./animate"; import type { Palette } from "./color"; import type { Expression } from "./expression"; import { backdrop, type BlobatarOptions } from "./render"; import { type Mark } from "./styles/compose"; export type { BlobatarOptions, Animate, Expression, Mark }; /** * Renders a deterministic blobatar as SVG markup. * * The same name always produces the same output within a major version. The * numeric ranges in `styles/compose.ts`, the bands in `styles/blob.ts`, and the * tone set are all part of that contract. Changing them requires a new major. */ export declare const blobatar: (name: string, opts?: BlobatarOptions) => string; /** * The `` contents and its motion custom properties, separately. * * For renderers that own the outer element themselves — `@blobatar/react` when * animating. Underscored because the shape of this object is not public API. */ export declare function _parts(name: string, opts?: BlobatarOptions): { cls: string | undefined; bg: import("./render").Backdrop | undefined; inner: string; vars: Record | undefined; }; /** * The figure as drawing primitives, for a renderer with no markup to hand a * string to. * * For `@blobatar/react-native`, where the substrate is `react-native-svg` and * there is no `innerHTML`. Underscored on the same terms as `_parts` and * `_layout`: reachable through `blobatar/internal`, whose shape changes only on * a major together with every adapter. * * Baked, and that is not a gap in this function. The whole *idle* motion layer * is CSS (a stylesheet, custom properties and a class), so there is nothing * for `animate` to mean on a substrate that has none of the three, and a mark * carries no motion grouping. `expression` *does* work, because a static pose * bakes into the geometry before it gets here. * * A renderer that needs to *morph* between two poses wants the other half of * that: `_posed` below, which hands the figure back before the pose touched it * and the pose back as numbers. * * `transform` is the pose's body wrap, and it is load-bearing rather than * decorative: `expression.bake` returns a `translate(0 N)` for any pose that * shifts the body, and a caller that draws the marks without it puts every * posed blobatar in the wrong place. It is the *only* transform: an eye's * rotation is baked into the points of its path by `superellipse`, not carried * as an attribute. Empty string when there is no pose. */ export declare function _marks(name: string, opts?: BlobatarOptions): { bg: ReturnType; transform: string; marks: Mark[]; }; /** * The figure *unbaked*, with the pose left as numbers, for a renderer that has * to morph between two poses itself. * * The sibling of `_marks` rather than a mode on it, and the split is the point. * `_marks` welds the pose into the geometry, which is exactly right for drawing * one pose and exactly wrong for travelling between two: a morph that re-bakes * regenerates every eye path per frame. So this returns the figure as it was * drawn, before any pose touched it, and hands the pose back as the thirteen * channels `poseTransforms` turns into one transform per eye. What changes * during a morph is those strings and nothing else. * * Static consumers pay nothing for it. They keep calling `_marks`, whose shape * and cost are untouched, and this whole function tree-shakes out of a bundle * that never mentions it, which a mode with a branch inside `_marks` could not * have offered. * * ## What comes back * * `marks` and `eyes` are the same list `_marks` returns, split in two, because * the eyes are the only marks a pose moves and each needs a group of its own. * They are already in draw order: everything in `marks`, then everything in * `eyes`, which is where `marks()` puts them. * * `eyeFrames` is what `poseTransforms` needs, and it is deliberately the *drawn* * centres and lean rather than anything posed: the transforms are built against * the geometry as emitted, so a caller cannot accidentally compose a pose onto a * figure that already wears one. * * `fill` and `hot` are the two ends of the colour travel. `hot` is `null` on * every pose that does not tint, which is most of them, and it is a finished * colour rather than a target, the mix at the pose's own `heat`, so a morph * fades between two hex values exactly as `transition: fill` does on the web. * See `fadeHex`. * * `pose` is `undefined` for no expression, which `lerpPose` reads as idle. * * `expr` is the `.mo-expr` predicate, computed here rather than by the caller * because there is already a copy of it in `motion` above and two would drift. * It answers "is the blobatar wearing an expression at all", which is what * picks the morph's clock: adopting one is quick and returning to idle is * slower, and a renderer with no stylesheet has to make that choice itself. It * goes through `e.vars` for the same reason `motion` does, since an expression * that moves nothing *is* idle and a tint alone is enough to be non-idle. * * Underscored on the same terms as `_marks`, `_parts` and `_layout`. */ export declare function _posed(name: string, opts?: BlobatarOptions): { bg: import("./render").Backdrop | undefined; marks: Mark[]; eyes: Extract[]; eyeFrames: { cx: number; cy: number; rx: number; ry: number; rot: number; }[]; pose: import("./morph").Pose | undefined; expr: boolean; fill: { head: string; eye: string; }; hot: { head: string; eye: string; } | null; }; /** * The numeric layout and resolved palette, before serialization. * * Kept separate from rendering so geometric invariants — features staying * inside the body, the body staying inside the frame — can be asserted directly * rather than by parsing path data back out of the markup. Underscored because * the shape of this object is not public API. */ export declare function _layout(name: string, opts?: BlobatarOptions): { shape: string; draw: ((b: import("./styles/shapes").Body) => string) | undefined; body: import("./styles/shapes").Body; face: import("./styles/shapes").Ellipse; petals: { cx: number; cy: number; r: number; }[]; extra: string[]; eyes: import("./styles/compose").Eye[]; palette: Palette; }; //# sourceMappingURL=blobatar.d.ts.map