DefinitelyTyped/types/pdf-image/pdf-image-tests.ts
NickLatkovich 92d1620178
Definitions to "pdf-image" package (#42248)
* Definitions to "pdf-image" package

* Using readonly for array and options in parameters
2020-02-10 10:17:16 -08:00

22 lines
593 B
TypeScript

import { PDFImage } from 'pdf-image';
// $ExpectType PDFImage<false>
new PDFImage('path');
// $ExpectType Promise<string[]>
new PDFImage('path').convertFile();
// $ExpectType Promise<string>
new PDFImage('path', { combinedImage: true }).convertFile();
// $ExpectType Promise<string | string[]>
new PDFImage<boolean>('path', { combinedImage: true }).convertFile();
// $ExpectError
new PDFImage<false>('path', { combinedImage: true });
new PDFImage('path', { convertOptions: { "-adaptive-blur": '' } });
// $ExpectError
new PDFImage('path', { convertOptions: { invalidOptionKey: '' } });