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.
インストール
「インストール」のセクションCapgoのAI-Assistedセットアップを使用してプラグインをインストールできます。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.Manualセットアップを使用する場合は、以下のコマンドを実行してプラグインをインストールし、以下のプラットフォーム固有の指示に従ってください。
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
「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
「switchOff」セクションflashlightを消す
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. upstream のパブリック API が変更されたときに、再度 Sync を実行してください。
Getting Started から続けてください。
Getting Started から続けてください。あなたが「Getting Started」から続けています。 Dashboard と __CAPGO_KEEP_0__ の計画と操作を行うには、 native capability を使用するために、@API/__CAPGO_KEEP_1__-flash を使用します。 native capability を使用するために、@capgo/capacitor-flash を使用します。 for the native capability in Using @capgo/capacitor-flash, API の実装詳細 API の実装詳細 導入 導入の実装詳細 API キー API キーに関する実装詳細のため、 デバイス デバイスに関する実装詳細のため、