Fixing nits

This commit is contained in:
ICheered
2023-08-05 17:46:08 +02:00
parent b74d938839
commit 83279b5e58
3 changed files with 4 additions and 9 deletions

View File

@@ -31,14 +31,14 @@ const INTERFACE_SUBCLASS = 1; // MTP
let ModulePromise = null; let ModulePromise = null;
class Camera { export class Camera {
constructor() { constructor() {
this.queue = Promise.resolve(); this.queue = Promise.resolve();
this.Module = null; this.Module = null;
this.context = null; this.context = null;
} }
async showCameraPicker() { static async showPicker() {
// @ts-ignore // @ts-ignore
await navigator.usb.requestDevice({ await navigator.usb.requestDevice({
filters: [ filters: [
@@ -100,6 +100,4 @@ class Camera {
async consumeEvents() { async consumeEvents() {
return this.schedule((context) => context.consumeEvents()); return this.schedule((context) => context.consumeEvents());
} }
} }
export { Camera };

3
src/libapi.mjs.d.ts vendored
View File

@@ -41,9 +41,6 @@ declare interface SupportedOps {
} }
declare class Context { declare class Context {
context(): Promise<any> {
throw new Error('Method not implemented.');
}
configToJS(): Promise<Config & { type: 'window' }>; configToJS(): Promise<Config & { type: 'window' }>;
setConfigValue( setConfigValue(
name: string, name: string,

2
src/types.d.ts vendored
View File

@@ -4,7 +4,7 @@ import type { Config, Context, SupportedOps } from './libapi.mjs.d.ts';
export declare class Camera { export declare class Camera {
constructor(); constructor();
showCameraPicker(): Promise<void>; static showPicker(): Promise<void>;
connect(): Promise<void>; connect(): Promise<void>;
disconnect(): Promise<void>; disconnect(): Promise<void>;