@pixerate/editor 0.109.0 → 0.111.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.
Files changed (66) hide show
  1. package/THIRD_PARTY_NOTICES.md +3 -0
  2. package/dist/blending-DXl06NSx.d.ts +486 -0
  3. package/dist/blending-aOE6Y3UE.d.cts +486 -0
  4. package/dist/chunk-7VOHOPLW.cjs +1136 -0
  5. package/dist/chunk-7VOHOPLW.cjs.map +1 -0
  6. package/dist/chunk-FTBZPI77.cjs +1 -0
  7. package/dist/chunk-FTBZPI77.cjs.map +1 -0
  8. package/dist/{chunk-RE77QYUF.js → chunk-HHZ6ZJTW.js} +880 -86
  9. package/dist/chunk-HHZ6ZJTW.js.map +1 -0
  10. package/dist/{chunk-WMBIJCHA.js → chunk-HNS7UHCM.js} +5 -1
  11. package/dist/{chunk-WMBIJCHA.js.map → chunk-HNS7UHCM.js.map} +1 -1
  12. package/dist/{chunk-CFMWALBM.js → chunk-LQEEDHOP.js} +2 -2
  13. package/dist/{chunk-D37BX2ZA.cjs → chunk-PHUMLSCW.cjs} +1141 -347
  14. package/dist/chunk-PHUMLSCW.cjs.map +1 -0
  15. package/dist/{chunk-AZTZRLDI.cjs → chunk-POGBUYWE.cjs} +92 -92
  16. package/dist/{chunk-AZTZRLDI.cjs.map → chunk-POGBUYWE.cjs.map} +1 -1
  17. package/dist/chunk-VKK5VS2T.js +1 -0
  18. package/dist/{chunk-SZ6KMZNM.cjs → chunk-XIOMMGPD.cjs} +6 -2
  19. package/dist/chunk-XIOMMGPD.cjs.map +1 -0
  20. package/dist/{chunk-3PHA3UKI.js → chunk-Z4BC6M74.js} +523 -121
  21. package/dist/chunk-Z4BC6M74.js.map +1 -0
  22. package/dist/{export-BLPLaE6Z.d.ts → export-DBNVwb6h.d.ts} +521 -12
  23. package/dist/{export-DSUc4fQD.d.cts → export-DoDhCszr.d.cts} +521 -12
  24. package/dist/image-editor/index.cjs +1630 -900
  25. package/dist/image-editor/index.cjs.map +1 -1
  26. package/dist/image-editor/index.d.cts +104 -16
  27. package/dist/image-editor/index.d.ts +104 -16
  28. package/dist/image-editor/index.js +776 -46
  29. package/dist/image-editor/index.js.map +1 -1
  30. package/dist/paint/index.cjs +28 -4
  31. package/dist/paint/index.cjs.map +1 -1
  32. package/dist/paint/index.d.cts +3 -89
  33. package/dist/paint/index.d.ts +3 -89
  34. package/dist/paint/index.js +27 -3
  35. package/dist/paint-editor/index.cjs +1052 -286
  36. package/dist/paint-editor/index.cjs.map +1 -1
  37. package/dist/paint-editor/index.d.cts +302 -23
  38. package/dist/paint-editor/index.d.ts +302 -23
  39. package/dist/paint-editor/index.js +848 -82
  40. package/dist/paint-editor/index.js.map +1 -1
  41. package/dist/raster/index.cjs +5 -3
  42. package/dist/raster/index.cjs.map +1 -1
  43. package/dist/raster/index.d.cts +2 -2
  44. package/dist/raster/index.d.ts +2 -2
  45. package/dist/raster/index.js +4 -2
  46. package/dist/{render-C-fO_mes.d.cts → render-BEriFuqK.d.cts} +1 -1
  47. package/dist/{render-OLIMk_v0.d.ts → render-tjzKaik-.d.ts} +1 -1
  48. package/dist/{surface-CkKOHGPm.d.cts → surface-C8RRg_Bh.d.cts} +109 -1
  49. package/dist/{surface-CkKOHGPm.d.ts → surface-C8RRg_Bh.d.ts} +109 -1
  50. package/package.json +1 -1
  51. package/skills/pixerate-image-editor/SKILL.md +27 -30
  52. package/skills/pixerate-image-editor/references/shapes-and-type.md +60 -0
  53. package/skills/pixerate-paint-editor/SKILL.md +49 -13
  54. package/dist/chunk-3PHA3UKI.js.map +0 -1
  55. package/dist/chunk-6BU5WU4R.cjs +0 -1
  56. package/dist/chunk-6BU5WU4R.cjs.map +0 -1
  57. package/dist/chunk-D37BX2ZA.cjs.map +0 -1
  58. package/dist/chunk-HUFQD4CB.cjs +0 -734
  59. package/dist/chunk-HUFQD4CB.cjs.map +0 -1
  60. package/dist/chunk-RE77QYUF.js.map +0 -1
  61. package/dist/chunk-SZ6KMZNM.cjs.map +0 -1
  62. package/dist/chunk-XYBJKUAU.js +0 -1
  63. package/dist/mixer-5ziHU8OS.d.cts +0 -282
  64. package/dist/mixer-DNqiYXYQ.d.ts +0 -282
  65. /package/dist/{chunk-CFMWALBM.js.map → chunk-LQEEDHOP.js.map} +0 -0
  66. /package/dist/{chunk-XYBJKUAU.js.map → chunk-VKK5VS2T.js.map} +0 -0
@@ -1,9 +1,9 @@
1
- import { e as RasterLayerBase, f as RasterMask$1, b as RasterPixelLayer, G as GroupBlendMode, E as EffectFill, g as GlobalLight, h as EffectPattern, I as Interpolation, i as LayerLocation$1, L as LayerLocks, j as LayerEffect, k as LayerEffects, d as RasterSources, c as RasterCompositor, l as CompositorOptions, m as LayerEffectKind, n as EffectContext } from './render-OLIMk_v0.js';
2
- import { P as PixelSurface, B as BlendMode, a as TiledSurface } from './surface-CkKOHGPm.js';
1
+ import { e as RasterLayerBase, f as RasterMask$1, b as RasterPixelLayer, G as GroupBlendMode, E as EffectFill, g as GlobalLight, h as EffectPattern, I as Interpolation, i as LayerLocation$1, L as LayerLocks, j as LayerEffect, k as LayerEffects, d as RasterSources, c as RasterCompositor, l as CompositorOptions, m as LayerEffectKind, n as EffectContext } from './render-tjzKaik-.js';
2
+ import { b as PixelSurface, B as BlendMode, a as TiledSurface } from './surface-C8RRg_Bh.js';
3
3
  import { A as AffineMatrix, Q as Quad, a as WarpMesh, V as Vec2$1, H as Homography } from './types-CwMPoRMU.js';
4
- import { v as VectorSubpath, n as Vec2 } from './types-DtL_qLFz.js';
5
- import { B as BrushSettings, M as MixerSettings, a as MixerLoad, c as StrokeCoverage, d as MixerTarget, e as MixerStroke, f as StrokeApply, S as StrokePoint } from './mixer-DNqiYXYQ.js';
6
4
  import { B as BezierPath } from './bezier-DYBvLgUH.js';
5
+ import { v as VectorSubpath, n as Vec2 } from './types-DtL_qLFz.js';
6
+ import { B as BrushSettings, M as MixerSettings, d as MixerLoad, f as StrokeCoverage, g as MixerTarget, h as MixerStroke, i as StrokeApply, c as StrokePoint } from './blending-DXl06NSx.js';
7
7
  import { W as WarpPreset } from './warp-CWHZzE3x.js';
8
8
 
