ag-psd 28.2.0 → 28.2.2

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/psd.d.ts CHANGED
@@ -1147,7 +1147,7 @@ type FilterVariant = {
1147
1147
  type: 'curves';
1148
1148
  filter: {
1149
1149
  presetKind: 'custom' | 'default';
1150
- adjustments: ({
1150
+ adjustments?: ({
1151
1151
  channels: ('composite' | 'red' | 'green' | 'blue')[];
1152
1152
  curve: {
1153
1153
  x: number;
@@ -1106,7 +1106,7 @@ function parseFilterFXItem(f, options) {
1106
1106
  removeJpegArtifact: f.Fltr.removeJPEGArtifact,
1107
1107
  reduceColorNoise: parsePercent(f.Fltr.ClNs),
1108
1108
  sharpenDetails: parsePercent(f.Fltr.Shrp),
1109
- channelDenoise: f.Fltr.channelDenoise.map(function (c) { return (__assign({ channels: c.Chnl.map(function (i) { return Chnl.decode(i); }), amount: c.Amnt }, (c.EdgF ? { preserveDetails: c.EdgF } : {}))); }),
1109
+ channelDenoise: f.Fltr.channelDenoise.map(function (c) { return (__assign({ channels: c.Chnl.map(Chnl.decode), amount: c.Amnt }, (c.EdgF ? { preserveDetails: c.EdgF } : {}))); }),
1110
1110
  } });
1111
1111
  case 'ClrH': return __assign(__assign({}, base), { type: 'color halftone', filter: {
1112
1112
  radius: f.Fltr['Rds '],
@@ -1333,10 +1333,9 @@ function parseFilterFXItem(f, options) {
1333
1333
  ;
1334
1334
  case 'Crvs':
1335
1335
  {
1336
- return __assign(__assign({}, base), { type: 'curves', filter: {
1337
- presetKind: presetKindType.decode(f.Fltr.presetKind),
1336
+ return __assign(__assign({}, base), { type: 'curves', filter: __assign({ presetKind: presetKindType.decode(f.Fltr.presetKind) }, (f.Fltr.Adjs ? {
1338
1337
  adjustments: f.Fltr.Adjs.map(function (a) {
1339
- var channels = a.Chnl.map(function (c) { return Chnl.decode(c); });
1338
+ var channels = a.Chnl.map(Chnl.decode);
1340
1339
  if (a['Crv ']) {
1341
1340
  return {
1342
1341
  channels: channels,
@@ -1354,8 +1353,8 @@ function parseFilterFXItem(f, options) {
1354
1353
  else {
1355
1354
  throw new Error("Unknown curve adjustment");
1356
1355
  }
1357
- }),
1358
- } });
1356
+ })
1357
+ } : {})) });
1359
1358
  }
1360
1359
  ;
1361
1360
  case 'BrgC':
@@ -1369,7 +1368,7 @@ function parseFilterFXItem(f, options) {
1369
1368
  ;
1370
1369
  default:
1371
1370
  if (options.throwForMissingFeatures) {
1372
- console.log('FILTER', require('util').inspect(f, false, 99, true));
1371
+ // console.log('FILTER', require('util').inspect(f, false, 99, true));
1373
1372
  throw new Error("Unknown filter classId: ".concat(f.Fltr._classID));
1374
1373
  }
1375
1374
  return undefined;
@@ -1392,7 +1391,7 @@ function parseFilterFXItem(f, options) {
1392
1391
  case 1231976050: return __assign(__assign({}, base), { type: 'invert' });
1393
1392
  default:
1394
1393
  if (options.throwForMissingFeatures) {
1395
- console.log('FILTER', require('util').inspect(f, false, 99, true));
1394
+ // console.log('FILTER', require('util').inspect(f, false, 99, true));
1396
1395
  throw new Error("Unknown filterID: ".concat(f.filterID));
1397
1396
  }
1398
1397
  }
@@ -1850,22 +1849,19 @@ function serializeFilterFXItem(f) {
1850
1849
  warpedVertices: f.filter.warpedVertices.map(pointToHrznVrtc),
1851
1850
  quads: f.filter.quads.map(function (indices) { return ({ indices: indices }); }),
1852
1851
  }, filterID: 442 });
1853
- case 'curves': return __assign(__assign({}, base), { Fltr: {
1854
- _name: 'Curves',
1855
- _classID: 'Crvs',
1856
- presetKind: presetKindType.encode(f.filter.presetKind),
1852
+ case 'curves': return __assign(__assign({}, base), { Fltr: __assign({ _name: 'Curves', _classID: 'Crvs', presetKind: presetKindType.encode(f.filter.presetKind) }, (f.filter.adjustments ? {
1857
1853
  Adjs: f.filter.adjustments.map(function (a) { return 'curve' in a ? {
1858
1854
  _name: '',
1859
1855
  _classID: 'CrvA',
1860
- Chnl: a.channels.map(function (c) { return Chnl.encode(c); }),
1856
+ Chnl: a.channels.map(Chnl.encode),
1861
1857
  'Crv ': a.curve.map(function (c) { return (__assign({ _name: '', _classID: 'Pnt ', Hrzn: c.x, Vrtc: c.y }, (c.curved ? { Cnty: true } : {}))); }),
1862
1858
  } : {
1863
1859
  _name: '',
1864
1860
  _classID: 'CrvA',
1865
- Chnl: a.channels.map(function (c) { return Chnl.encode(c); }),
1861
+ Chnl: a.channels.map(Chnl.encode),
1866
1862
  Mpng: a.values,
1867
- }; }),
1868
- }, filterID: 1131574899 });
1863
+ }; })
1864
+ } : {})), filterID: 1131574899 });
1869
1865
  case 'brightness/contrast': return __assign(__assign({}, base), { Fltr: {
1870
1866
  _name: 'Brightness/Contrast',
1871
1867
  _classID: 'BrgC',