index.d.ts 874 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. import { DecoderFn, EncoderFn, ImageCallback } from '@jimp/core';
  2. interface PNGClass {
  3. _deflateLevel: number,
  4. _deflateStrategy: number,
  5. _filterType: number,
  6. _colorType: number,
  7. deflateLevel(l: number, cb?: ImageCallback<this>): this;
  8. deflateStrategy(s: number, cb?: ImageCallback<this>): this;
  9. filterType(f: number, cb?: ImageCallback<this>): this;
  10. colorType(s: number, cb?: ImageCallback<this>): this;
  11. }
  12. interface PNG {
  13. mime: { 'image/png': string[] },
  14. hasAlpha: { 'image/png': true },
  15. decoders: {
  16. 'image/png': DecoderFn
  17. }
  18. encoders: {
  19. 'image/png': EncoderFn
  20. }
  21. class: PNGClass
  22. constants: {
  23. MIME_PNG: 'image/png';
  24. // PNG filter types
  25. PNG_FILTER_AUTO: -1;
  26. PNG_FILTER_NONE: 0;
  27. PNG_FILTER_SUB: 1;
  28. PNG_FILTER_UP: 2;
  29. PNG_FILTER_AVERAGE: 3;
  30. PNG_FILTER_PATH: 4;
  31. }
  32. }
  33. export default function(): PNG;