signal-desktop/ts/util/canvasToArrayBuffer.ts
2021-06-25 11:08:16 -05:00

11 lines
302 B
TypeScript

// Copyright 2021 Signal Messenger, LLC
// SPDX-License-Identifier: AGPL-3.0-only
import { canvasToBlob } from './canvasToBlob';
export async function canvasToArrayBuffer(
canvas: HTMLCanvasElement
): Promise<ArrayBuffer> {
const blob = await canvasToBlob(canvas);
return blob.arrayBuffer();
}