はじめに
このプラグインのインストール手順と全体のマークダウンガイドを含む設定プロンプトをコピーする。
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 Setupを利用してプラグインをインストールすることができます。次のコマンドを使用して、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 Setup を好みますか? 以下のコマンドを実行し、下記のプラットフォーム固有の指示に従ってプラグインをインストールしてください。
bun add @capgo/capacitor-flashbunx cap syncインポート
インポートimport { CapacitorFlash } from '@capgo/capacitor-flash';API の概要
APIガイドisAvailable
__CAPGO_KEEP_0__ の概要__CAPGO_KEEP_0__ の概要
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 brightnessawait CapacitorFlash.switchOn({ intensity: 1.0 });
// Turn on at half brightnessawait CapacitorFlash.switchOn({ intensity: 0.5 });switchOff
switchOffフラッシュライトをオフにする。
import { CapacitorFlash } from '@capgo/capacitor-flash';
await CapacitorFlash.switchOff();isSwitchedOn
isSwitchedOnswitchOff
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 がアップストリームで変更されたときは、再度同期を実行してください。
「Getting Started」から続けてください。
「Getting Started」から続けてください。「Getting Started」を使用してダッシュボードと__CAPGO_KEEP_0__の作業を計画している場合、__CAPGO_KEEP_0__を 「@__CAPGO_KEEP_0__/__CAPGO_KEEP_1__-flash」を使用して、@__CAPGO_KEEP_0__/__CAPGO_KEEP_1__-flashのネイティブ機能に 「@API/__CAPGO_KEEP_1__-flash」のネイティブ機能について 「@capgo/capacitor-flash」の実装詳細について @capgo/capacitorのネイティブ機能を使用するために APIの概要 APIの概要 [ 概要 API キー API キー Devices デバイス