mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
19 lines
584 B
TypeScript
19 lines
584 B
TypeScript
import { parse, draw, trim, Font, Bitmap } from "bdfjs";
|
|
|
|
parse(); // $ExpectError
|
|
parse(123); // $ExpectError
|
|
parse('abc'); // $ExpectType Font
|
|
parse('abc', { allprops: true, onlymeta: true }); // $ExpectType Font
|
|
const font: Font = parse(Buffer.from([1, 2, 3]));
|
|
|
|
draw(); // $ExpectError
|
|
draw(123); // $ExpectError
|
|
draw(font); // $ExpectError
|
|
draw(font, 123); // $ExpectError
|
|
draw(font, 'abc', { kerningBias: 123 }); // $ExpectType Bitmap | undefined
|
|
const bitmap: Bitmap = draw(font, 'abc')!;
|
|
|
|
trim(); // $ExpectError
|
|
trim(123); // $ExpectError
|
|
trim(bitmap); // $ExpectType Bitmap
|