Cat-Printer/www/main.d.ts
2021-09-08 16:51:48 +08:00

35 lines
1.1 KiB
TypeScript

declare interface i18NProto {
get(originaltext: string, language: string): string;
force(language: string): void;
recover(): void;
}
declare var i18N: i18NProto;
declare interface ImagePrinter {
noticeElement: HTMLParagraphElement;
thresholdInput: HTMLInputElement;
bluetoothMACInput: HTMLInputElement;
fileSelection: HTMLInputElement;
dummyImage: HTMLImageElement;
canvasPreview: HTMLCanvasElement;
previewButton: HTMLButtonElement;
printButton: HTMLButtonElement;
monoMethod: Function;
}
declare interface DocumentPrinter {
thresholdInput: HTMLInputElement;
bluetoothMACInput: HTMLInputElement;
container: HTMLDivElement;
printButton: HTMLButtonElement;
canvasPreview: HTMLDivElement;
monoMethod: Function;
}
declare function notice(message: string): void;
declare function imageDataColorToMonoSquare(data: ImageData, threshold: number): ImageData;
declare function imageDataColorToMonoDiamond(data: ImageData, threshold: number): ImageData;
declare function imageDataMonoToPBM(data: ImageData): Blob;