All the encoders that Chrome/Safari/Firefox support out of the box. (#74)

* All the encoders that Chrome/Safari/Firefox support out of the box.

* Typo
This commit is contained in:
Jake Archibald
2018-07-02 19:10:10 +01:00
committed by GitHub
parent 807a76d443
commit 3867448aad
10 changed files with 134 additions and 11 deletions

View File

@@ -0,0 +1,16 @@
import { canvasEncode } from '../../lib/util';
import { canvasEncodeTest } from '../generic/util';
export interface EncodeOptions { }
export interface EncoderState { type: typeof type; options: EncodeOptions; }
export const type = 'browser-pdf';
export const label = 'Browser PDF';
export const mimeType = 'application/pdf';
export const extension = 'pdf';
export const defaultOptions: EncodeOptions = {};
export const featureTest = () => canvasEncodeTest(mimeType);
export function encode(data: ImageData, options: EncodeOptions) {
return canvasEncode(data, mimeType);
}