Getting Started
このプラグインのインストール手順とフルマークダウンガイドを含むセットアップコマンドをコピーしてください。
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.
インストール
インストールAI-Assisted セットアップを使用してプラグインをインストールできます。次のコマンドを使用して、Capgo スキルをAIツールに追加します。
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.Manual セットアップを使用する場合は、次のコマンドを実行してプラグインをインストールし、以下のプラットフォーム固有の説明を参照してください。
bun add @capgo/capacitor-flashbunx cap syncインポート
「インポート」のセクションimport { CapacitorFlash } from '@capgo/capacitor-flash';API の概要
APIの概要isAvailable
isAvailable__CAPGO_KEEP_0__が利用可能かどうかを確認します。
import { CapacitorFlash } from '@capgo/capacitor-flash';
const { value } = await CapacitorFlash.isAvailable();if (value) { console.log('Flashlight is available');}switchOn
__CAPGO_KEEP_0__をオンにします。コピー
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
__CAPGO_KEEP_0__が利用可能かどうかを確認します。コピー
import { CapacitorFlash } from '@capgo/capacitor-flash';
const { value } = await CapacitorFlash.isSwitchedOn();console.log('Flashlight is on:', value);toggle
「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 から続けて」タイトルのセクションCapacitor を使用している場合 Getting Started ダッシュボードとAPIの作業を計画するには、 Using @capgo/capacitor-flash Using @capgo/capacitor-flash APIの概要 for the implementation detail in API Overview, Capacitorの概要 Capacitorの実装詳細については、 API Keys for the implementation detail in API Keys, and デバイス Capacitorの実装詳細については、