@paged-media/introspect-wasm 0.44.1 → 0.46.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.1",
3
+ "version": "0.46.0",
4
4
  "type": "module",
5
5
  "main": "paged_introspect_wasm.js",
6
6
  "types": "paged_introspect_wasm.d.ts",
@@ -5,6 +5,24 @@
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 compositing blend mode for [`SceneItem::FillPathBlend`] (C-1.4).
10
+ * Mirrors the CSS-relevant subset of the display list\'s
11
+ * [`BlendMode`] — `Normal` is intentionally absent (a normal fill is
12
+ * just [`SceneItem::FillPath`]). Maps 1:1 to [`BlendMode`] at
13
+ * lowering, so a plugin\'s `mix-blend-mode` composites identically to
14
+ * a native IDML transparency blend.
15
+ */
16
+ export type SceneBlendMode = "multiply" | "screen" | "overlay" | "darken" | "lighten" | "colorDodge" | "colorBurn" | "hardLight" | "softLight" | "difference" | "exclusion" | "hue" | "saturation" | "color" | "luminosity";
17
+
18
+ /**
19
+ * A plugin gradient paint for [`SceneItem::FillPathGradient`] (C-1.3).
20
+ * Coordinates are frame-content points (mapped by the frame transform
21
+ * like the filled path). Colours are sRGB, linearised at lowering to
22
+ * composite identically to document colours.
23
+ */
24
+ 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[] } | { type: "sweep"; cx: number; cy: number; start_angle: number; stops: SceneGradientStop[] };
25
+
8
26
  /**
9
27
  * A plugin-submitted vector layer in frame-content coordinates. Keyed
10
28
  * (on the wire) by the host element id of the frame it renders into.
@@ -148,10 +166,22 @@ export interface InvalidationHint {
148
166
  structural: boolean;
149
167
  }
150
168
 
169
+ /**
170
+ * One colour stop in a [`SceneGradient`]. `offset` is `0.0..=1.0` along
171
+ * the gradient axis; the colour is sRGB (linearised at lowering).
172
+ */
173
+ export interface SceneGradientStop {
174
+ offset: number;
175
+ r: number;
176
+ g: number;
177
+ b: number;
178
+ a: number;
179
+ }
180
+
151
181
  /**
152
182
  * One drawable in a [`SceneLayer`]. Coordinates are frame-content points.
153
183
  */
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 };
184
+ 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 } | { kind: "fillPathBlend"; path: ScenePathSeg[]; paint: ScenePaint; blend: SceneBlendMode } | { kind: "dropShadow"; path: ScenePathSeg[]; offset_x: number; offset_y: number; blur_radius: number; r: number; g: number; b: number; a: number };
155
185
 
156
186
  /**
157
187
  * One stop of a gradient on the wire. Mirrors `GradientStopRef`.
Binary file