9
9
  /**
@@ -321,6 +321,118 @@ interface ShapeLayer extends LayerBase {
321
321
  annotation?: Annotation;
322
322
  psd?: ShapePsdData;
323
323
  }
324
+ /**
325
+ * The character style of a run of text (Photoshop's Character panel). Sizes are document pixels;
326
+ * tracking is in 1/1000 em.
327
+ */
328
+ interface TextStyle {
329
+ /** Family name ("Inter"); fonts the system lacks fall back to a generic family, with a warning. */
330
+ fontFamily: string;
331
+ /** CSS weight, 100..900 (default 400). */
332
+ fontWeight: number;
333
+ /** Default false. */
334
+ italic?: boolean;
335
+ /** Font size in pixels. */
336
+ fontSize: number;
337
+ /** `#rrggbb`. */
338
+ color: string;
339
+ /** 0..1 (missing = 1). */
340
+ opacity?: number;
341
+ /** Letter spacing in 1/1000 em (missing = 0). */
342
+ tracking?: number;
343
+ /** Baseline-to-baseline distance in pixels; missing = auto (the paragraph's `autoLeading` × size). */
344
+ leading?: number;
345
+ /** Pixels; positive raises the text (missing = 0). */
346
+ baselineShift?: number;
347
+ underline?: boolean;
348
+ strikethrough?: boolean;
349
+ /** PostScript name from a PSD (`ArialMT`), kept so the exact face can be found and written back. */
350
+ postScriptName?: string;
351
+ }
352
+ /** A character style over `length` UTF-16 code units of the text, in order. */
353
+ interface TextRun {
354
+ length: number;
355
+ style: TextStyle;
356
+ }
357
+ type TextAlign = 'left' | 'center' | 'right' | 'justify';
358
+ declare const TEXT_ALIGNS: readonly TextAlign[];
359
+ /** Paragraph style (Photoshop's Paragraph panel); lengths in pixels. */
360
+ interface ParagraphStyle {
361
+ /** Default `left`. `justify` stretches every line of a paragraph box but the last. */
362
+ align?: TextAlign;
363
+ /** Auto leading as a multiple of the font size (default 1.2). */
364
+ autoLeading?: number;
365
+ firstLineIndent?: number;
366
+ startIndent?: number;
367
+ endIndent?: number;
368
+ spaceBefore?: number;
369
+ spaceAfter?: number;
370
+ }
371
+ /** A paragraph style over `length` UTF-16 code units (whole paragraphs, line break included). */
372
+ interface ParagraphRun {
373
+ length: number;
374
+ style: ParagraphStyle;
375
+ }
376
+ /** PSD data of a type layer kept for round trips (see the PSD module). */
377
+ interface TypePsdData {
378
+ /** The `TySh` block as read, written back while the text and styles are unchanged. */
379
+ tySh?: Uint8Array;
380
+ /** Additional-info blocks we do not model, by key. */
381
+ blocks?: Array<{
382
+ key: string;
383
+ data: Uint8Array;
384
+ }>;
385
+ }
386
+ /**
387
+ * A type layer: styled text laid out as point text (one line per paragraph, growing from its
388
+ * origin) or paragraph text (wrapped in a box), placed in the document by `transform`. `surface` is
389
+ * the rendered text in document space (offset 0), drawn by the editor's text shaper on every change;
390
+ * the compositor draws it like a pixel layer's pixels. Never paint into it: rasterize the layer.
391
+ */
392
+ interface TypeLayer extends LayerBase {
393
+ type: 'type';
394
+ text: string;
395
+ /** Character runs covering the text in order (lengths add up to `text.length`). */
396
+ runs: TextRun[];
397
+ /** Paragraph runs covering the text in order. */
398
+ paragraphs: ParagraphRun[];
399
+ /**
400
+ * `point`: text space (0, 0) is the first line's baseline at its alignment edge (`origin: 'top'`:
401
+ * the top of the first line instead, as text annotations were drawn). `box`: text wraps inside
402
+ * `width × height` with its top-left at (0, 0).
403
+ */
404
+ frame: {
405
+ kind: 'point';
406
+ origin?: 'baseline' | 'top';
407
+ } | {
408
+ kind: 'box';
409
+ width: number;
410
+ height: number;
411
+ };
412
+ /** Text space → document (missing = identity). */
413
+ transform?: AffineMatrix;
414
+ /** Default true. */
415
+ antiAlias?: boolean;
416
+ /** The rendered pixels, document space. */
417
+ surface: PixelSurface;
418
+ /** Always (0, 0): a type layer moves through its transform. */
419
+ offset: {
420
+ x: number;
421
+ y: number;
422
+ };
423
+ /** 0..1, PSD "Fill" (missing = 1). */
424
+ fillOpacity?: number;
425
+ /**
426
+ * How `surface` was made: missing when the shaper laid it out; `'stored'` for pixels kept from a
427
+ * PSD or a save made where no shaper could draw it (the first edit draws it again).
428
+ */
429
+ rendering?: 'stored';
430
+ /** Families the last render had to replace with a fallback. */
431
+ missingFonts?: string[];
432
+ /** The text annotation this layer was migrated from, while it still is that annotation. */
433
+ annotation?: Annotation;
434
+ psd?: TypePsdData;
435
+ }
324
436
  /** A nested layer document: the contents of a smart object made from layers (or an embedded PSD). */
