@paged-media/introspect-wasm 0.44.0 → 0.45.0

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@paged-media/introspect-wasm",
3
- "version": "0.44.0",
3
+ "version": "0.45.0",
4
4
  "type": "module",
5
5
  "main": "paged_introspect_wasm.js",
6
6
  "types": "paged_introspect_wasm.d.ts",
@@ -5,6 +5,14 @@
5
5
  */
6
6
  export type ScenePathSeg = { op: "moveTo"; x: number; y: number } | { op: "lineTo"; x: number; y: number } | { op: "cubicTo"; cx1: number; cy1: number; cx2: number; cy2: number; x: number; y: number } | { op: "close" };
7
7
 
8
+ /**
9
+ * A plugin gradient paint for [`SceneItem::FillPathGradient`] (C-1.3).
10
+ * Coordinates are frame-content points (mapped by the frame transform
11
+ * like the filled path). Colours are sRGB, linearised at lowering to
12
+ * composite identically to document colours.
13
+ */
14
+ export type SceneGradient = { type: "linear"; x0: number; y0: number; x1: number; y1: number; stops: SceneGradientStop[] } | { type: "radial"; cx: number; cy: number; radius: number; stops: SceneGradientStop[] };
15
+
8
16
  /**
9
17
  * A plugin-submitted vector layer in frame-content coordinates. Keyed
10
18
  * (on the wire) by the host element id of the frame it renders into.
@@ -148,10 +156,22 @@ export interface InvalidationHint {
148
156
  structural: boolean;
149
157
  }
150
158
 
159
+ /**
160
+ * One colour stop in a [`SceneGradient`]. `offset` is `0.0..=1.0` along
161
+ * the gradient axis; the colour is sRGB (linearised at lowering).
162
+ */
163
+ export interface SceneGradientStop {
164
+ offset: number;
165
+ r: number;
166
+ g: number;
167
+ b: number;
168
+ a: number;
169
+ }
170
+
151
171
  /**
152
172
  * One drawable in a [`SceneLayer`]. Coordinates are frame-content points.
153
173
  */
154
- export type SceneItem = { kind: "fillPath"; path: ScenePathSeg[]; paint: ScenePaint } | { kind: "strokePath"; path: ScenePathSeg[]; paint: ScenePaint; width: number } | ({ kind: "text" } & SceneTextItem) | { kind: "image"; rgba: number[]; width: number; height: number; x: number; y: number; w: number; h: number };
174
+ export type SceneItem = { kind: "fillPath"; path: ScenePathSeg[]; paint: ScenePaint } | { kind: "strokePath"; path: ScenePathSeg[]; paint: ScenePaint; width: number } | ({ kind: "text" } & SceneTextItem) | { kind: "image"; rgba: number[]; width: number; height: number; x: number; y: number; w: number; h: number } | { kind: "fillPathGradient"; path: ScenePathSeg[]; gradient: SceneGradient };
155
175
 
156
176
  /**
157
177
  * One stop of a gradient on the wire. Mirrors `GradientStopRef`.
Binary file