ag-psd 16.0.0 → 17.0.1

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.
@@ -1,4 +1,4 @@
1
- import { AntiAlias, BevelDirection, BevelStyle, BevelTechnique, BlendMode, Color, GlowSource, GlowTechnique, GradientStyle, InterpolationMethod, LayerEffectsInfo, LineAlignment, LineCapType, LineJoinType, Orientation, TextGridding, TimelineKeyInterpolation, TimelineTrack, TimelineTrackType, Units, UnitsValue, VectorContent, WarpStyle } from './psd';
1
+ import { AntiAlias, BevelDirection, BevelStyle, BevelTechnique, BlendMode, Color, GlowSource, GlowTechnique, GradientStyle, InterpolationMethod, LayerEffectsInfo, LineAlignment, LineCapType, LineJoinType, Orientation, TextGridding, TimelineKeyInterpolation, TimelineTrack, TimelineTrackType, Units, UnitsBounds, UnitsValue, VectorContent, WarpStyle } from './psd';
2
2
  import { PsdReader } from './psdReader';
3
3
  import { PsdWriter } from './psdWriter';
4
4
  export declare function setLogErrors(value: boolean): void;
@@ -13,25 +13,37 @@ export interface DescriptorUnitsValue {
13
13
  value: number;
14
14
  }
15
15
  export type DescriptorColor = {
16
+ _name: '';
17
+ _classID: 'RGBC';
16
18
  'Rd ': number;
17
19
  'Grn ': number;
18
20
  'Bl ': number;
19
21
  } | {
22
+ _name: '';
23
+ _classID: 'HSBC';
20
24
  'H ': DescriptorUnitsValue;
21
25
  Strt: number;
22
26
  Brgh: number;
23
27
  } | {
28
+ _name: '';
29
+ _classID: 'CMYC';
24
30
  'Cyn ': number;
25
31
  Mgnt: number;
26
32
  'Ylw ': number;
27
33
  Blck: number;
28
34
  } | {
35
+ _name: '';
36
+ _classID: 'GRYC';
29
37
  'Gry ': number;
30
38
  } | {
39
+ _name: '';
40
+ _classID: 'LABC';
31
41
  Lmnc: number;
32
42
  'A ': number;
33
43
  'B ': number;
34
44
  } | {
45
+ _name: '';
46
+ _classID: 'XXXX';
35
47
  redFloat: number;
36
48
  greenFloat: number;
37
49
  blueFloat: number;
@@ -109,11 +121,19 @@ export interface StrokeDescriptor {
109
121
  strokeStyleContent: DescriptorVectorContent;
110
122
  strokeStyleResolution: number;
111
123
  }
124
+ export interface BoundsDescriptor {
125
+ Left: DescriptorUnitsValue;
126
+ 'Top ': DescriptorUnitsValue;
127
+ Rght: DescriptorUnitsValue;
128
+ Btom: DescriptorUnitsValue;
129
+ }
112
130
  export interface TextDescriptor {
113
131
  'Txt ': string;
114
132
  textGridding: string;
115
133
  Ornt: string;
116
134
  AntA: string;
135
+ bounds?: BoundsDescriptor;
136
+ boundingBox?: BoundsDescriptor;
117
137
  TextIndex: number;
118
138
  EngineData?: Uint8Array;
119
139
  }
@@ -133,6 +153,8 @@ export interface WarpDescriptor {
133
153
  uOrder: number;
134
154
  vOrder: number;
135
155
  customEnvelopeWarp?: {
156
+ _name: '';
157
+ _classID: 'customEnvelopeWarp';
136
158
  meshPoints: {
137
159
  type: 'Hrzn' | 'Vrtc';
138
160
  values: number[];
@@ -143,6 +165,8 @@ export interface QuiltWarpDescriptor extends WarpDescriptor {
143
165
  deformNumRows: number;
144
166
  deformNumCols: number;
145
167
  customEnvelopeWarp: {
168
+ _name: '';
169
+ _classID: 'customEnvelopeWarp';
146
170
  quiltSliceX: {
147
171
  type: 'quiltSliceX';
148
172
  values: number[];
@@ -193,6 +217,8 @@ export declare function xyToHorzVrtc(xy: {
193
217
  x: number;
194
218
  y: number;
195
219
  }): HrznVrtcDescriptor;
220
+ export declare function descBoundsToBounds(desc: BoundsDescriptor): UnitsBounds;
221
+ export declare function boundsToDescBounds(bounds: UnitsBounds): BoundsDescriptor;
196
222
  export type TimelineAnimKeyDescriptor = {
197
223
  Type: 'keyType.Opct';
198
224
  Opct: DescriptorUnitsValue;
@@ -312,7 +338,12 @@ export declare function parseUnitsOrNumber(value: DescriptorUnitsValue | number,
312
338
  export declare function parseUnitsToNumber({ units, value }: DescriptorUnitsValue, expectedUnits: string): number;
313
339
  export declare function unitsAngle(value: number | undefined): DescriptorUnitsValue;
314
340
  export declare function unitsPercent(value: number | undefined): DescriptorUnitsValue;
341
+ export declare function unitsPercentF(value: number | undefined): DescriptorUnitsValue;
315
342
  export declare function unitsValue(x: UnitsValue | undefined, key: string): DescriptorUnitsValue;
343
+ export declare function frac({ numerator, denominator }: FractionDescriptor): {
344
+ numerator: number;
345
+ denominator: number;
346
+ };
316
347
  export declare const textGridding: {
317
348
  decode: (val: string) => TextGridding;
318
349
  encode: (val: TextGridding | undefined) => string;
@@ -413,3 +444,111 @@ export declare const strokeStyleLineAlignment: {
413
444
  decode: (val: string) => LineAlignment;
414
445
  encode: (val: LineAlignment | undefined) => string;
415
446
  };
447
+ export declare const BlrM: {
448
+ decode: (val: string) => "spin" | "zoom";
449
+ encode: (val: "spin" | "zoom" | undefined) => string;
450
+ };
451
+ export declare const BlrQ: {
452
+ decode: (val: string) => "draft" | "good" | "best";
453
+ encode: (val: "draft" | "good" | "best" | undefined) => string;
454
+ };
455
+ export declare const SmBM: {
456
+ decode: (val: string) => "normal" | "edge only" | "overlay edge";
457
+ encode: (val: "normal" | "edge only" | "overlay edge" | undefined) => string;
458
+ };
459
+ export declare const SmBQ: {
460
+ decode: (val: string) => "high" | "low" | "medium";
461
+ encode: (val: "high" | "low" | "medium" | undefined) => string;
462
+ };
463
+ export declare const DspM: {
464
+ decode: (val: string) => "stretch to fit" | "tile";
465
+ encode: (val: "stretch to fit" | "tile" | undefined) => string;
466
+ };
467
+ export declare const UndA: {
468
+ decode: (val: string) => "wrap around" | "repeat edge pixels";
469
+ encode: (val: "wrap around" | "repeat edge pixels" | undefined) => string;
470
+ };
471
+ export declare const Cnvr: {
472
+ decode: (val: string) => "rectangular to polar" | "polar to rectangular";
473
+ encode: (val: "rectangular to polar" | "polar to rectangular" | undefined) => string;
474
+ };
475
+ export declare const RplS: {
476
+ decode: (val: string) => "small" | "medium" | "large";
477
+ encode: (val: "small" | "medium" | "large" | undefined) => string;
478
+ };
479
+ export declare const SphM: {
480
+ decode: (val: string) => "normal" | "horizontal only" | "vertical only";
481
+ encode: (val: "normal" | "horizontal only" | "vertical only" | undefined) => string;
482
+ };
483
+ export declare const Wvtp: {
484
+ decode: (val: string) => "sine" | "square" | "triangle";
485
+ encode: (val: "sine" | "square" | "triangle" | undefined) => string;
486
+ };
487
+ export declare const ZZTy: {
488
+ decode: (val: string) => "around center" | "out from center" | "pond ripples";
489
+ encode: (val: "around center" | "out from center" | "pond ripples" | undefined) => string;
490
+ };
491
+ export declare const Dstr: {
492
+ decode: (val: string) => "uniform" | "gaussian";
493
+ encode: (val: "uniform" | "gaussian" | undefined) => string;
494
+ };
495
+ export declare const Chnl: {
496
+ decode: (val: string) => "composite" | "red" | "green" | "blue";
497
+ encode: (val: "composite" | "red" | "green" | "blue" | undefined) => string;
498
+ };
499
+ export declare const MztT: {
500
+ decode: (val: string) => "fine dots" | "medium dots" | "grainy dots" | "coarse dots" | "short lines" | "medium lines" | "long lines" | "short strokes" | "medium strokes" | "long strokes";
501
+ encode: (val: "fine dots" | "medium dots" | "grainy dots" | "coarse dots" | "short lines" | "medium lines" | "long lines" | "short strokes" | "medium strokes" | "long strokes" | undefined) => string;
502
+ };
503
+ export declare const Lns: {
504
+ decode: (val: string) => "50-300mm zoom" | "32mm prime" | "105mm prime" | "movie prime";
505
+ encode: (val: "50-300mm zoom" | "32mm prime" | "105mm prime" | "movie prime" | undefined) => string;
506
+ };
507
+ export declare const blurType: {
508
+ decode: (val: string) => "gaussian blur" | "motion blur" | "lens blur";
509
+ encode: (val: "gaussian blur" | "motion blur" | "lens blur" | undefined) => string;
510
+ };
511
+ export declare const DfsM: {
512
+ decode: (val: string) => "normal" | "darken only" | "lighten only" | "anisotropic";
513
+ encode: (val: "normal" | "darken only" | "lighten only" | "anisotropic" | undefined) => string;
514
+ };
515
+ export declare const ExtT: {
516
+ decode: (val: string) => "blocks" | "pyramids";
517
+ encode: (val: "blocks" | "pyramids" | undefined) => string;
518
+ };
519
+ export declare const ExtR: {
520
+ decode: (val: string) => "random" | "level-based";
521
+ encode: (val: "random" | "level-based" | undefined) => string;
522
+ };
523
+ export declare const FlCl: {
524
+ decode: (val: string) => "background color" | "foreground color" | "inverse image" | "unaltered image";
525
+ encode: (val: "background color" | "foreground color" | "inverse image" | "unaltered image" | undefined) => string;
526
+ };
527
+ export declare const CntE: {
528
+ decode: (val: string) => "upper" | "lower";
529
+ encode: (val: "upper" | "lower" | undefined) => string;
530
+ };
531
+ export declare const WndM: {
532
+ decode: (val: string) => "wind" | "blast" | "stagger";
533
+ encode: (val: "wind" | "blast" | "stagger" | undefined) => string;
534
+ };
535
+ export declare const Drct: {
536
+ decode: (val: string) => "left" | "right";
537
+ encode: (val: "left" | "right" | undefined) => string;
538
+ };
539
+ export declare const IntE: {
540
+ decode: (val: string) => "odd lines" | "even lines";
541
+ encode: (val: "odd lines" | "even lines" | undefined) => string;
542
+ };
543
+ export declare const IntC: {
544
+ decode: (val: string) => "duplication" | "interpolation";
545
+ encode: (val: "duplication" | "interpolation" | undefined) => string;
546
+ };
547
+ export declare const FlMd: {
548
+ decode: (val: string) => "wrap around" | "repeat edge pixels" | "set to transparent";
549
+ encode: (val: "wrap around" | "repeat edge pixels" | "set to transparent" | undefined) => string;
550
+ };
551
+ export declare const prjM: {
552
+ decode: (val: string) => "auto" | "perspective" | "fisheye" | "full spherical";
553
+ encode: (val: "auto" | "perspective" | "fisheye" | "full spherical" | undefined) => string;
554
+ };