fix typescript errors, add tsconfig.json
This commit is contained in:
parent
253fccaf78
commit
7c383e8cd0
2 changed files with 18 additions and 7 deletions
13
tsconfig.json
Normal file
13
tsconfig.json
Normal file
|
@ -0,0 +1,13 @@
|
|||
{
|
||||
"compilerOptions": {
|
||||
"target": "es2016", /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */
|
||||
"jsx": "react",
|
||||
"module": "commonjs", /* Specify what module code is generated. */
|
||||
"esModuleInterop": true, /* Emit additional JavaScript to ease support for importing CommonJS modules. This enables `allowSyntheticDefaultImports` for type compatibility. */
|
||||
"forceConsistentCasingInFileNames": true, /* Ensure that casing is correct in imports. */
|
||||
/* Type Checking */
|
||||
// "strict": true, /* Enable all strict type-checking options. */
|
||||
"noImplicitAny": false, /* Enable error reporting for expressions and declarations with an implied `any` type.. */
|
||||
"skipLibCheck": true /* Skip type checking all .d.ts files. */
|
||||
}
|
||||
}
|
|
@ -25,15 +25,13 @@ require('highlightjs-line-numbers.js');
|
|||
|
||||
const FileForm = () => {
|
||||
const handleChange = (event: React.ChangeEvent<HTMLInputElement>) => {
|
||||
let file = event.target.files![0];
|
||||
const fr = new FileReader();
|
||||
fr.onload = (e) => {
|
||||
const { result } = e.target;
|
||||
if (result instanceof ArrayBuffer) {
|
||||
let data = new Uint8Array(result);
|
||||
fr.onload = (_e) => {
|
||||
let data = new Uint8Array(fr.result as ArrayBuffer);
|
||||
encrypt_array_buffer(data);
|
||||
}
|
||||
}
|
||||
fr.readAsArrayBuffer((event.target as HTMLInputElement).files[0]);
|
||||
fr.readAsArrayBuffer(file);
|
||||
}
|
||||
|
||||
return (
|
||||
|
|
Loading…
Reference in a new issue