js-image-generator icon indicating copy to clipboard operation
js-image-generator copied to clipboard

typescript compilation failed

Open cedvdb opened this issue 1 year ago • 0 comments

node_modules/js-image-generator/index.d.ts:5:13 - error TS7014: Function type, which lacks return-type annotation, implicitly has an 'any' return type.

5   callback: function(Error|null, RawImageData<Buffer>)
              ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

node_modules/js-image-generator/index.d.ts:5:13 - error TS8020: JSDoc types can only be used inside documentation comments.

5   callback: function(Error|null, RawImageData<Buffer>)
              ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

node_modules/js-image-generator/index.d.ts:5:34 - error TS2552: Cannot find name 'RawImageData'. Did you mean 'ImageData'?

5   callback: function(Error|null, RawImageData<Buffer>)
                                   ~~~~~~~~~~~~

  node_modules/typescript/lib/lib.dom.d.ts:9123:13
    9123 declare var ImageData: {
                     ~~~~~~~~~
    'ImageData' is declared here.

index.d.ts should be something alone the lines of

export interface RawImageData<T> { 
  data: T;
}

export declare function generateImage(
  width: number,
  height: number,
  quality: number,
  callback: (error: Error | null, imageData: RawImageData<Buffer>) => any
): void

cedvdb avatar Jun 14 '23 06:06 cedvdb