UNPKG

blitflash

Version:

A JavaScript implementation of the 32blit flash tools

52 lines (51 loc) 1.54 kB
/// <reference types="w3c-web-serial" /> import { BlitRecord, BlitDrive } from './BlitConnection'; export declare type BlitFlasherOptions = { debug: boolean; }; export declare class BlitFlasher { private port; private options; private connection?; constructor(port: SerialPort, options?: BlitFlasherOptions); /** * Opens a connection to the 32Blit. */ open(): Promise<void>; /** * Closes the connection to the 32Blit. */ close(): Promise<void>; /** * Returns the 32Blit status. */ status(): Promise<string>; /** * Lists blit files installed on the 32Blit flash. */ list(): Promise<BlitRecord[]>; /** * Sends a blit file to the 32blit. */ sendFile(data: Uint8Array, drive: BlitDrive, filename: string, directory?: string): Promise<void>; /** * Resets the 32Blit. */ reset(): Promise<void>; /** * Return true if the browser is able to connect to a 32Blit over the serial port. */ static supportsWebSerial(): boolean; /** * Returns a previously approved serial port for the 32Blit or requests the user to authorise one. */ static getOrRequestPort(): Promise<SerialPort>; /** * Retrieves previously approved serial ports for the 32Blit. */ static getPorts(): Promise<SerialPort[]>; /** * Asks the user to authorise a serial port for the 32Blit. */ static requestPort(): Promise<SerialPort>; }