🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
Socket

@types/react-native-torch

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@types/react-native-torch

TypeScript definitions for react-native-torch

1.1.2
ts4.5
ts4.6
ts4.7
ts4.8
ts4.9
ts5.0
ts5.1
ts5.2
ts5.3
ts5.4
ts5.5
ts5.6
ts5.7
ts5.8
ts5.9
latest
Source
npm
Version published
Weekly downloads
619
-7.89%
Maintainers
1
Weekly downloads
 
Created
Source

Installation

npm install --save @types/react-native-torch

Summary

This package contains type definitions for react-native-torch (https://github.com/ludo/react-native-torch#readme).

Details

Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/react-native-torch.

index.d.ts

declare const Torch: {
    /**
     * Used to turn on or off the torch. Pass `true` to turn on and `false` to
     * turn off
     *
     * @example
     *  Torch.switchState(true); // Turn ON
     *  Torch.switchState(false); // Turn OFF
     *
     * @param newState `true` for on or `false` for off
     */
    switchState(newState: boolean): void;

    /**
     * On android, we need to ask for permissions before being able to turn on/off
     * the torch
     *
     * @example
     *  if (Platform.OS === 'ios') {
     *    Torch.switchState(this.isTorchOn);
     *  } else {
     *    const cameraAllowed = await Torch.requestCameraPermission(
     *      'Camera Permissions', // dialog title
     *      'We require camera permissions to use the torch on the back of your phone.' // dialog body
     *    );
     *
     *    if (cameraAllowed) {
     *      Torch.switchState(this.isTorchOn);
     *    }
     *  }
     *
     * @param dialogTitle The title of the permissions dialog
     * @param dialogBody The body text of the permissions dialog
     */
    requestCameraPermission(dialogTitle: string, dialogBody: string): Promise<boolean>;
};

export default Torch;

Additional Details

  • Last updated: Tue, 07 Nov 2023 09:09:39 GMT
  • Dependencies: none

Credits

These definitions were written by Ben Lorantfy.

FAQs

Package last updated on 07 Nov 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts