@glissade/scene 0.19.1 → 0.20.0-pre.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/collapseReplacer.d.ts +40 -0
- package/dist/constructionProps.js +82 -0
- package/dist/describe.d.ts +27 -1
- package/dist/describe.js +130 -24
- package/dist/diagnostics.d.ts +159 -0
- package/dist/diagnostics.js +384 -0
- package/dist/displayList.d.ts +27 -0
- package/dist/grid.d.ts +56 -0
- package/dist/grid.js +83 -0
- package/dist/identity.d.ts +33 -0
- package/dist/identity.js +67 -0
- package/dist/index.d.ts +14 -302
- package/dist/index.js +19 -523
- package/dist/layout.d.ts +3 -95
- package/dist/layout.js +11 -196
- package/dist/layoutCtors.d.ts +99 -0
- package/dist/layoutCtors.js +210 -0
- package/dist/motion.d.ts +60 -0
- package/dist/motion.js +171 -0
- package/dist/nodes.d.ts +32 -8
- package/dist/nodes.js +62 -187
- package/dist/scene.d.ts +71 -0
- package/dist/scene.js +120 -0
- package/package.json +23 -3
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { C as Mat2x3, D as matEquals, E as invert, O as multiply, S as IDENTITY, T as fromTRS, _ as StrokeStyle, a as FilterSpec, b as glow, c as MeshInterpolation, d as Paint, f as PathSeg, g as ShaderRef, h as ResourceId, i as DrawCommand, l as MeshPaint, m as Resource, n as DisplayList, o as FilterValidationError, p as Rect$1, r as DisplayListBuilder, s as FontSpec, t as BlendMode, u as MeshPoint, v as createDisplayListBuilder, w as applyToPoint, x as validateFilters, y as filtersToCanvasFilter } from "./displayList.js";
|
|
2
|
+
import { t as collapseReplacer } from "./collapseReplacer.js";
|
|
2
3
|
import { $ as setDefaultMeasurer, A as resolveSketch, B as NodeProps, C as Polyline, D as arcLength, E as SketchValidationError, F as AnchorSpec, G as TextMetricsLite, H as resolveAnchor, I as BindablePropTarget, J as estimatingMeasurer, K as __resetEstimateWarnings, L as EvalContext, M as sketchStrokes, N as validateHachure, O as flatten, P as validateSketch, Q as segmentWords, R as HitArea, S as HachureSpec, T as SketchStyle, U as MEASURE_QUANTUM_PX, V as PropInit, W as TextMeasurer, X as quantize, Y as isEstimatingMeasurer, Z as segmentGraphemes, _ as WordBox, a as ImageNode, b as revealSchedule, c as Path, d as RevealMark, f as ShapeProps, g as VideoProps, h as Video, i as Group, j as roughen, k as hachureLines, l as PathProps, m as TextProps, n as Custom, o as ImageProps, p as Text, q as breakLines, r as GraphemeBox, s as LineBox, t as Circle, u as Rect, v as coercePathData, w as ResolvedSketch, x as roundedRectSegs, y as pathFromSegs, z as Node } from "./nodes.js";
|
|
4
|
+
import { a as SceneModule, c as evaluate, i as SceneInit, n as ReservedNodeIdError, o as bindScene, r as Scene, s as createScene, t as DuplicateNodeIdError } from "./scene.js";
|
|
3
5
|
import { a as LayoutEngineMissingError, c as requireLayoutEngine, i as LayoutEngine, l as setLayoutEngine, n as LayoutChildSpec, r as LayoutContainerSpec, s as getLayoutEngine, t as LayoutBox } from "./layoutEngine.js";
|
|
4
|
-
import { BindableSignal,
|
|
6
|
+
import { BindableSignal, CoverageReport, EaseSpec, FontMode, FontUsage, MeshPaint as MeshPaint$1, Rng, Timeline, Track } from "@glissade/core";
|
|
5
7
|
import { ChannelOverride, Clip } from "@glissade/core/clips";
|
|
6
8
|
|
|
7
9
|
//#region src/taxonomy.d.ts
|
|
@@ -23,7 +25,6 @@ declare const NODE_TAXONOMY: readonly ["Group", "Rect", "Circle", "Path", "Text"
|
|
|
23
25
|
type NodeTypeName = (typeof NODE_TAXONOMY)[number];
|
|
24
26
|
//#endregion
|
|
25
27
|
//#region src/highlight.d.ts
|
|
26
|
-
|
|
27
28
|
interface HighlightProps extends NodeProps {
|
|
28
29
|
/** The Text whose lines get the marker. Place this node as an EARLIER
|
|
29
30
|
* sibling (same parent) so it paints behind the glyphs. */
|
|
@@ -302,198 +303,6 @@ type GuardMode = 'throw' | 'warn' | 'off';
|
|
|
302
303
|
*/
|
|
303
304
|
declare function withDeterminismGuards<T>(mode: GuardMode, fn: () => T): T;
|
|
304
305
|
//#endregion
|
|
305
|
-
//#region src/displayDiff.d.ts
|
|
306
|
-
/**
|
|
307
|
-
* The collapse-replacer shared by the cacheKey serializer
|
|
308
|
-
* (`createDisplayListBuilder().cacheKey`), `cacheColdAudit.hashDisplayList`,
|
|
309
|
-
* and `serializeDisplayList` here. CRITICAL: this is BYTE-PRESERVING — the
|
|
310
|
-
* cacheKey it backs stamps into pushGroup and keys the §3.5 raster cache, so
|
|
311
|
-
* its output must not move. The three call sites previously DUPLICATED this
|
|
312
|
-
* byte-for-byte; it lives here once.
|
|
313
|
-
*
|
|
314
|
-
* - ArrayBuffer / typed-array views collapse to a `ab:<len>` / `view:<len>`
|
|
315
|
-
* length marker (opaque binary never belongs in a structural key).
|
|
316
|
-
* - Functions drop (JSON would already drop them; explicit for parity).
|
|
317
|
-
* - Non-finite numbers (`NaN`/`Infinity`/`-Infinity`) collapse to DISTINCT
|
|
318
|
-
* string sentinels. `JSON.stringify` natively serializes all three to the
|
|
319
|
-
* SAME token (`null`), which would collide the cacheKey of two DisplayLists
|
|
320
|
-
* that differ only in WHICH non-finite value reaches a draw field — a stale
|
|
321
|
-
* raster + an `auditCacheCold` false-OK. The distinct sentinels keep them
|
|
322
|
-
* apart. This does NOT touch FINITE numbers (the common path): only the
|
|
323
|
-
* three non-finite inputs change, so the §3.5 cacheKey bytes for every real
|
|
324
|
-
* (finite) list are byte-identical — pinned by the regression guard.
|
|
325
|
-
*
|
|
326
|
-
* NOTE: `-0` is intentionally NOT normalized here. The matrix layer
|
|
327
|
-
* (`matrix.ts`) already normalizes `-0 → 0` at the source, and adding a `-0`
|
|
328
|
-
* pass to THIS replacer would change the cacheKey bytes for any list that ever
|
|
329
|
-
* carried a raw `-0` — silently invalidating the cache cluster-wide. (`-0` is
|
|
330
|
-
* finite, so the non-finite branch never touches it.) Byte preservation wins;
|
|
331
|
-
* the regression guard pins the exact key.
|
|
332
|
-
*/
|
|
333
|
-
declare function collapseReplacer(_key: string, value: unknown): unknown;
|
|
334
|
-
/**
|
|
335
|
-
* One index-aligned, positional delta between two DisplayList command streams.
|
|
336
|
-
*
|
|
337
|
-
* This is the natural per-command shape that `gs verify-determinism --bisect`
|
|
338
|
-
* (a later card) will consume to drill a cache-cold divergence down to the
|
|
339
|
-
* exact op/field. Keep it stable.
|
|
340
|
-
*/
|
|
341
|
-
interface CommandDelta {
|
|
342
|
-
/** Positional command index in BOTH lists (or the longer one for add/remove). */
|
|
343
|
-
index: number;
|
|
344
|
-
/**
|
|
345
|
-
* - `change` — same index present in both, but the commands differ.
|
|
346
|
-
* - `add` — present in `b` only (b is longer past this index).
|
|
347
|
-
* - `remove` — present in `a` only (a is longer past this index).
|
|
348
|
-
*/
|
|
349
|
-
kind: 'change' | 'add' | 'remove';
|
|
350
|
-
/** op of the `a` command (undefined for `add`). */
|
|
351
|
-
opA?: DrawCommand['op'];
|
|
352
|
-
/** op of the `b` command (undefined for `remove`). */
|
|
353
|
-
opB?: DrawCommand['op'];
|
|
354
|
-
/**
|
|
355
|
-
* Field-level changes when both ops match (op changed → a single `op` field).
|
|
356
|
-
* Each entry names the changed prop path with its `from`/`to` JSON values.
|
|
357
|
-
*/
|
|
358
|
-
fields: FieldChange[];
|
|
359
|
-
}
|
|
360
|
-
interface FieldChange {
|
|
361
|
-
/** dotted field path within the command, e.g. `paint.color`, `m`, `text`, `filters`. */
|
|
362
|
-
path: string;
|
|
363
|
-
from: unknown;
|
|
364
|
-
to: unknown;
|
|
365
|
-
}
|
|
366
|
-
interface DisplayDiff {
|
|
367
|
-
/** true when the two lists are byte-identical (the §3.3 determinism contract holds). */
|
|
368
|
-
equal: boolean;
|
|
369
|
-
/** per-command positional deltas, in index order (empty iff `equal`). */
|
|
370
|
-
deltas: CommandDelta[];
|
|
371
|
-
/** size mismatch, when the canvases differ (rare, but a real divergence). */
|
|
372
|
-
size?: {
|
|
373
|
-
from: DisplayList['size'];
|
|
374
|
-
to: DisplayList['size'];
|
|
375
|
-
};
|
|
376
|
-
}
|
|
377
|
-
/**
|
|
378
|
-
* Index-aligned positional diff of two DisplayLists. Command i in `a` is
|
|
379
|
-
* compared to command i in `b`; trailing commands become `add`/`remove`. A
|
|
380
|
-
* single insert/remove cascades — this is the documented v1 cliff.
|
|
381
|
-
*/
|
|
382
|
-
declare function diffDisplayLists(a: DisplayList, b: DisplayList): DisplayDiff;
|
|
383
|
-
/** Human-readable, multi-line rendering of a DisplayDiff (CLI command-tree). */
|
|
384
|
-
declare function formatDisplayDiff(diff: DisplayDiff): string;
|
|
385
|
-
/**
|
|
386
|
-
* The `.dl.json` snapshot interchange schema (DESIGN §7.4). Users commit
|
|
387
|
-
* `.dl.json` baselines, so this carries the SAME break-policy obligation as
|
|
388
|
-
* `Timeline.version` and `SidecarDoc.sidecarVersion`: bump on a breaking shape
|
|
389
|
-
* change. Independent of the API version.
|
|
390
|
-
*/
|
|
391
|
-
declare const DL_SNAPSHOT_VERSION: 1;
|
|
392
|
-
interface DlSnapshot {
|
|
393
|
-
/** Interchange schema version (§7.4) — the third versioned interchange document. */
|
|
394
|
-
dlSnapshotVersion: typeof DL_SNAPSHOT_VERSION;
|
|
395
|
-
size: DisplayList['size'];
|
|
396
|
-
commands: DrawCommand[];
|
|
397
|
-
resources: Resource[];
|
|
398
|
-
}
|
|
399
|
-
/**
|
|
400
|
-
* Serialize a DisplayList to a stable `.dl.json` document string (reusing the
|
|
401
|
-
* byte-preserving collapse-replacer). Round-trips through `parseDisplaySnapshot`.
|
|
402
|
-
*/
|
|
403
|
-
declare function serializeDisplayList(dl: DisplayList): string;
|
|
404
|
-
declare class DlSnapshotError extends Error {
|
|
405
|
-
constructor(message: string);
|
|
406
|
-
}
|
|
407
|
-
/** Parse a `.dl.json` snapshot back into a DisplayList (validates the version). */
|
|
408
|
-
declare function parseDisplaySnapshot(json: string): DisplayList;
|
|
409
|
-
//#endregion
|
|
410
|
-
//#region src/scene.d.ts
|
|
411
|
-
interface Scene {
|
|
412
|
-
readonly root: Group;
|
|
413
|
-
readonly nodes: ReadonlyMap<string, Node>;
|
|
414
|
-
readonly size: {
|
|
415
|
-
w: number;
|
|
416
|
-
h: number;
|
|
417
|
-
};
|
|
418
|
-
/** Per-scene playhead; players and evaluate() write it. */
|
|
419
|
-
readonly playhead: Playhead;
|
|
420
|
-
resolveTarget(target: string): BindablePropTarget | undefined;
|
|
421
|
-
/**
|
|
422
|
-
* Inject the active backend's TextMeasurer (§3.2) so line breaking always
|
|
423
|
-
* measures with the rasterizer that will draw. Defaults to an estimator.
|
|
424
|
-
*/
|
|
425
|
-
setTextMeasurer(measurer: TextMeasurer): void;
|
|
426
|
-
readonly textMeasurer: TextMeasurer;
|
|
427
|
-
}
|
|
428
|
-
declare class DuplicateNodeIdError extends Error {
|
|
429
|
-
constructor(id: string);
|
|
430
|
-
}
|
|
431
|
-
declare class ReservedNodeIdError extends Error {
|
|
432
|
-
constructor(id: string);
|
|
433
|
-
}
|
|
434
|
-
interface SceneInit {
|
|
435
|
-
size: {
|
|
436
|
-
w: number;
|
|
437
|
-
h: number;
|
|
438
|
-
};
|
|
439
|
-
children: Node[];
|
|
440
|
-
}
|
|
441
|
-
/**
|
|
442
|
-
* The scene-module convention: what `gs render`, the golden harness, and the
|
|
443
|
-
* studio load. createScene is a factory — every consumer gets a fresh graph.
|
|
444
|
-
*/
|
|
445
|
-
interface SceneModule {
|
|
446
|
-
createScene(): Scene;
|
|
447
|
-
timeline: Timeline;
|
|
448
|
-
}
|
|
449
|
-
declare function createScene(init: SceneInit): Scene;
|
|
450
|
-
interface BindingCacheEntry {
|
|
451
|
-
compiled: CompiledTimeline;
|
|
452
|
-
bound: BoundTimeline;
|
|
453
|
-
}
|
|
454
|
-
declare function bindScene(scene: Scene, doc: Timeline): BindingCacheEntry;
|
|
455
|
-
/**
|
|
456
|
-
* The non-negotiable contract (§2.5): same (scene, timeline, t) → identical
|
|
457
|
-
* DisplayList, in any call order. Never awaits; asset readiness is the
|
|
458
|
-
* caller's precondition.
|
|
459
|
-
*/
|
|
460
|
-
declare function evaluate(scene: Scene, doc: Timeline, t: number): DisplayList;
|
|
461
|
-
/**
|
|
462
|
-
* Controlled / imperative drive (0.19): `evaluate(scene)` with NO timeline —
|
|
463
|
-
* the host owns the clock. It evaluates against an EMPTY timeline at the
|
|
464
|
-
* scene's current playhead value (`peek()`, 0 by default), so values set
|
|
465
|
-
* imperatively via `node.set(...)` between frames survive into the DisplayList
|
|
466
|
-
* (no track clobbers them). See docs/controlled-drive.md for the loop and the
|
|
467
|
-
* `.set()`-vs-timeline precedence contract.
|
|
468
|
-
*
|
|
469
|
-
* PRECEDENCE: a timeline track ALWAYS overrides `.set()` on the prop it
|
|
470
|
-
* targets while that track is live — pass the timeline through the 3-arg form
|
|
471
|
-
* for animated props; reserve this overload for host-owned props.
|
|
472
|
-
*/
|
|
473
|
-
declare function evaluate(scene: Scene): DisplayList;
|
|
474
|
-
//#endregion
|
|
475
|
-
//#region src/cacheColdAudit.d.ts
|
|
476
|
-
interface CacheColdResult {
|
|
477
|
-
ok: boolean;
|
|
478
|
-
/** id of the first node whose isolated emit() diverged (set only when !ok). */
|
|
479
|
-
node?: string;
|
|
480
|
-
/**
|
|
481
|
-
* The FIRST command-level delta of the divergent node's isolated emit (set only
|
|
482
|
-
* when a specific leaf diverged — never for a Group fallback or a missing node).
|
|
483
|
-
* The WHOLE `CommandDelta` is embedded — index, kind, opA/opB, and every
|
|
484
|
-
* field change — so a multi-field divergence isn't flattened away. `gs
|
|
485
|
-
* verify-determinism --bisect` consumes this to name the (frame, node, op).
|
|
486
|
-
*/
|
|
487
|
-
delta?: CommandDelta;
|
|
488
|
-
}
|
|
489
|
-
/**
|
|
490
|
-
* Evaluate two fresh scenes from `createScene` at `t` and confirm the
|
|
491
|
-
* DisplayLists are byte-identical. Returns `{ ok: true }` for a pure scene, or
|
|
492
|
-
* `{ ok: false, node }` naming the first divergent node. DEV-only — never on
|
|
493
|
-
* the render hot path.
|
|
494
|
-
*/
|
|
495
|
-
declare function auditCacheCold(createScene: () => Scene, doc: Timeline, t: number): CacheColdResult;
|
|
496
|
-
//#endregion
|
|
497
306
|
//#region src/assets.d.ts
|
|
498
307
|
/**
|
|
499
308
|
* Asset contracts (DESIGN.md §3.8): evaluate() never awaits — callers warm
|
|
@@ -558,113 +367,6 @@ interface RenderBackend extends TextMeasurer {
|
|
|
558
367
|
dispose(): void;
|
|
559
368
|
}
|
|
560
369
|
//#endregion
|
|
561
|
-
//#region src/motionPath.d.ts
|
|
562
|
-
/** An arc-length-parameterized sampler over a path. */
|
|
563
|
-
interface PathSampler {
|
|
564
|
-
/** total arc length */
|
|
565
|
-
readonly length: number;
|
|
566
|
-
/** point at arc-length s (clamped to [0, length]) */
|
|
567
|
-
at(s: number): Vec2;
|
|
568
|
-
/** unit tangent at arc-length s (forward direction of travel) */
|
|
569
|
-
tangentAt(s: number): Vec2;
|
|
570
|
-
/** point at normalized progress u in [0, 1] */
|
|
571
|
-
atProgress(u: number): Vec2;
|
|
572
|
-
/** unit tangent at normalized progress u in [0, 1] */
|
|
573
|
-
tangentAtProgress(u: number): Vec2;
|
|
574
|
-
}
|
|
575
|
-
/**
|
|
576
|
-
* Build a reusable arc-length sampler. Densely samples each cubic into a
|
|
577
|
-
* cumulative-length polyline (samplesPerSegment, default 32) so `at`/`tangent`
|
|
578
|
-
* are simple span lerps — smooth enough for motion, no per-call bezier solve.
|
|
579
|
-
*/
|
|
580
|
-
declare function motionPath(path: PathValue, opts?: {
|
|
581
|
-
samplesPerSegment?: number;
|
|
582
|
-
}): PathSampler;
|
|
583
|
-
/** Total arc length of a path. */
|
|
584
|
-
declare function pathLength(path: PathValue): number;
|
|
585
|
-
/** Point at arc-length s along a path (clamped to [0, length]). */
|
|
586
|
-
declare function pointAtLength(path: PathValue, s: number): Vec2;
|
|
587
|
-
interface FollowPathProps extends NodeProps {
|
|
588
|
-
/** the node to move along the path; its position (and rotation, if orient) is owned by this */
|
|
589
|
-
target: Node;
|
|
590
|
-
/** a static PathValue, or a Path node followed LIVE (re-sampled as its `data` morphs) */
|
|
591
|
-
path: PathValue | Path;
|
|
592
|
-
/** 0→1 position along the path's arc length; default 1 (the end). Track `<id>/progress`. */
|
|
593
|
-
progress?: PropInit<number>;
|
|
594
|
-
/** rotate the target to the path tangent — a cursor that points where it heads; default false */
|
|
595
|
-
orient?: boolean;
|
|
596
|
-
/** degrees added to the orient angle (e.g. if the sprite points up at rest) */
|
|
597
|
-
orientOffset?: number;
|
|
598
|
-
samplesPerSegment?: number;
|
|
599
|
-
}
|
|
600
|
-
/**
|
|
601
|
-
* A companion node that drives `target` along `path` as `progress` animates.
|
|
602
|
-
* Owns the target's `position` (and `rotation` when `orient`) via pull-based
|
|
603
|
-
* binding, so there's no eval-order side effect. Add it to the scene (its
|
|
604
|
-
* `progress` is the animatable target); it draws nothing itself.
|
|
605
|
-
*/
|
|
606
|
-
declare class FollowPath extends Node {
|
|
607
|
-
readonly target: Node;
|
|
608
|
-
readonly progress: BindableSignal<number>;
|
|
609
|
-
constructor(props: FollowPathProps);
|
|
610
|
-
protected draw(): void;
|
|
611
|
-
}
|
|
612
|
-
/** `children: [route, cursor, followPath(cursor, route, { orient: true })]` — cursor traces the route.
|
|
613
|
-
* Pass the Path *node* to follow it as it morphs; pass a PathValue for a fixed route. */
|
|
614
|
-
declare function followPath(target: Node, path: PathValue | Path, props?: Omit<FollowPathProps, 'target' | 'path'>): FollowPath;
|
|
615
|
-
//#endregion
|
|
616
|
-
//#region src/tokenHighlight.d.ts
|
|
617
|
-
interface TokenRange {
|
|
618
|
-
/** token text (whitespace-insensitive run match) or inclusive [from, to] wordBoxes indices */
|
|
619
|
-
match: string | readonly [number, number];
|
|
620
|
-
/** which occurrence of a string match; default 1 (the first) */
|
|
621
|
-
occurrence?: number;
|
|
622
|
-
/** range id for track targets ('<nodeId>/<rangeId>/fill' …); default 'r<index>' */
|
|
623
|
-
id?: string;
|
|
624
|
-
fill?: PropInit<string>;
|
|
625
|
-
opacity?: PropInit<number>;
|
|
626
|
-
/** 0→1 left-to-right reveal across the range; default 1 */
|
|
627
|
-
progress?: PropInit<number>;
|
|
628
|
-
/** scale about the range rect's center; default 1 */
|
|
629
|
-
scale?: PropInit<number>;
|
|
630
|
-
/** translation of the range's rects, px — shakes and nudges; default [0, 0] */
|
|
631
|
-
offset?: PropInit<Vec2>;
|
|
632
|
-
}
|
|
633
|
-
interface TokenHighlightProps extends NodeProps {
|
|
634
|
-
/** the Text whose tokens get highlighted; place this node as an EARLIER sibling */
|
|
635
|
-
text: Text;
|
|
636
|
-
ranges: TokenRange[];
|
|
637
|
-
/** marker overhang beyond the ink box, [x, y] px; default [4, 2] */
|
|
638
|
-
padding?: [number, number];
|
|
639
|
-
cornerRadius?: number;
|
|
640
|
-
/** re-resolve string matches every frame (animated text); default false — drift throws */
|
|
641
|
-
rematch?: boolean;
|
|
642
|
-
}
|
|
643
|
-
declare class TokenMatchError extends Error {
|
|
644
|
-
constructor(message: string);
|
|
645
|
-
}
|
|
646
|
-
/**
|
|
647
|
-
* Find the Nth whitespace-stripped consecutive run of boxes equal to token.
|
|
648
|
-
* Boundary-exact: a run that diverges mid-segment is not a match; ending
|
|
649
|
-
* mid-segment throws (with the real segment list) rather than half-boxing.
|
|
650
|
-
*/
|
|
651
|
-
declare function matchTokenRun(boxes: WordBox[], token: string, occurrence?: number): [number, number];
|
|
652
|
-
declare class TokenHighlight extends Node {
|
|
653
|
-
readonly target: Text;
|
|
654
|
-
readonly padding: [number, number];
|
|
655
|
-
readonly cornerRadius: number;
|
|
656
|
-
readonly rematch: boolean;
|
|
657
|
-
private readonly ranges;
|
|
658
|
-
constructor(props: TokenHighlightProps);
|
|
659
|
-
private resolveRun;
|
|
660
|
-
protected draw(out: DisplayListBuilder, ctx: EvalContext): void;
|
|
661
|
-
}
|
|
662
|
-
/**
|
|
663
|
-
* `children: [tokenHighlight(para, { ranges: [{ match: '$48,200', fill: cat.money }] }), para]`
|
|
664
|
-
* — each range animates independently via '<id>/<rangeId>/fill|opacity|progress|scale'.
|
|
665
|
-
*/
|
|
666
|
-
declare function tokenHighlight(text: Text, props: Omit<TokenHighlightProps, 'text'>): TokenHighlight;
|
|
667
|
-
//#endregion
|
|
668
370
|
//#region src/fontUsage.d.ts
|
|
669
371
|
/** Walk `scene` for Text nodes; one usage per node carrying its full text. */
|
|
670
372
|
declare function collectTextUsages(scene: Scene): FontUsage[];
|
|
@@ -763,6 +465,15 @@ interface Ctx2DLike<TPath, TDrawable> {
|
|
|
763
465
|
lineCap: string;
|
|
764
466
|
lineJoin: string;
|
|
765
467
|
font: string;
|
|
468
|
+
/**
|
|
469
|
+
* Variable-font axes (CSS `font-variation-settings` form). PRESENT on
|
|
470
|
+
* `@napi-rs/canvas` (a settable context property — the Skia/export path
|
|
471
|
+
* renders the axes) and ABSENT on the browser DOM 2D context (the optional
|
|
472
|
+
* `?` makes it a guarded no-op there, never a throw). The `fillText` case
|
|
473
|
+
* writes it only when a FontSpec carries axes, then resets to `'normal'`, so
|
|
474
|
+
* default Text never touches it (byte-identical FontSpec / pixels).
|
|
475
|
+
*/
|
|
476
|
+
fontVariationSettings?: string;
|
|
766
477
|
textBaseline: string;
|
|
767
478
|
textAlign: string;
|
|
768
479
|
globalAlpha: number;
|
|
@@ -811,6 +522,7 @@ declare class Raster2D<TCanvas extends CanvasLike, TPath extends PathLike, TDraw
|
|
|
811
522
|
private readonly images;
|
|
812
523
|
private readonly videos;
|
|
813
524
|
private warnedShaders;
|
|
525
|
+
private warnedFontVariation;
|
|
814
526
|
/**
|
|
815
527
|
* §3.5 bitmap LRU: device-transform-qualified cacheKey → rasterized layer.
|
|
816
528
|
* A Map preserves insertion order, so the oldest key is `keys().next()` —
|
|
@@ -907,4 +619,4 @@ declare function meshRasterSize(bw: number, bh: number): {
|
|
|
907
619
|
h: number;
|
|
908
620
|
};
|
|
909
621
|
//#endregion
|
|
910
|
-
export { ALL_FILTER_KINDS, type AnchorSpec, type BackendCaps, type BindablePropTarget, type BlendMode, type
|
|
622
|
+
export { ALL_FILTER_KINDS, type AnchorSpec, type BackendCaps, type BindablePropTarget, type BlendMode, type CanvasLike, Circle, ColdAssetError, type Ctx2DLike, Custom, DeterminismViolationError, type DisplayList, type DisplayListBuilder, type DrawCommand, type DrawOnEachOptions, type DrawOnOptions, DuplicateNodeIdError, type EachBox, type EachContext, type EachDistribute, EachError, type EachLayout, type EachMotion, type EachOpts, type EachResult, type EditMark, type EvalContext, type FilterKind, type FilterSpec, FilterValidationError, type FontByteLoader, type FontSpec, type GraphemeBox, Group, type GuardMode, type HachureSpec, Highlight, type HighlightProps, type HitArea, IDENTITY, ImageNode as Image, ImageNode, type ImageDataLike, type ImageHandle, type ImageProps, type LayoutBox, type LayoutChildSpec, type LayoutContainerSpec, type LayoutEngine, LayoutEngineMissingError, type LineBox, MEASURE_QUANTUM_PX, MESH_DOWNSCALE, MESH_SHEPARD_POWER, MESH_SIGMA, type Mat2x3, type MeshInterpolation, type MeshPaint, type MeshPoint, NODE_TAXONOMY, Node, type NodeProps, type NodeTypeName, type Paint, Path, type PathLike, type PathProps, type PathSeg, type Place, type Polyline, type PropInit, Raster2D, type Raster2DHost, Rect, type Rect$1 as RectShape, type RenderBackend, ReservedNodeIdError, type ResolvedSketch, type Resource, type ResourceId, type RevealMark, type Scene, type SceneInit, type SceneModule, type ShaderCaps, ShaderEffect, type ShaderEffectProps, type ShaderRef, type ShapeProps, type SketchStyle, SketchValidationError, type StepMark, type StrokeStyle, Text, TextCursor, type TextCursorProps, type TextMeasurer, type TextMetricsLite, type TextProps, type TypeEdit, type TypewriterResult, type ValidateSceneFontsOptions, Video, type VideoFrameSource, type VideoProps, type WordBox, __resetEstimateWarnings, applyToPoint, arcLength, bindScene, breakLines, coercePathData, collapseReplacer, collectLocalizedTextUsages, collectTextUsages, createDisplayListBuilder, createScene, drawOn, drawOnEach, each, estimatingMeasurer, evaluate, filtersToCanvasFilter, flatten, fontString, fromTRS, getLayoutEngine, glow, hachureLines, highlight, invert, isEstimatingMeasurer, matEquals, meshRasterSize, multiply, pathFromSegs, quantize, rasterizeMesh, requireLayoutEngine, resolveAnchor, resolveSketch, revealSchedule, roughen, roundedRectSegs, segmentGraphemes, segmentWords, setDefaultMeasurer, setLayoutEngine, sketchStrokes, textCursor, typewriter, validateFilters, validateHachure, validateSceneFonts, validateSketch, withDeterminismGuards };
|