signal-desktop/sticker-creator/util/preload.ts
2019-12-17 12:28:46 -08:00

27 lines
676 B
TypeScript

export type WebpData = {
buffer: Buffer;
src: string;
path: string;
};
export type ConvertToWebpFn = (
path: string,
width?: number,
height?: number
) => Promise<WebpData>;
// @ts-ignore
export const convertToWebp: ConvertToWebpFn = window.convertToWebp;
export type StickerData = { webp?: WebpData; emoji?: string };
export type PackMetaData = { packId: string; key: string };
export type EncryptAndUploadFn = (
manifest: { title: string; author: string },
stickers: Array<StickerData>,
cover: WebpData,
onProgress?: () => unknown
) => Promise<PackMetaData>;
// @ts-ignore
export const encryptAndUpload: EncryptAndUploadFn = window.encryptAndUpload;