Skip to content

Commit

Permalink
Use latest web flasher
Browse files Browse the repository at this point in the history
  • Loading branch information
balloob committed Jun 4, 2021
1 parent 7cf91fa commit a8dfa54
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 27 deletions.
19 changes: 10 additions & 9 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"@material/mwc-circular-progress": "^0.21.0",
"@material/mwc-dialog": "^0.21.0",
"@material/mwc-textfield": "^0.21.0",
"esp-web-flasher": "^1.0.0",
"esp-web-flasher": "^1.0.3",
"lit": "^2.0.0-rc.2",
"tslib": "^2.2.0"
}
Expand Down
14 changes: 0 additions & 14 deletions src/const.ts
Original file line number Diff line number Diff line change
@@ -1,17 +1,3 @@
import { connect } from "esp-web-flasher";

type AsyncReturnType<T extends (...args: any) => any> = T extends (
...args: any
) => Promise<infer U>
? U
: T extends (...args: any) => infer U
? U
: any;

// Waiting for esp-web-flash >1.0.0 release which will include this type
export type ESPLoader = AsyncReturnType<typeof connect>;
export type Logger = Parameters<typeof connect>[0];

export interface Build {
chipFamily: "ESP32" | "ESP8266";
improv: boolean;
Expand Down
4 changes: 2 additions & 2 deletions src/start-flash.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { html } from "lit";
import { connect } from "esp-web-flasher";
import { Build, ESPLoader, Manifest, Logger } from "./const";
import { connect, ESPLoader, Logger } from "esp-web-flasher";
import { Build, Manifest } from "./const";
import "./flash-log";
import { getChipFamilyName, sleep } from "./util";

Expand Down
2 changes: 1 addition & 1 deletion src/util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import {
CHIP_FAMILY_ESP32,
CHIP_FAMILY_ESP32S2,
CHIP_FAMILY_ESP8266,
ESPLoader,
} from "esp-web-flasher";
import { ESPLoader } from "./const";

export const getChipFamilyName = (esploader: ESPLoader) => {
switch (esploader.chipFamily) {
Expand Down

0 comments on commit a8dfa54

Please sign in to comment.