325
437
  interface SmartDocument {
326
438
  /** Bottom to top, on a canvas of the contents' `width × height`. */
@@ -436,7 +548,7 @@ interface SmartObjectLayer extends LayerBase {
436
548
  fillOpacity?: number;
437
549
  psd?: SmartPsdData;
438
550
  }
439
- type ImageLayer = PixelLayer | AdjustmentLayerNode | GroupLayer | AnnotationLayer | SmartObjectLayer | ShapeLayer;
551
+ type ImageLayer = PixelLayer | AdjustmentLayerNode | GroupLayer | AnnotationLayer | SmartObjectLayer | ShapeLayer | TypeLayer;
440
552
  type ImageLayerType = ImageLayer['type'];
441
553
  /** Which part of the active layer painting targets (`filter-mask`: a smart object's filter mask). */
442
554
  type LayerTarget = 'pixels' | 'mask' | 'filter-mask';
@@ -457,15 +569,242 @@ declare function isSpatialFilter(f: LayerFilter): boolean;
457
569
  declare function pixelLayerBounds(layer: PixelLayer, surface?: PixelSurface): CropBox | null;
458
570
  /** Human label of a layer kind. */
459
571
  declare function layerTypeLabel(type: ImageLayerType): string;
460
- /** Layers whose pixels are a surface the compositor draws (pixel layers, smart objects, shapes). */
461
- declare function hasSurface(layer: ImageLayer): layer is PixelLayer | SmartObjectLayer | ShapeLayer;
462
- /** Layers whose `surface` is a render cache of their own data (smart objects, shapes): never paint into it. */
463
- declare function isRenderedLayer(layer: ImageLayer): layer is SmartObjectLayer | ShapeLayer;
572
+ /** Layers whose pixels are a surface the compositor draws (pixel layers, smart objects, shapes, type). */
573
+ declare function hasSurface(layer: ImageLayer): layer is PixelLayer | SmartObjectLayer | ShapeLayer | TypeLayer;
574
+ /** Layers whose `surface` is a render cache of their own data (smart objects, shapes, type): never paint into it. */
575
+ declare function isRenderedLayer(layer: ImageLayer): layer is SmartObjectLayer | ShapeLayer | TypeLayer;
464
576
  /** Every shape layer in the stack. */
465
577
  declare function shapeLayers(layers: readonly ImageLayer[]): ShapeLayer[];
466
578
  /** Every smart object in the stack (nested contents not included). */
467
579
  declare function smartObjectLayers(layers: readonly ImageLayer[]): SmartObjectLayer[];
468
580
 
581
+ /**
582
+ * Type layers: styled runs of text laid out as point or paragraph text and drawn into the layer's
583
+ * `surface` by a text shaper.
584
+ *
585
+ * Layout (paragraphs, line breaking, alignment, tracking, leading, indents, spacing) is ours and
586
+ * runs anywhere. What needs fonts goes through a `TextShaper`: font availability and fallback,
587
+ * metrics, advance widths and drawing, either as glyph outlines (pure; rendered by the shape
588
+ * rasterizer, and what Convert to Shape needs) or onto a 2D canvas (the browser's own text). The
589
+ * editor uses a Canvas 2D shaper in browsers; hosts can plug in another (an OpenType outline
590
+ * shaper, or one for a server). Without a shaper, type layers keep the pixels they were saved with
591
+ * and refuse edits that would need drawing them again.
592
+ */
593
+
594
+ /** A font as a shaper is asked for it (sizes in pixels). */
595
+ interface TextFont {
596
+ family: string;
597
+ weight: number;
598
+ italic: boolean;
599
+ size: number;
600
+ postScriptName?: string;
601
+ }
602
+ /**
603
+ * What layout and rendering need from fonts. Implement `outline` (glyph outlines, pure) or `draw`
604
+ * (onto a 2D canvas), or both.
605
+ */
606
+ interface TextShaper {
607
+ /** Identifies the shaper (part of the render cache key). */
608
+ readonly id: string;
609
+ /** The family that draws `font`: the family itself when available, else a fallback (`available: false`). */
610
+ resolve(font: TextFont): {
611
+ family: string;
612
+ available: boolean;
613
+ };
614
+ /** Ascent and descent (both positive, pixels) of the resolved font at `font.size`. */
615
+ metrics(font: TextFont): {
616
+ ascent: number;
617
+ descent: number;
618
+ };
619
+ /**
620
+ * Caret positions of `text` set in `font`: `text.length + 1` x offsets in pixels from the start
621
+ * (kerning included, tracking not).
622
+ */
623
+ measure(text: string, font: TextFont): ArrayLike<number>;
624
+ /** Glyph outlines of `text` with its start on the baseline at (`x`, `y`), pixels, y down. */
625
+ outline?(text: string, font: TextFont, x: number, y: number): BezierPath;
626
+ /** Draws `text` with its start on the baseline at (`x`, `y`) in the context's current transform, fill style and alpha. */
627
+ draw?(ctx: CanvasRenderingContext2D, text: string, font: TextFont, x: number, y: number): void;
628
+ /** Families this shaper can draw (for font pickers and agents), when it can tell. */
629
+ families?(): string[];
630
+ }
631
+ /** What rendering a type layer needs besides the layer. */
632
+ interface TextEnv {
633
+ width: number;
634
+ height: number;
635
+ /** `null`: no shaper here; type layers keep their stored pixels. */
636
+ shaper: TextShaper | null;
637
+ /** A 2D canvas for shapers that `draw` (the editor's renderer provides one). */
638
+ createCanvas?(width: number, height: number): HTMLCanvasElement | OffscreenCanvas;
639
+ }
640
+ declare const DEFAULT_TEXT_STYLE: TextStyle;
641
+ declare const DEFAULT_AUTO_LEADING = 1.2;
642
+ /** Runs fitted to a text of `length` (the last run stretches or is cut), never empty while there is text. */
643
+ declare function fitRuns<R extends {
644
+ length: number;
645
+ style: object;
646
+ }>(runs: readonly R[], length: number, fallback: R['style']): R[];
647
+ /** The style of the run holding code unit `index` (the last run past the end). */
648
+ declare function styleAt<S extends object>(runs: ReadonlyArray<{
649
+ length: number;
650
+ style: S;
651
+ }>, index: number, fallback: S): S;
652
+ /** Runs with `patch(style)` applied over [start, end). */
653
+ declare function restyleRange<S extends object>(runs: ReadonlyArray<{
654
+ length: number;
655
+ style: S;
656
+ }>, start: number, end: number, patch: (s: S) => S): Array<{
657
+ length: number;
658
+ style: S;
659
+ }>;
660
+ /** Runs after replacing [start, end) of the text with `inserted` code units styled `style`. */
661
+ declare function spliceRuns<S extends object>(runs: ReadonlyArray<{
662
+ length: number;
663
+ style: S;
664
+ }>, start: number, end: number, inserted: number, style: S): Array<{
665
+ length: number;
666
+ style: S;
667
+ }>;
668
+ /** Paragraph ranges [start, end) of the text, the line break included in the paragraph it ends. */
669
+ declare function paragraphRanges(text: string): Array<{
670
+ start: number;
671
+ end: number;
672
+ content: number;
673
+ }>;
674
+ /** Paragraph runs snapped to whole paragraphs: each paragraph takes the style at its start. */
675
+ declare function fitParagraphRuns(runs: readonly ParagraphRun[], text: string): ParagraphRun[];
676
+ /** One laid-out character. */
677
+ interface LaidChar {
678
+ /** Index in the text (UTF-16 code unit). */
679
+ index: number;
680
+ /** Text-space x of its start and its advance (tracking and justification included). */
681
+ x: number;
682
+ advance: number;
683
+ }
684
+ /** A run of characters on one line in one style. */
685
+ interface LaidFragment {
686
+ start: number;
687
+ end: number;
688
+ style: TextStyle;
689
+ font: TextFont;
690
+ /** The family the shaper draws it with. */
691
+ family: string;
692
+ x: number;
693
+ /** Baseline in text space (baseline shift applied). */
694
+ y: number;
695
+ /** Per-character x positions relative to `x` (`end − start + 1` entries). */
696
+ carets: number[];
697
+ /** Whether characters are placed one by one (tracking or justification). */
698
+ spaced: boolean;
699
+ }
700
+ interface LaidLine {
701
+ start: number;
702
+ /** End of the line's characters (line break and trailing spaces excluded from `width`). */
703
+ end: number;
704
+ baseline: number;
705
+ ascent: number;
706
+ descent: number;
707
+ x: number;
708
+ width: number;
709
+ chars: LaidChar[];
710
+ fragments: LaidFragment[];
711
+ }
712
+ /** A laid-out type layer in text space. */
713
+ interface TextLayout {
714
+ lines: LaidLine[];
715
+ /** Bounds of the lines (ascent to descent), text space; the box for paragraph text. */
716
+ bounds: CropBox;
717
+ /** Families replaced by a fallback. */
718
+ missingFonts: string[];
719
+ }
720
+ declare function fontOf(style: TextStyle): TextFont;
721
+ /** Lays out a type layer with `shaper` (memoised per layer object and shaper). */
722
+ declare function layoutText(layer: Pick<TypeLayer, 'text' | 'runs' | 'paragraphs' | 'frame'>, shaper: TextShaper): TextLayout;
723
+ /** The text index nearest a text-space point (for clicks): the line under it, then the closest caret. */
724
+ declare function textIndexAt(layout: TextLayout, p: {
725
+ x: number;
726
+ y: number;
727
+ }): number;
728
+ /** The caret at text index `index`: its x and the line's top and bottom, text space. */
729
+ declare function caretAt(layout: TextLayout, index: number): {
730
+ x: number;
731
+ top: number;
732
+ bottom: number;
733
+ line: number;
734
+ };
735
+ /** How far beyond the canvas type renders (as shapes). */
736
+ declare const TEXT_RENDER_MARGIN = 512;
737
+ /** Text space → document of a layer. */
738
+ declare function textMatrix(layer: Pick<TypeLayer, 'transform'>): AffineMatrix;
739
+ /** Glyph outlines of a laid-out layer in document space, one path per fragment (needs an outline shaper). */
740
+ declare function textOutlines(layer: TypeLayer, shaper: TextShaper): Array<{
741
+ fragment: LaidFragment;
742
+ path: BezierPath;
743
+ }>;
744
+ /**
745
+ * Renders a type layer into a document-space surface with the env's shaper, or returns `null`
746
+ * when nothing here can draw it (no shaper, or a drawing shaper without a canvas).
747
+ */
748
+ declare function renderText(layer: TypeLayer, env: TextEnv): {
749
+ surface: PixelSurface;
750
+ missingFonts: string[];
751
+ } | null;
752
+ /** The layer drawn again (`rendering` and `missingFonts` updated); refuses when nothing can draw it. */
753
+ declare function rerenderText(layer: TypeLayer, env: TextEnv): TypeLayer;
754
+ /** Fields of `TextStyle` an edit can set (`null` clears an optional one). */
755
+ declare const TEXT_STYLE_FIELDS: readonly ["fontFamily", "fontWeight", "italic", "fontSize", "color", "opacity", "tracking", "leading", "baselineShift", "underline", "strikethrough"];
756
+ /** `base` with the given style fields changed, validated (`null` clears leading, tracking, …). */
757
+ declare function patchTextStyle(base: TextStyle, patch: Record<string, unknown>, path?: string): TextStyle;
758
+ declare const PARAGRAPH_STYLE_FIELDS: readonly ["align", "autoLeading", "firstLineIndent", "startIndent", "endIndent", "spaceBefore", "spaceAfter"];
759
+ /** `base` with the given paragraph fields changed, validated. */
760
+ declare function patchParagraphStyle(base: ParagraphStyle, patch: Record<string, unknown>, path?: string): ParagraphStyle;
761
+ /** A range of the text from loose input: [start, end) in UTF-16 code units, defaults the whole text. */
762
+ declare function textRange(text: string, start: unknown, end: unknown): [number, number];
763
+ /** The type layer with `id`, or an error saying what it is instead. */
764
+ declare function requireTypeLayer(layers: readonly ImageLayer[], id: string): TypeLayer;
765
+ /** Normalises text: line breaks as `\n`. */
766
+ declare function normalizeText(text: unknown, path?: string): string;
767
+ /** The name Photoshop gives a type layer: its text, cut short. */
768
+ declare function typeLayerName(text: string): string;
769
+ interface TypeLayerData {
770
+ text: string;
771
+ runs: TextRun[];
772
+ paragraphs?: ParagraphRun[];
773
+ frame: TypeLayer['frame'];
774
+ transform?: AffineMatrix;
775
+ name?: string;
776
+ }
777
+ /**
778
+ * A new type layer, laid out and drawn. Without anything to draw it, refused, or with `lenient`
779
+ * kept undrawn (`rendering: 'stored'`, no pixels) until a shaper draws it.
780
+ */
781
+ declare function createTypeLayer(init: TypeLayerData, env: TextEnv, id?: string, lenient?: boolean): TypeLayer;
782
+ /** Changes a type layer (dropping its migrated annotation and stored pixels) and draws it again. */
783
+ declare function updateTypeLayer(layers: readonly ImageLayer[], id: string, change: (layer: TypeLayer) => Partial<TypeLayer>, env: TextEnv, action?: string): {
784
+ layers: ImageLayer[];
785
+ layer: TypeLayer;
786
+ };
787
+ /** A type layer's text with [start, end) replaced by `insert`; new text takes the style at `start`. */
788
+ declare function replaceTextRange(layer: TypeLayer, start: number, end: number, insert: string): Pick<TypeLayer, 'text' | 'runs' | 'paragraphs'>;
789
+ /** A type layer moved by an affine `m` (document space). */
790
+ declare function transformTypeLayer(layer: TypeLayer, m: AffineMatrix): TypeLayer;
791
+ /** Text-space frame of a type layer (the box, or the laid-out lines) for Free Transform. */
792
+ declare function typeFrame(layer: TypeLayer, shaper: TextShaper | null): CropBox;
793
+ /** A type layer as a pixel layer with what it shows now (same id, name, mask, effects, blend). */
794
+ declare function typeAsPixelLayer(layer: TypeLayer): PixelLayer;
795
+ /** Document point → text space of a layer. */
796
+ declare function toTextSpace(layer: Pick<TypeLayer, 'transform'>, p: {
797
+ x: number;
798
+ y: number;
799
+ }): {
800
+ x: number;
801
+ y: number;
802
+ };
803
+ /** The type layer data a text annotation draws, or `null` when its colour can't be read. */
804
+ declare function typeFromAnnotation(a: Annotation): TypeLayerData | null;
805
+ /** The annotation a migrated type layer still is (its blend read from the layer). */
806
+ declare function annotationOfType(layer: TypeLayer): Annotation | null;
807
+
469
808
  /**
470
809
  * Schema version 3 of the image editor document: the layer tree, with pixel layers and painted
471
810
  * masks stored as PNG assets (cropped to their content and placed by position), plus the
@@ -615,7 +954,33 @@ interface SerializedShapeLayer extends SerializedLayerBase {
615
954
  }>;
616
955
  };
617
956
  }
618
- type SerializedLayer = SerializedPixelLayer | SerializedAdjustmentLayer | SerializedGroupLayer | SerializedAnnotationLayer | SerializedSmartObjectLayer | SerializedShapeLayer;
957
+ /** A type layer: its text and styles, plus the pixels it showed (PNG) for loads without its fonts. */
958
+ interface SerializedTypeLayer extends SerializedLayerBase {
959
+ type: 'type';
960
+ text: string;
961
+ runs: TextRun[];
962
+ paragraphs: ParagraphRun[];
963
+ frame: TypeLayer['frame'];
964
+ transform?: number[];
965
+ antiAlias?: false;
966
+ fillOpacity?: number;
967
+ /** The rendered pixels (RGBA PNG) at `x`, `y` in document space. */
968
+ asset?: string;
969
+ x?: number;
970
+ y?: number;
971
+ missingFonts?: string[];
972
+ /** The text annotation the layer was migrated from, while it still is that annotation. */
973
+ annotation?: Annotation;
974
+ /** PSD blocks kept for round trips (base64). */
975
+ psd?: {
976
+ tySh?: string;
977
+ blocks?: Array<{
978
+ key: string;
979
+ data: string;
980
+ }>;
981
+ };
982
+ }
983
+ type SerializedLayer = SerializedPixelLayer | SerializedAdjustmentLayer | SerializedGroupLayer | SerializedAnnotationLayer | SerializedSmartObjectLayer | SerializedShapeLayer | SerializedTypeLayer;
619
984
  /** A version 3 document (layers). */
620
985
  interface SerializedLayeredImageEditorState {
621
986
  version: 3;
@@ -724,6 +1089,8 @@ interface DeserializeContext {
724
1089
  problems: string[];
725
1090
  /** The document's patterns by id, for shapes painted with one. */
726
1091
  pattern?(id: string): EffectPattern | null;
1092
+ /** What draws type layers stored without pixels (and migrated text annotations). */
1093
+ text?: Pick<TextEnv, 'shaper' | 'createCanvas'>;
727
1094
  }
728
1095
  /** Decodes a PNG data URL into pixels of `channels` bytes each. */
729
1096
  declare function decodePngDataUrl(url: string, channels: 1 | 4): {
@@ -1887,6 +2254,8 @@ interface FreeTransformHost {
1887
2254
  pixelsOf(layer: PixelLayer | SmartObjectLayer): TiledSurface;
1888
2255
  /** What shape layers render with (canvas size, document patterns). */
1889
2256
  shapeEnv(): ShapeEnv;
2257
+ /** What type layers lay out and draw with. */
2258
+ textEnv(): TextEnv;
1890
2259
  /** Opaque pre-transform snapshot. */
1891
2260
  capture(): unknown;
1892
2261
  /** Shows a live state (no history). */
@@ -1925,6 +2294,9 @@ declare class FreeTransformSession {
1925
2294
  /** True when the layer is a shape layer (the transform maps its paths and renders them again). */
1926
2295
  readonly shapeLayer: boolean;
1927
2296
  private readonly shape;
2297
+ /** True when the layer is a type layer (the transform sets its text matrix; affine only). */
2298
+ readonly typeLayer: boolean;
2299
+ private readonly typeTarget;
1928
2300
  private geometryValue;
1929
2301
  private readonly smart;
1930
2302
  private readonly smartReduced;
@@ -1962,6 +2334,11 @@ declare class FreeTransformSession {
1962
2334
  * render only the visible part.
1963
2335
  */
1964
2336
  private resampleShape;
2337
+ /**
2338
+ * A type layer with its text matrix set from the corners (affine only: scale, rotate, skew and
2339
+ * flips), drawn again; a linked mask follows by the change's homography.
2340
+ */
2341
+ private resampleType;
1965
2342
  /** A smart object re-rendered from its contents for the current geometry (previews leave the smart filters out). */
1966
2343
  private resampleSmart;
1967
2344
  /** Whether the geometry (or the interpolation of a smart object) differs from where it started. */
@@ -2155,6 +2532,63 @@ interface ShapeLayerInfo {
2155
2532
  /** The annotation id while the layer is still the annotation it was migrated from. */
2156
2533
  annotationId?: string;
2157
2534
  }
2535
+ /** A new type layer: its text, where it goes, and its character and paragraph style. */
2536
+ interface TextLayerInit extends LayerPlacement {
2537
+ text: string;
2538
+ /**
2539
+ * Document x, y of the text's origin: point text's first baseline at its alignment edge (left
2540
+ * edge for left-aligned, centre for centred, right edge for right-aligned); a paragraph box's
2541
+ * top-left.
2542
+ */
2543
+ x: number;
2544
+ y: number;
2545
+ /** Paragraph (area) text: wrap inside a `width × height` box (pixels). Missing: point text. */
2546
+ box?: {
2547
+ width: number;
2548
+ height: number;
2549
+ };
2550
+ /** Character style of the whole text (default 24 px sans-serif, the foreground colour). */
2551
+ style?: Partial<TextStyle>;
2552
+ paragraph?: ParagraphStyle;
2553
+ /** Degrees clockwise about the origin. */
2554
+ rotation?: number;
2555
+ name?: string;
2556
+ opacity?: number;
2557
+ blend?: BlendMode;
2558
+ }
2559
+ /** A type layer as tools and panels read it. Ranges are UTF-16 code units, `end` exclusive. */
2560
+ interface TypeLayerInfo {
2561
+ id: string;
2562
+ name: string;
2563
+ text: string;
2564
+ runs: Array<{
2565
+ start: number;
2566
+ end: number;
2567
+ style: TextStyle;
2568
+ }>;
2569
+ paragraphs: Array<{
2570
+ start: number;
2571
+ end: number;
2572
+ style: ParagraphStyle;
2573
+ }>;
2574
+ frame: TypeLayer['frame'];
2575
+ /** Text space → document. */
2576
+ transform: AffineMatrix;
2577
+ /** Laid-out lines: text range, baseline (text space) and width; empty without a shaper. */
2578
+ lines: Array<{
2579
+ start: number;
2580
+ end: number;
2581
+ baseline: number;
2582
+ width: number;
2583
+ }>;
2584
+ /** Rendered bounds in the document. */
2585
+ bounds: CropBox | null;
2586
+ /** Families drawn with a fallback because they are missing here. */
2587
+ missingFonts: string[];
2588
+ /** `live`: drawn here from the text; `stored`: pixels kept from a file until the next edit. */
2589
+ rendering: 'live' | 'stored';
2590
+ annotationId?: string;
2591
+ }
2158
2592
  /** Paint tools a stroke can use. */
2159
2593
  type StrokeTool = 'brush' | 'eraser' | 'mixer';
2160
2594
  /** A stroke: tool, target (default the active layer and target) and brush / colour overrides. */
@@ -2928,6 +3362,8 @@ declare class ImageEditorController {
2928
3362
  resetDepthMask(): void;
2929
3363
  /** The layer showing annotation `id`: an annotation layer, or a shape layer migrated from it. */
2930
3364
  private annotationLayer;
3365
+ /** What migrating an annotation needs: the canvas size, patterns and the text shaper. */
3366
+ private annotationEnv;
2931
3367
  /**
2932
3368
  * Adds an annotation as its own layer (top of the stack unless `aboveId` is given). Pen,
2933
3369
  * rectangle, ellipse, line and arrow annotations become shape layers that remember the
@@ -2936,7 +3372,7 @@ declare class ImageEditorController {
2936
3372
  */
2937
3373
  addAnnotation(annotation: CreateAnnotationPayload, placement?: AnnotationPlacement): string;
2938
3374
  updateAnnotation(id: string, partial: Partial<Annotation>, commitToHistory?: boolean): void;
2939
- /** `layer` (an annotation or migrated shape layer) showing `annotation` instead, keeping its other properties. */
3375
+ /** `layer` (an annotation, or a shape or type layer migrated from one) showing `annotation` instead, keeping its other properties. */
2940
3376
  private layerForAnnotation;
2941
3377
  removeAnnotation(id: string): void;
2942
3378
  /** Deletes every annotation layer and every shape layer that still is the annotation it was migrated from. */
@@ -3018,6 +3454,72 @@ declare class ImageEditorController {
3018
3454
  * new image has different dimensions). Resolves to the masked layer's id in mask mode.
3019
3455
  */
3020
3456
  applyBackgroundRemovedImage(newDataUrl: string, options?: AIResultOptions): Promise<string | void>;
3457
+ private textShaperValue;
3458
+ /** The shaper that lays out and draws type layers (`null` when there is none here). */
3459
+ getTextShaper(): TextShaper | null;
3460
+ /** Sets the text shaper (fonts) type layers lay out and draw with; existing layers redraw on their next edit. */
3461
+ setTextShaper(shaper: TextShaper | null): void;
3462
+ /** What type layers lay out and draw with. */
3463
+ private textEnv;
3464
+ /** Font families the shaper offers (generic families at least). */
3465
+ listFonts(): string[];
3466
+ private typeInfo;
3467
+ /** A type layer's text, runs, paragraphs, frame, lines and bounds. */
3468
+ getTextLayer(id: string): TypeLayerInfo;
3469
+ /**
3470
+ * Adds a type layer (one undo step) and makes it active: point text at `x`, `y`, or paragraph
3471
+ * text wrapped in `box`. Refused without a text shaper. Returns its id.
3472
+ */
3473
+ addTextLayer(init: TextLayerInit): string;
3474
+ /**
3475
+ * Replaces text [start, end) (default all of it) with `text`; inserted text takes the style at
3476
+ * `start`. One undo step unless `commitToHistory` is false (typing). Returns the layer.
3477
+ */
3478
+ setText(id: string, text: string, range?: {
3479
+ start?: number;
3480
+ end?: number;
3481
+ }, commitToHistory?: boolean): TypeLayerInfo;
3482
+ /** Sets character style fields over [start, end) (default all), one undo step. Returns the layer. */
3483
+ setTextStyle(id: string, style: Partial<TextStyle> & Record<string, unknown>, range?: {
3484
+ start?: number;
3485
+ end?: number;
3486
+ }, commitToHistory?: boolean): TypeLayerInfo;
3487
+ /** Sets paragraph style fields on every paragraph that [start, end) touches (default all), one undo step. */
3488
+ setParagraphStyle(id: string, style: ParagraphStyle & Record<string, unknown>, range?: {
3489
+ start?: number;
3490
+ end?: number;
3491
+ }, commitToHistory?: boolean): TypeLayerInfo;
3492
+ /**
3493
+ * Point text ↔ paragraph text: `{ kind: 'box', width, height }` wraps the text in a box (its
3494
+ * top-left where the first line's top-left is now), `{ kind: 'point' }` sets it on one line per
3495
+ * paragraph. Also resizes a box. One undo step.
3496
+ */
3497
+ setTextFrame(id: string, frame: {
3498
+ kind: 'point';
3499
+ } | {
3500
+ kind: 'box';
3501
+ width: number;
3502
+ height: number;
3503
+ }, commitToHistory?: boolean): TypeLayerInfo;
3504
+ /**
3505
+ * Convert to Shape: the text's glyph outlines become a shape layer with the same id, name and
3506
+ * layer properties (needs a shaper that gives outlines). The fill is the first run's colour;
3507
+ * `warnings` says when other colours were dropped. One undo step.
3508
+ */
3509
+ convertTextToShape(id: string): {
3510
+ layerId: string;
3511
+ warnings: string[];
3512
+ };
3513
+ /** The layout of a type layer (lines, characters, bounds in text space), or `null` without a shaper. */
3514
+ getTextLayout(id: string): TextLayout | null;
3515
+ /** The text index nearest a document point (for clicks on a type layer). */
3516
+ textIndexAt(id: string, point: ImagePoint): number;
3517
+ /** The caret at text index `index` as a document-space segment (top to bottom), for drawing it. */
3518
+ textCaret(id: string, index: number): {
3519
+ top: ImagePoint;
3520
+ bottom: ImagePoint;
3521
+ line: number;
3522
+ } | null;
3021
3523
  /** What shape rendering needs: the canvas size and the document's patterns. */
3022
3524
  private shapeEnv;
3023
3525
  /** One component from tool or UI input (validated). */
@@ -3499,6 +4001,13 @@ interface ExportOptions {
3499
4001
  layerIds?: string[];
3500
4002
  }
3501
4003
  interface ImageEditorOptions {
4004
+ /**
4005
+ * What lays out and draws type layers. Default: the browser's fonts through Canvas 2D
4006
+ * (`createCanvasTextShaper`) where there is a 2D canvas; `null` (or no canvas) keeps type layers'
4007
+ * stored pixels and refuses edits that would draw them. `createOutlineTextShaper` draws from
4008
+ * fonts you load, anywhere, and enables Convert to Shape.
4009
+ */
4010
+ textShaper?: TextShaper | null;
3502
4011
  image?: string | HTMLImageElement;
3503
4012
  initialState?: Partial<SerializedImageEditorState>;
3504
4013
  onStateChange?: (state: ImageEditorState) => void;
@@ -3552,4 +4061,4 @@ interface PsdExportResult {
3552
4061
  /** Writes the prepared stack as PSD (or PSB) bytes. */
3553
4062
  declare function exportPsd(input: PsdExportInput): PsdExportResult;
3554
4063
 
3555
- export { type AnnotationType as $, type AdjustmentKind as A, type SmartFilterStack as B, type CurvePoint as C, type DepthMaskOptions as D, type SmartFilter as E, type SmartObjectLayer as F, type SmartContents as G, type HueRange as H, type ImageEditorAssetStore as I, type SmartDocument as J, type SmartPlacement as K, type LevelsChannel as L, type FreeTransformGeometry as M, type LayerPlacement as N, type FreeTransformMode as O, type PsdExportResult as P, type FreeTransformResult as Q, type RefineEdgeParams as R, type SerializedLayer as S, FreeTransformSession as T, type FreeTransformInit as U, type TransformAnchor as V, type AIResultOptions as W, type AdjustmentLayerBase as X, type AdjustmentLayerInit as Y, type AdjustmentLayerUpdate as Z, type AnnotationPlacement as _, type ImageAdjustments as a, type MagicWandOptions as a$, type ArrowAnnotation as a0, type AspectRatio as a1, type BaseAnnotation as a2, type BlackWhiteParams as a3, type BlurFilter as a4, type CircleAnnotation as a5, type ColorBalanceParams as a6, type ColorBalanceTone as a7, type ColorRangeOptions as a8, type ColorRangeSample as a9, type ImageDimensions as aA, type ImageEditorAIHooks as aB, type ImageEditorFit as aC, type ImageEditorOptions as aD, ImageEditorRenderer as aE, type ImageEditorState as aF, type ImageEditorTool as aG, type ImageLayerType as aH, type InpaintHook as aI, type InpaintOptions as aJ, type InvertParams as aK, LAYERED_SCHEMA_VERSION as aL, LIVE_SHAPE_KINDS as aM, type LayerBase as aN, type LayerBlendMode as aO, type LayerFilterKind as aP, type LayerLocation as aQ, type LayerMaskProps as aR, LayerOperationError as aS, type LayerProperties as aT, type LayerSourcesHost as aU, type LayerTarget as aV, type LegacySerializedImageEditorState as aW, type LevelsParams as aX, type LineAnnotation as aY, type LiveShape as aZ, type LiveShapeKind as a_, type CreateAnnotationPayload as aa, type CropHandle as ab, type CurvesParams as ac, DEFAULT_ADJUSTMENTS as ad, DEFAULT_DEPTH_MASK as ae, DEFAULT_MITER_LIMIT as af, DEFAULT_REFINE_EDGE_PARAMS as ag, DEFAULT_TRANSFORM as ah, type DeserializeContext as ai, type DevelopSettings as aj, EMPTY_DISTANCE as ak, type ExportOptions as al, FREE_TRANSFORM_CONTENTS as am, FREE_TRANSFORM_MODES as an, type FillOptions as ao, type FreeTransformContent as ap, type FreeTransformHost as aq, type FreeTransformPreview as ar, GUIDED_FILTER_EPS as as, type GroupLayer as at, HISTOGRAM_BINS as au, type HistogramChannel as av, type HistoryEntryHandle as aw, type HueSaturationParams as ax, IMAGE_EDITOR_SCHEMA_VERSION as ay, type ImageAnnotation as az, type SerializedImageEditorState as b, type ShapeSelectionOptions as b$, type MixerStrokeInit as b0, PSD_BLEND_KEYS as b1, type PaintOptions as b2, type PaintStrokeResult as b3, PaintStrokeSession as b4, type PenAnnotation as b5, type PhotoFilterParams as b6, type PixelBuffer as b7, type PixelLayerInit as b8, type PosterizeParams as b9, type SerializeContext as bA, type SerializedAdjustmentLayer as bB, type SerializedAnnotationLayer as bC, type SerializedGroupLayer as bD, type SerializedLayerEffects as bE, type SerializedLayeredImageEditorState as bF, type SerializedPattern as bG, type SerializedPixelLayer as bH, type SerializedRasterMask as bI, type SerializedSelection as bJ, type SerializedShapeLayer as bK, type SerializedSmartContents as bL, type SerializedSmartFilter as bM, type SerializedSmartObjectLayer as bN, type ShapeArrowhead as bO, type ShapeComponent as bP, type ShapeEnv as bQ, type ShapeFillRule as bR, type ShapeGeometryInput as bS, type ShapeLayerData as bT, type ShapeLayerInfo as bU, type ShapeLayerInit as bV, type ShapeLineCap as bW, type ShapeLineJoin as bX, type ShapeOperation as bY, type ShapePaint as bZ, type ShapePsdData as b_, type PsdChannel as ba, type PsdExportInput as bb, type PsdFile as bc, type PsdHeader as bd, type PsdImportOptions as be, type PsdImportResult as bf, type PsdLayerMask as bg, type PsdLayerRecord as bh, type PsdLayerSummary as bi, type PsdRect as bj, type PsdResource as bk, type PsdSmartFilter as bl, type PsdTaggedBlock as bm, type PsdTreeNode as bn, type RectAnnotation as bo, type RemoveBackgroundHook as bp, type RemoveBackgroundOptions as bq, type RenderOptions as br, SELECTION_MODES as bs, SELECTION_MODIFY_OPS as bt, SHAPE_OPERATIONS as bu, SHAPE_RENDER_MARGIN as bv, type SampleOptions as bw, type SelectionChannel as bx, type SelectionCommandOptions as by, type SelectionModifyOp as bz, type AdjustmentLayer as c, expandCoverage as c$, type ShapeStroke as c0, type ShapeStrokeAlign as c1, type SmartFilterKind as c2, type SmartObjectInfo as c3, type SmartPsdData as c4, type StrokeInit as c5, type StrokeTool as c6, TONE_RANGE_PRESETS as c7, TRANSFORM_ANCHORS as c8, type TextAnnotation as c9, computeSelectionBounds as cA, contractCoverage as cB, cornersFromMatrix as cC, coverageToByte as cD, createSelectionMask as cE, createShapeLayer as cF, decodeLayerChannel as cG, decodeLayerMask as cH, decodeMergedImage as cI, decodePngDataUrl as cJ, decodeSelectionRle as cK, defaultShapeName as cL, depthMaskAlpha as cM, describeTransform as cN, deserializeEffects as cO, deserializeLayer as cP, deserializeLayers as cQ, deserializePatterns as cR, deserializeSelection as cS, developFilter as cT, distanceTransform as cU, duplicateLayer as cV, edgeWidth as cW, ellipsePoints as cX, ellipseSelection as cY, encodeSelectionRle as cZ, encodeSurface as c_, type ThresholdParams as ca, type ToneRangePreset as cb, type TransformParams as cc, type TransformReadout as cd, type VibranceParams as ce, type ViewportMetrics as cf, addLayerEffect as cg, addLayerFilter as ch, adjustmentNodeAsLayer as ci, anchorPoint as cj, annotationBlend as ck, annotationOfShape as cl, applyImageProjectionToContext as cm, applyParams as cn, blurFilter as co, borderCoverage as cp, boxMean as cq, boxPointOf as cr, buildLayerMaskPlanes as cs, calculateCropDrag as ct, canvasToImagePoint as cu, clampCropToImage as cv, colorRange as cw, combineSelections as cx, componentPath as cy, computeHistogram as cz, type AdjustmentParamsMap as d, normalizeShapeStroke as d$, exportPsd as d0, featherCoverage as d1, flipCorners as d2, fullSelection as d3, geometryHomography as d4, getAnnotationBounds as d5, getCropCursor as d6, getRotatedSize as d7, getViewportMetrics as d8, getViewportProjection as d9, layerEffectsOf as dA, layerMaskCoverage as dB, layerMaskFromSelection as dC, layerMaskKey as dD, layerName as dE, layerTree as dF, layerTypeLabel as dG, liveComponent as dH, liveShapeSubpaths as dI, magicWand as dJ, mapCropHandle as dK, mapSubpaths as dL, matrixFromCorners as dM, matrixFromParams as dN, mergeShapeComponents as dO, migrateSerializedImageEditorState as dP, migrateToLayeredState as dQ, modifySelection as dR, moveLayer as dS, newLayerId as dT, normalizeAngle as dU, normalizeFilter as dV, normalizeLayerMask as dW, normalizeLiveShape as dX, normalizeRect as dY, normalizeRefineEdgeParams as dZ, normalizeShapePaint as d_, globalImageCache as da, greyMorphology as db, groupLayers as dc, guidePlanes as dd, guidedFilterColor as de, hasSurface as df, hasWarp as dg, hashMaskContent as dh, histogramPath as di, hitTestAnnotation as dj, hitTestCrop as dk, hueRange as dl, identityTransform as dm, imageToCanvasPoint as dn, importPsd as dp, invertSelection as dq, isActiveFilter as dr, isIdentityTransform as ds, isQuarterTurnSwapped as dt, isRenderedLayer as du, isSelectionEmpty as dv, isSelectionMode as dw, isSpatialFilter as dx, isTransformAnchor as dy, isValidWarp as dz, type AdjustmentLayerMask as e, smoothCoverage as e$, normalizeStoredAdjustments as e0, normalizeSubpaths as e1, offsetLayer as e2, offsetShape as e3, parseBlend as e4, parseColor as e5, parseSelectionMode as e6, pixelLayerBounds as e7, pixelLayers as e8, placeLayer as e9, resolveExternalAssets as eA, runLayerFilters as eB, selectionArea as eC, selectionFromCoverage as eD, selectionFromPixels as eE, selectionToCoverage as eF, selectionToPixels as eG, selectionValueAt as eH, serializeContents as eI, serializeEffects as eJ, serializeLayer as eK, serializeLayers as eL, serializeLayersExternal as eM, serializePatterns as eN, serializeSelection as eO, setLayerEffects as eP, setLayerEffectsEnabled as eQ, setLayerMask as eR, setLayerProperties as eS, shapeAsPixelLayer as eT, shapeFromAnnotation as eU, shapeGeometryBounds as eV, shapeLayers as eW, shapeOutline as eX, shapeRenderClip as eY, shiftCoverage as eZ, smartObjectLayers as e_, polygonCoverage as ea, polygonSelection as eb, presetWarp as ec, previewStep as ed, projectImagePoint as ee, projectImageRect as ef, projectMaskCoverage as eg, psdToLayers as eh, readPsd as ei, rectSelection as ej, referencePoint as ek, refineCoverage as el, refineEdgeHalo as em, refineSelection as en, removeLayer as eo, removeLayerEffect as ep, removeLayerFilter as eq, renderShape as er, renderShapeRect as es, requireLayer as et, requireOperation as eu, requireShapeLayer as ev, requireUnlocked as ew, rerenderShape as ex, resizePixels as ey, resizeSelection as ez, type AdjustmentLayerOf as f, srgb8ToLab as f0, toHex as f1, toneRange as f2, transformHomography as f3, transformMap as f4, transformShapeComponents as f5, transformedBox as f6, transformedPoint as f7, ungroupLayer as f8, unionRect as f9, unprojectCanvasPoint as fa, updateLayerEffect as fb, updateLayerFilter as fc, updateLayerMaskProps as fd, updateShapeLayer as fe, withNewIds as ff, writePsd as fg, ImageEditorController as g, type SelectionMask as h, type SelectionMode as i, type ColorDistance as j, type ImagePoint as k, type ImageLayer as l, type CropBox as m, type RasterMask as n, type Annotation as o, type AdjustmentLayerNode as p, type AnnotationLayer as q, type ShapeLayer as r, type LayerFilter as s, type PixelLayer as t, type DevelopFilter as u, type ImageTransform as v, type ImageHistogram as w, type ImageProjection as x, type CompositorSources as y, LayerCompositor as z };
4064
+ export { type AdjustmentLayerBase as $, type AdjustmentKind as A, LayerCompositor as B, type CurvePoint as C, type DepthMaskOptions as D, type SmartFilterStack as E, type SmartFilter as F, type SmartObjectLayer as G, type HueRange as H, type ImageEditorAssetStore as I, type SmartContents as J, type SmartDocument as K, type LevelsChannel as L, type SmartPlacement as M, type FreeTransformGeometry as N, type TextShaper as O, type PsdExportResult as P, type TextFont as Q, type RefineEdgeParams as R, type SerializedLayer as S, type TextEnv as T, type LayerPlacement as U, type FreeTransformMode as V, type FreeTransformResult as W, FreeTransformSession as X, type FreeTransformInit as Y, type TransformAnchor as Z, type AIResultOptions as _, type ImageAdjustments as a, LayerOperationError as a$, type AdjustmentLayerInit as a0, type AdjustmentLayerUpdate as a1, type AnnotationPlacement as a2, type AnnotationType as a3, type ArrowAnnotation as a4, type AspectRatio as a5, type BaseAnnotation as a6, type BlackWhiteParams as a7, type BlurFilter as a8, type CircleAnnotation as a9, HISTOGRAM_BINS as aA, type HistogramChannel as aB, type HistoryEntryHandle as aC, type HueSaturationParams as aD, IMAGE_EDITOR_SCHEMA_VERSION as aE, type ImageAnnotation as aF, type ImageDimensions as aG, type ImageEditorAIHooks as aH, type ImageEditorFit as aI, type ImageEditorOptions as aJ, ImageEditorRenderer as aK, type ImageEditorState as aL, type ImageEditorTool as aM, type ImageLayerType as aN, type InpaintHook as aO, type InpaintOptions as aP, type InvertParams as aQ, LAYERED_SCHEMA_VERSION as aR, LIVE_SHAPE_KINDS as aS, type LaidChar as aT, type LaidFragment as aU, type LaidLine as aV, type LayerBase as aW, type LayerBlendMode as aX, type LayerFilterKind as aY, type LayerLocation as aZ, type LayerMaskProps as a_, type ColorBalanceParams as aa, type ColorBalanceTone as ab, type ColorRangeOptions as ac, type ColorRangeSample as ad, type CreateAnnotationPayload as ae, type CropHandle as af, type CurvesParams as ag, DEFAULT_ADJUSTMENTS as ah, DEFAULT_AUTO_LEADING as ai, DEFAULT_DEPTH_MASK as aj, DEFAULT_MITER_LIMIT as ak, DEFAULT_REFINE_EDGE_PARAMS as al, DEFAULT_TEXT_STYLE as am, DEFAULT_TRANSFORM as an, type DeserializeContext as ao, type DevelopSettings as ap, EMPTY_DISTANCE as aq, type ExportOptions as ar, FREE_TRANSFORM_CONTENTS as as, FREE_TRANSFORM_MODES as at, type FillOptions as au, type FreeTransformContent as av, type FreeTransformHost as aw, type FreeTransformPreview as ax, GUIDED_FILTER_EPS as ay, type GroupLayer as az, type SerializedImageEditorState as b, type ShapeArrowhead as b$, type LayerProperties as b0, type LayerSourcesHost as b1, type LayerTarget as b2, type LegacySerializedImageEditorState as b3, type LevelsParams as b4, type LineAnnotation as b5, type LiveShape as b6, type LiveShapeKind as b7, type MagicWandOptions as b8, type MixerStrokeInit as b9, type RectAnnotation as bA, type RemoveBackgroundHook as bB, type RemoveBackgroundOptions as bC, type RenderOptions as bD, SELECTION_MODES as bE, SELECTION_MODIFY_OPS as bF, SHAPE_OPERATIONS as bG, SHAPE_RENDER_MARGIN as bH, type SampleOptions as bI, type SelectionChannel as bJ, type SelectionCommandOptions as bK, type SelectionModifyOp as bL, type SerializeContext as bM, type SerializedAdjustmentLayer as bN, type SerializedAnnotationLayer as bO, type SerializedGroupLayer as bP, type SerializedLayerEffects as bQ, type SerializedLayeredImageEditorState as bR, type SerializedPattern as bS, type SerializedPixelLayer as bT, type SerializedRasterMask as bU, type SerializedSelection as bV, type SerializedShapeLayer as bW, type SerializedSmartContents as bX, type SerializedSmartFilter as bY, type SerializedSmartObjectLayer as bZ, type SerializedTypeLayer as b_, PARAGRAPH_STYLE_FIELDS as ba, PSD_BLEND_KEYS as bb, type PaintOptions as bc, type PaintStrokeResult as bd, PaintStrokeSession as be, type ParagraphRun as bf, type ParagraphStyle as bg, type PenAnnotation as bh, type PhotoFilterParams as bi, type PixelBuffer as bj, type PixelLayerInit as bk, type PosterizeParams as bl, type PsdChannel as bm, type PsdExportInput as bn, type PsdFile as bo, type PsdHeader as bp, type PsdImportOptions as bq, type PsdImportResult as br, type PsdLayerMask as bs, type PsdLayerRecord as bt, type PsdLayerSummary as bu, type PsdRect as bv, type PsdResource as bw, type PsdSmartFilter as bx, type PsdTaggedBlock as by, type PsdTreeNode as bz, type AdjustmentLayer as c, contractCoverage as c$, type ShapeComponent as c0, type ShapeEnv as c1, type ShapeFillRule as c2, type ShapeGeometryInput as c3, type ShapeLayerData as c4, type ShapeLayerInfo as c5, type ShapeLayerInit as c6, type ShapeLineCap as c7, type ShapeLineJoin as c8, type ShapeOperation as c9, type TypeLayerInfo as cA, type TypePsdData as cB, type VibranceParams as cC, type ViewportMetrics as cD, addLayerEffect as cE, addLayerFilter as cF, adjustmentNodeAsLayer as cG, anchorPoint as cH, annotationBlend as cI, annotationOfShape as cJ, annotationOfType as cK, applyImageProjectionToContext as cL, applyParams as cM, blurFilter as cN, borderCoverage as cO, boxMean as cP, boxPointOf as cQ, buildLayerMaskPlanes as cR, calculateCropDrag as cS, canvasToImagePoint as cT, caretAt as cU, clampCropToImage as cV, colorRange as cW, combineSelections as cX, componentPath as cY, computeHistogram as cZ, computeSelectionBounds as c_, type ShapePaint as ca, type ShapePsdData as cb, type ShapeSelectionOptions as cc, type ShapeStroke as cd, type ShapeStrokeAlign as ce, type SmartFilterKind as cf, type SmartObjectInfo as cg, type SmartPsdData as ch, type StrokeInit as ci, type StrokeTool as cj, TEXT_ALIGNS as ck, TEXT_RENDER_MARGIN as cl, TEXT_STYLE_FIELDS as cm, TONE_RANGE_PRESETS as cn, TRANSFORM_ANCHORS as co, type TextAlign as cp, type TextAnnotation as cq, type TextLayerInit as cr, type TextLayout as cs, type TextRun as ct, type TextStyle as cu, type ThresholdParams as cv, type ToneRangePreset as cw, type TransformParams as cx, type TransformReadout as cy, type TypeLayerData as cz, type AdjustmentParamsMap as d, isSpatialFilter as d$, cornersFromMatrix as d0, coverageToByte as d1, createSelectionMask as d2, createShapeLayer as d3, createTypeLayer as d4, decodeLayerChannel as d5, decodeLayerMask as d6, decodeMergedImage as d7, decodePngDataUrl as d8, decodeSelectionRle as d9, getAnnotationBounds as dA, getCropCursor as dB, getRotatedSize as dC, getViewportMetrics as dD, getViewportProjection as dE, globalImageCache as dF, greyMorphology as dG, groupLayers as dH, guidePlanes as dI, guidedFilterColor as dJ, hasSurface as dK, hasWarp as dL, hashMaskContent as dM, histogramPath as dN, hitTestAnnotation as dO, hitTestCrop as dP, hueRange as dQ, identityTransform as dR, imageToCanvasPoint as dS, importPsd as dT, invertSelection as dU, isActiveFilter as dV, isIdentityTransform as dW, isQuarterTurnSwapped as dX, isRenderedLayer as dY, isSelectionEmpty as dZ, isSelectionMode as d_, defaultShapeName as da, depthMaskAlpha as db, describeTransform as dc, deserializeEffects as dd, deserializeLayer as de, deserializeLayers as df, deserializePatterns as dg, deserializeSelection as dh, developFilter as di, distanceTransform as dj, duplicateLayer as dk, edgeWidth as dl, ellipsePoints as dm, ellipseSelection as dn, encodeSelectionRle as dp, encodeSurface as dq, expandCoverage as dr, exportPsd as ds, featherCoverage as dt, fitParagraphRuns as du, fitRuns as dv, flipCorners as dw, fontOf as dx, fullSelection as dy, geometryHomography as dz, type AdjustmentLayerMask as e, renderShapeRect as e$, isTransformAnchor as e0, isValidWarp as e1, layerEffectsOf as e2, layerMaskCoverage as e3, layerMaskFromSelection as e4, layerMaskKey as e5, layerName as e6, layerTree as e7, layerTypeLabel as e8, layoutText as e9, paragraphRanges as eA, parseBlend as eB, parseColor as eC, parseSelectionMode as eD, patchParagraphStyle as eE, patchTextStyle as eF, pixelLayerBounds as eG, pixelLayers as eH, placeLayer as eI, polygonCoverage as eJ, polygonSelection as eK, presetWarp as eL, previewStep as eM, projectImagePoint as eN, projectImageRect as eO, projectMaskCoverage as eP, psdToLayers as eQ, readPsd as eR, rectSelection as eS, referencePoint as eT, refineCoverage as eU, refineEdgeHalo as eV, refineSelection as eW, removeLayer as eX, removeLayerEffect as eY, removeLayerFilter as eZ, renderShape as e_, liveComponent as ea, liveShapeSubpaths as eb, magicWand as ec, mapCropHandle as ed, mapSubpaths as ee, matrixFromCorners as ef, matrixFromParams as eg, mergeShapeComponents as eh, migrateSerializedImageEditorState as ei, migrateToLayeredState as ej, modifySelection as ek, moveLayer as el, newLayerId as em, normalizeAngle as en, normalizeFilter as eo, normalizeLayerMask as ep, normalizeLiveShape as eq, normalizeRect as er, normalizeRefineEdgeParams as es, normalizeShapePaint as et, normalizeShapeStroke as eu, normalizeStoredAdjustments as ev, normalizeSubpaths as ew, normalizeText as ex, offsetLayer as ey, offsetShape as ez, type AdjustmentLayerOf as f, updateLayerEffect as f$, renderText as f0, replaceTextRange as f1, requireLayer as f2, requireOperation as f3, requireShapeLayer as f4, requireTypeLayer as f5, requireUnlocked as f6, rerenderShape as f7, rerenderText as f8, resizePixels as f9, shapeRenderClip as fA, shiftCoverage as fB, smartObjectLayers as fC, smoothCoverage as fD, spliceRuns as fE, srgb8ToLab as fF, styleAt as fG, textIndexAt as fH, textMatrix as fI, textOutlines as fJ, textRange as fK, toHex as fL, toTextSpace as fM, toneRange as fN, transformHomography as fO, transformMap as fP, transformShapeComponents as fQ, transformTypeLayer as fR, transformedBox as fS, transformedPoint as fT, typeAsPixelLayer as fU, typeFrame as fV, typeFromAnnotation as fW, typeLayerName as fX, ungroupLayer as fY, unionRect as fZ, unprojectCanvasPoint as f_, resizeSelection as fa, resolveExternalAssets as fb, restyleRange as fc, runLayerFilters as fd, selectionArea as fe, selectionFromCoverage as ff, selectionFromPixels as fg, selectionToCoverage as fh, selectionToPixels as fi, selectionValueAt as fj, serializeContents as fk, serializeEffects as fl, serializeLayer as fm, serializeLayers as fn, serializeLayersExternal as fo, serializePatterns as fp, serializeSelection as fq, setLayerEffects as fr, setLayerEffectsEnabled as fs, setLayerMask as ft, setLayerProperties as fu, shapeAsPixelLayer as fv, shapeFromAnnotation as fw, shapeGeometryBounds as fx, shapeLayers as fy, shapeOutline as fz, ImageEditorController as g, updateLayerFilter as g0, updateLayerMaskProps as g1, updateShapeLayer as g2, updateTypeLayer as g3, withNewIds as g4, writePsd as g5, type SelectionMask as h, type SelectionMode as i, type ColorDistance as j, type ImagePoint as k, type ImageLayer as l, type CropBox as m, type RasterMask as n, type Annotation as o, type AdjustmentLayerNode as p, type AnnotationLayer as q, type ShapeLayer as r, type TypeLayer as s, type LayerFilter as t, type PixelLayer as u, type DevelopFilter as v, type ImageTransform as w, type ImageHistogram as x, type ImageProjection as y, type CompositorSources as z };