Fixing nits
This commit is contained in:
@@ -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
3
src/libapi.mjs.d.ts
vendored
@@ -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
2
src/types.d.ts
vendored
@@ -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>;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user