1.0.1 • Published 5 years ago

@tim-smart/torch v1.0.1

Weekly downloads
-
License
MIT
Repository
-
Last release
5 years ago

@tim-smart/torch

A small library to toggle the flash on a smartphone on/off.

API

Use the createTorch function to create a new Torch instance and call setup all in one go.

export declare class Torch {
  setup(): Promise<void>;

  toggle(enableFlash?: boolean): Promise<void>;
  on(): Promise<void>;
  off(): Promise<void>;
  stop(): void;
}
export declare function createTorch(): Promise<Torch>;

Usage

import { createTorch } from "@tim-smart/torch";

(async () => {
  const torch = await createTorch();
  await torch.on();
  setTimeout(() => torch.stop(), 5000);
})();
1.0.1

5 years ago

1.0.0

5 years ago