refactor: declare used wormhole-crypto types

This commit is contained in:
Jeremy Kahn 2023-02-17 09:43:55 -06:00
parent 9477fb2306
commit 7d73a5ca7f
2 changed files with 15 additions and 1 deletions

View File

@ -1 +1,16 @@
/// <reference types="react-scripts" />
// TODO: Type the rest of the API and contribute it to the wormhole-crypto project
declare module 'wormhole-crypto' {
export class Keychain {
constructor(key: Uint8Array, salt: Uint8Array)
encryptStream(ReadableStream): Promise<ReadableStream>
decryptStream(ReadableStream): Promise<ReadableStream>
}
export const plaintextSize = number => number
export const encryptedSize = number => number
}

View File

@ -1,6 +1,5 @@
import WebTorrent, { Torrent, TorrentFile } from 'webtorrent'
import streamSaver from 'streamsaver'
// @ts-ignore
import { Keychain, plaintextSize, encryptedSize } from 'wormhole-crypto'
// @ts-ignore
import idbChunkStore from 'idb-chunk-store'