フラッシュ __CAPGO_KEEP_0__ リポジトリ
このプラグインのインストール手順と全マークダウンガイドのセットアッププロンプトをコピーしてください。
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.
インストール
「インストール」のセクションCapgoのAIアシストセットアップを使用してプラグインをインストールできます。AIツールにCapgoスキルを追加するには、以下のコマンドを使用してください。
npx skills add https://github.com/Cap-go/capgo-skills --skill capacitor-plugins次のプロンプトを使用してください。
Use the `capacitor-plugins` skill from `Cap-go/capgo-skills` to install the `@capgo/capacitor-flash` plugin in my project.手動設定を好む場合は、以下のコマンドを実行してプラグインをインストールし、下記のプラットフォーム固有の指示に従ってください。
bun add @capgo/capacitor-flashbunx cap syncインポート
「インポート」のセクションimport { CapacitorFlash } from '@capgo/capacitor-flash';APIの概要
「APIの概要」のセクションisAvailable
「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
「スイッチオフ」スイッチをオフにします。
import { CapacitorFlash } from '@capgo/capacitor-flash';
await CapacitorFlash.switchOff();isSwitchedOn
「スイッチオン/オフ」スイッチのオン/オフ状態を確認します。
import { CapacitorFlash } from '@capgo/capacitor-flash';
const { value } = await CapacitorFlash.isSwitchedOn();console.log('Flashlight is on:', value);toggle
「スイッチの切り替え」スイッチのオン/オフを切り替えます。
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から続けてください
「Getting Startedから続けてください」あなたが Getting Started を使用してダッシュボードとAPIの作業を計画している場合、 Using @capgo/capacitor-flash Using @capgo/capacitor-flash のAPIの概要 APIの実装詳細について 導入 __CAPGO_KEEP_0__のキー APIのキーについて、 for the implementation detail in API Keys, and 編集 前