コンテンツにジャンプ

始めて

GitHub
Terminal window
bun add @capgo/capacitor-flash
bunx cap sync

Copy for AI

Ready to paste
import { CapacitorFlash } from '@capgo/capacitor-flash';

セクションのタイトル “isAvailable”

import { CapacitorFlash } from '@capgo/capacitor-flash';
const { value } = await CapacitorFlash.isAvailable();
if (value) {
console.log('Flashlight is available');
}

コピー

import { CapacitorFlash } from '@capgo/capacitor-flash';
// Turn on at full brightness
await CapacitorFlash.switchOn({ intensity: 1.0 });
// Turn on at half brightness
await CapacitorFlash.switchOn({ intensity: 0.5 });

照明をオンにします。

import { CapacitorFlash } from '@capgo/capacitor-flash';
await CapacitorFlash.switchOff();

flashlightが現在オンかオフかを確認します。

import { CapacitorFlash } from '@capgo/capacitor-flash';
const { value } = await CapacitorFlash.isSwitchedOn();
console.log('Flashlight is on:', value);

flashlightをオンかオフに切り替えます。

import { CapacitorFlash } from '@capgo/capacitor-flash';
const { value } = await CapacitorFlash.toggle();
console.log('Flashlight toggled, now on:', value);

このページはプラグインの src/definitions.ts. 公開APIがアップストリームで変更された場合に再度syncを実行してください。

Capgoを使用している場合 Getting Started APIのダッシュボードと操作を計画するには、APIを capgo/capacitor-flashを使用して Capacitorのネイティブ機能を使用するには、@capgo/capacitor-flashを使用します。 APIの概要 APIの実装詳細 Capgoの概要 Capgoの実装詳細 API Keys for the implementation detail in API Keys, and __CAPGO_KEEP_0__のダッシュボードと操作を計画するには、__CAPGO_KEEP_0__を __CAPGO_KEEP_0__の実装詳細についての情報は、デバイスのページにあります。