How can I declare a function parameter of type UInt8Array in TypeScript?
import * as fs from "fs";
fs.readFile(fileName, (err: string, data: UInt8Array) => {
if (err) {
return console.error(err);
}
console.log("file text: " + data.toString());
});
I encountered an issue:
Error TS2304: Cannot find name 'UInt8Array'
Appreciate the help!