始めて
インストール手順とこのプラグインの全マークダウンガイドを含むセットアップ用の質問をコピーできます。
Set up this Capacitor plugin in the project.
Use the package manager already used by the project.
Install these package(s): `@capgo/capacitor-flash`
Run the required Capacitor sync/update step after installation.
Read this markdown guide for the full setup steps: https://raw.githubusercontent.com/Cap-go/website/refs/heads/main/apps/docs/src/content/docs/docs/plugins/flash/getting-started.mdx
Use that guide for platform-specific steps, native file edits, permissions, config changes, imports, and usage setup.
If that guide references other docs pages, read them too.
Install
Section titled “Install”bun add @capgo/capacitor-flashbunx cap syncCopy for AI
Ready to pasteimport { CapacitorFlash } from '@capgo/capacitor-flash';API の概要
API の概要のセクションisAvailable
セクションのタイトル “__CAPGO_KEEP_0__ の概要”セクションのタイトル “isAvailable”
import { CapacitorFlash } from '@capgo/capacitor-flash';
const { value } = await CapacitorFlash.isAvailable();if (value) { console.log('Flashlight is available');}switchOn
照明が利用可能かどうかを確認します。コピー
import { CapacitorFlash } from '@capgo/capacitor-flash';
// Turn on at full brightnessawait CapacitorFlash.switchOn({ intensity: 1.0 });
// Turn on at half brightnessawait CapacitorFlash.switchOn({ intensity: 0.5 });switchOff
__CAPGO_KEEP_0__ の概要照明をオンにします。
import { CapacitorFlash } from '@capgo/capacitor-flash';
await CapacitorFlash.switchOff();isSwitchedOn
isSwitchedOnのセクションflashlightが現在オンかオフかを確認します。
import { CapacitorFlash } from '@capgo/capacitor-flash';
const { value } = await CapacitorFlash.isSwitchedOn();console.log('Flashlight is on:', value);toggle
toggleのセクションflashlightをオンかオフに切り替えます。
import { CapacitorFlash } from '@capgo/capacitor-flash';
const { value } = await CapacitorFlash.toggle();console.log('Flashlight toggled, now on:', value);このページはプラグインの src/definitions.ts. 公開APIがアップストリームで変更された場合に再度syncを実行してください。
Getting Startedから続けて
Keep going from Getting Startedのセクション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__の実装詳細についての情報は、デバイスのページにあります。