Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@keiser/echip-webusb

Package Overview
Dependencies
Maintainers
2
Versions
26
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@keiser/echip-webusb - npm Package Compare versions

Comparing version 1.3.3 to 1.3.4

247

index.d.ts
// Generated by dts-bundle v0.7.3
export class EChipReaderWatcher extends USBDevice {
export class ChipReaderWatcher extends USBDevice {
constructor();
stop(): Promise<void>;
onConnect(listener: Listener<EChipReader>): Disposable;
onConnect(listener: Listener<ChipReader>): Disposable;
protected connected(device: WebUSBDevice): Promise<void>;
protected disconnected(device: WebUSBDevice): Promise<void>;
}
const _default: EChipReaderWatcher;
const _default: ChipReaderWatcher;
export default _default;

@@ -22,3 +22,3 @@

export class EChipReader {
export class ChipReader {
readonly claimed: Promise<boolean>;

@@ -28,3 +28,3 @@ constructor(usbDevice: WebUSBDevice, onDisconnect: (listener: Listener<WebUSBDevice>) => Disposable);

onDisconnect(listener: Listener<null>): Disposable;
onEChipDetect(listener: Listener<EChip>): Disposable;
onChipDetect(listener: Listener<Chip>): Disposable;
protected disconnected(device: WebUSBDevice): void;

@@ -49,7 +49,160 @@ protected dispose(): Promise<void>;

export class EChip extends EChipConnection {
constructor(echipId: Uint8Array, owDevice: OWDevice, onDisconnect: (listener: Listener<null>) => Disposable);
get id(): string;
destroy(): void;
getData(): Promise<EChipObject>;
type USBDirection = "in" | "out"
type USBEndpointType = "bulk" | "interrupt" | "isochronous"
type USBRequestType = "standard" | "class" | "vendor"
type USBRecipient = "device" | "interface" | "endpoint" | "other"
type USBTransferStatus = "ok" | "stall" | "babble"
export interface USBEndpoint {
readonly endpointNumber: number
readonly direction: USBDirection
readonly type: USBEndpointType
readonly packetSize: number
}
export interface USBControlTransferParameters {
requestType: USBRequestType
recipient: USBRecipient
request: number
value: number
index: number
}
export interface USBDeviceFilter {
vendorId?: number
productId?: number
classCode?: number
subclassCode?: number
protocolCode?: number
serialNumber?: string
}
export interface USBDeviceRequestOptions {
filters: USBDeviceFilter[]
}
export interface USBConnectionEventInit extends EventInit {
device: WebUSBDevice
}
class USBConfiguration {
readonly configurationValue: number
readonly configurationName?: string
readonly interfaces: USBInterface[]
}
class USBInterface {
constructor(configuration: USBConfiguration, interfaceNumber: number)
readonly interfaceNumber: number
readonly alternate: USBAlternateInterface
readonly alternates: USBAlternateInterface[]
readonly claimed: boolean
}
class USBAlternateInterface {
constructor(deviceInterface: USBInterface, alternateSetting: number)
readonly alternateSetting: number
readonly interfaceClass: number
readonly interfaceSubclass: number
readonly interfaceProtocol: number
readonly interfaceName?: string
readonly endpoints: USBEndpoint[]
}
class USBInTransferResult {
constructor(status: USBTransferStatus, data?: DataView)
readonly data?: DataView
readonly status?: USBTransferStatus
}
class USBOutTransferResult {
constructor(status: USBTransferStatus, bytesWriten?: number)
readonly bytesWritten: number
readonly status: USBTransferStatus
}
class USBIsochronousInTransferPacket {
constructor(status: USBTransferStatus, data?: DataView)
readonly data?: DataView
readonly status?: USBTransferStatus
}
class USBIsochronousInTransferResult {
constructor(packets: USBIsochronousInTransferPacket[], data?: DataView)
readonly data?: DataView
readonly packets: USBIsochronousInTransferPacket[]
}
class USBIsochronousOutTransferPacket {
constructor(status: USBTransferStatus, bytesWritten?: number)
readonly bytesWritten: number
readonly status: USBTransferStatus
}
class USBConnectionEvent extends Event {
constructor(type: string, eventInitDict: USBConnectionEventInit)
readonly device: WebUSBDevice
}
class USBIsochronousOutTransferResult {
constructor(packets: USBIsochronousOutTransferPacket[])
readonly packets: USBIsochronousOutTransferPacket[]
}
export class WebUSB extends EventTarget {
onconnect(): (this: this, ev: Event) => any
ondisconnect(): (this: this, ev: Event) => any
getDevices(): Promise<WebUSBDevice[]>
requestDevice(options?: USBDeviceRequestOptions): Promise<WebUSBDevice>
addEventListener(type: "connect" | "disconnect", listener: EventListener, useCapture?: boolean): void
}
export class WebUSBDevice {
readonly usbVersionMajor: number
readonly usbVersionMinor: number
readonly usbVersionSubminor: number
readonly deviceClass: number
readonly deviceSubclass: number
readonly deviceProtocol: number
readonly vendorId: number
readonly productId: number
readonly deviceVersionMajor: number
readonly deviceVersionMinor: number
readonly deviceVersionSubminor: number
readonly manufacturerName?: string
readonly productName?: string
readonly serialNumber?: string
readonly configuration?: USBConfiguration
readonly configurations: USBConfiguration[]
readonly opened: boolean
open(): Promise<void>
close(): Promise<void>
selectConfiguration(configurationValue: number): Promise<void>
claimInterface(interfaceNumber: number): Promise<void>
releaseInterface(interfaceNumber: number): Promise<void>
selectAlternateInterface(interfaceNumber: number, alternateSetting: number): Promise<void>
controlTransferIn(setup: USBControlTransferParameters, length: number): Promise<USBInTransferResult>
controlTransferOut(setup: USBControlTransferParameters, data?: BufferSource): Promise<USBOutTransferResult>
clearHalt(direction: USBDirection, endpointNumber: number): Promise<void>
transferIn(endpointNumber: number, length: number): Promise<USBInTransferResult>
transferOut(endpointNumber: number, data: BufferSource): Promise<USBOutTransferResult>
isochronousTransferIn(endpointNumber: number, packetLengths: number[]): Promise<USBIsochronousInTransferResult>
isochronousTransferOut(endpointNumber: number, data: BufferSource, packetLengths: number[]): Promise<USBIsochronousOutTransferResult>
reset(): Promise<void>
}
global {
interface Navigator {
readonly usb?: WebUSB
}
}
export type Chip = DataChip | RTCChip | TZChip | BaseChip;
export class DataChip extends BaseChip {
protected data: Promise<DataChipObject>;
constructor(chipId: Uint8Array, owDevice: OWDevice, onDisconnect: (listener: Listener<null>) => Disposable);
getData(): Promise<DataChipObject>;
clearData(): Promise<void>;

@@ -60,30 +213,53 @@ setData(machines: {

performSetData(newData: Uint8Array[]): Promise<void>;
}
export class RTCChip extends BaseChip {
constructor(chipId: Uint8Array, owDevice: OWDevice, onDisconnect: (listener: Listener<null>) => Disposable);
getData(): Promise<ChipObject>;
setRTC(): Promise<ChipObject>;
}
export class TZChip extends BaseChip {
constructor(chipId: Uint8Array, owDevice: OWDevice, onDisconnect: (listener: Listener<null>) => Disposable);
getData(): Promise<ChipObject>;
setTZOffset(): Promise<ChipObject>;
}
export class BaseChip {
protected chipId: Uint8Array;
protected owDevice: OWDevice;
constructor(chipId: Uint8Array, owDevice: OWDevice, onDisconnect: (listener: Listener<null>) => Disposable);
get diposed(): boolean;
onDisconnect(listener: Listener<null>): Disposable;
protected disconnected(): void;
protected dispose(): void;
get id(): string;
get type(): ChipType;
destroy(): void;
}
export class OWDevice {
constructor(usbDevice: WebUSBDevice, onDetectKeys?: (keyId: Array<Uint8Array>) => void);
constructor(usbDevice: WebUSBDevice, onDetectChips?: (chipId: Array<Uint8Array>) => void);
claim(): Promise<boolean>;
startSearch(): Promise<void>;
close(): Promise<void>;
keyWriteAll(keyRom: Uint8Array, data?: Array<Uint8Array>, overdrive?: boolean): Promise<void>;
keyWriteDiff(keyRom: Uint8Array, newData?: Array<Uint8Array>, oldData?: Array<Uint8Array>, overdrive?: boolean): Promise<void>;
keyReadAll(keyRom: Uint8Array, overdrive?: boolean): Promise<Uint8Array[] | undefined>;
dataChipWriteAll(chipRom: Uint8Array, data?: Array<Uint8Array>, overdrive?: boolean): Promise<void>;
dataChipWriteDiff(chipRom: Uint8Array, newData?: Array<Uint8Array>, oldData?: Array<Uint8Array>, overdrive?: boolean): Promise<void>;
dataChipReadAll(chipRom: Uint8Array, overdrive?: boolean): Promise<Uint8Array[]>;
tzChipWrite(chipRom: Uint8Array, tzString: Uint8Array, tzOffset: Uint8Array): Promise<void>;
rtcChipWrite(chipRom: Uint8Array, data: Uint8Array): Promise<void>;
}
export class EChipConnection {
protected disposed: boolean;
constructor(onDisconnect: (listener: Listener<null>) => Disposable);
get diposed(): boolean;
onDisconnect(listener: Listener<null>): Disposable;
protected disconnected(): void;
protected dispose(): void;
export class ChipObject {
protected chipType: ChipType;
constructor(chipType: ChipType);
get type(): ChipType;
}
export interface EChipObject {
machineData: {
export class DataChipObject extends ChipObject {
constructor(data?: Uint8Array[]);
get machineData(): {
[index: string]: MachineObject;
};
rawData: Uint8Array[];
validStructure: boolean;
get rawData(): Uint8Array[];
get validStructure(): boolean;
}

@@ -143,6 +319,21 @@ export interface MachineObject {

}
export function EChipParser(data?: Uint8Array[]): EChipObject;
export function EChipBuilder(machines: {
export enum ChipType {
dataChip = 12,
rtcChip = 36,
tzChip = 45,
unknown = 0
}
export function DataChipParser(data?: Uint8Array[]): {
machineData: {
[index: string]: MachineObject;
};
validStructure: boolean;
};
export function DataChipBuilder(machines: {
[index: string]: MachineObject;
}): Uint8Array[];
export function getChipType(value: number): ChipType;
export function getChipLabel(type: ChipType): "Data Chip" | "RTC Chip" | "TZ Chip" | "Unknown Chip";
export function getTzOffset(): Uint8Array;
export function getCurrentTimeArray(): Uint8Array;

2

package.json
{
"name": "@keiser/echip-webusb",
"version": "1.3.3",
"version": "1.3.4",
"description": "Keiser Air eChip WebUSB Library",

@@ -5,0 +5,0 @@ "keywords": [

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc