Files
DefinitelyTyped/types/markdown-pdf/markdown-pdf-tests.ts
Priyankar Kumar b8c1da8734 🤖 Merge PR #63772 [markdown-pdf]: Fix the type for to.buffer callback by @priyankark
* Fix markdown-pdf to.buffer type

* Update test

* Prettier Fixes

* Fix tests after prettier formatting changes
2023-02-15 12:09:51 -08:00

39 lines
859 B
TypeScript

import mdPdf = require('markdown-pdf');
// $ExpectType void
mdPdf()
.from('path')
.to('path', () => {});
// $ExpectType void
mdPdf()
.from.string('markdown')
.to('path', () => {});
// $ExpectType void
mdPdf({ paperOrientation: 'landscape', paperFormat: 'A3' })
.from('lol')
.to('lol', () => {});
// $ExpectType void
mdPdf()
.concat.from.paths(['lol', 'lol'], {})
.to('path', () => {});
// $ExpectType void
mdPdf()
.concat.from.strings(['lol', 'lol'], {})
.to('path', () => {});
// $ExpectType void
mdPdf()
.from('path')
.to.path('path', () => {});
// $ExpectType void
mdPdf().from('path').to('path');
// $ExpectType void
mdPdf()
.from.string('markdown')
.to.buffer(null, (err, buffer) => {
buffer; // $ExpectType ArrayBuffer
});
// @ts-expect-error
mdPdf({ paperFormat: 'wrongFormat' });