Update TypeScript deprecated things and fix errors

pull/75/head
Melissa LeBlanc-Williams 4 years ago
parent cbd36a6c7b
commit 0739a8b11e

1449
package-lock.json generated

File diff suppressed because it is too large Load Diff

@ -12,12 +12,12 @@
"devDependencies": {
"@rollup/plugin-json": "^6.0.0",
"@rollup/plugin-node-resolve": "^15.0.1",
"@rollup/plugin-terser": "^0.4.0",
"@rollup/plugin-typescript": "^11.0.0",
"@types/pako": "^2.0.0",
"@types/w3c-web-serial": "^1.0.3",
"prettier": "^2.8.5",
"rollup": "^2.48.0",
"rollup-plugin-terser": "^7.0.2",
"serve": "^14.2.0",
"typescript": "^4.9.5"
},

@ -1,6 +1,6 @@
import { nodeResolve } from "@rollup/plugin-node-resolve";
import json from "@rollup/plugin-json";
import { terser } from "rollup-plugin-terser";
import terser from "@rollup/plugin-terser";
const config = {
input: "dist/index.js",

@ -32,7 +32,11 @@ export const ESP32_FLASH_SIZES = {
"128MB": 0x70,
};
export const DETECTED_FLASH_SIZES = {
interface FlashSize {
[key: number]: string;
}
export const DETECTED_FLASH_SIZES: FlashSize = {
0x12: "256KB",
0x13: "512KB",
0x14: "1MB",
@ -144,7 +148,14 @@ export type ChipFamily =
| typeof CHIP_FAMILY_ESP32C6
| typeof CHIP_FAMILY_ESP32H2;
export const CHIP_DETECT_MAGIC_VALUES = {
interface ChipInfo {
[magicValue: number]: {
name: string;
family: ChipFamily;
}
}
export const CHIP_DETECT_MAGIC_VALUES: ChipInfo = {
0xfff0c101: { name: "ESP8266", family: CHIP_FAMILY_ESP8266 },
0x00f01d83: { name: "ESP32", family: CHIP_FAMILY_ESP32 },
0x000007c6: { name: "ESP32-S2", family: CHIP_FAMILY_ESP32S2 },

@ -1024,7 +1024,7 @@ export class ESPLoader extends EventTarget {
}
async runStub(): Promise<EspStubLoader> {
const stub = await getStubCode(this.chipFamily);
const stub: Record<string, any> = await getStubCode(this.chipFamily);
// We're transferring over USB, right?
let ramBlock = USB_RAM_BLOCK;

@ -1,4 +1,11 @@
const lut = {
interface DataType {
[key: string]: {
u: Function;
p: Function;
bytes: number;
}
}
const lut: DataType = {
b: { u: DataView.prototype.getInt8, p: DataView.prototype.setInt8, bytes: 1 },
B: {
u: DataView.prototype.getUint8,

@ -13,7 +13,6 @@
"noUnusedLocals": true,
"forceConsistentCasingInFileNames": true,
"strict": true,
"suppressImplicitAnyIndexErrors": true,
"importHelpers": true
},
"include": ["src/*"]

Loading…
Cancel
Save