Sharp: Namespace 'sharp' has no exported member 'SharpInstance'

Created on 6 Nov 2018  路  5Comments  路  Source: lovell/sharp

After upgrading from 0.20 to 0.21 I got the follwoing error:

  [tsl] ERROR in /home/travis/build/zxing-js/library/src/test/core/util/SharpImage.ts(8,32)
        TS2694: Namespace 'sharp' has no exported member 'SharpInstance'.

I'm using sharp as this:

// https://github.com/zxing-js/library/blob/master/src/test/core/util/SharpImage.ts

import * as sharp from 'sharp';

import BitMatrix from '../../../core/common/BitMatrix';

export default class SharpImage {

    public constructor(
        private wrapper: sharp.SharpInstance,
        private buffer: Uint8ClampedArray,
        private width: number,
        private height: number
    ) { }

  // ...
}

How can I get SharpInstance in this new version?

question

Most helpful comment

Just for future reference, the SharpInstance interface was renamed to just Sharp.

All 5 comments

Hello, problems with the @types/sharp module should be reported downstream against the https://github.com/DefinitelyTyped/DefinitelyTyped repo.

Okay, but just one more question, should the sharp.SharpInstance class still exist or not?

sharp.SharpInstance is not part of sharp, so I'd guess it is (or was) part of the TypeScript bindings. You'll need to ask this question at the DefinitelyTyped repo.

Okay, thanks!

Just for future reference, the SharpInstance interface was renamed to just Sharp.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jaekunchoi picture jaekunchoi  路  3Comments

kachurovskiy picture kachurovskiy  路  3Comments

natural-law picture natural-law  路  3Comments

zilions picture zilions  路  3Comments

OleVik picture OleVik  路  3Comments