시작하기
설치 단계와 플러그인에 대한 전체 마크다운 가이드가 포함된 설정 지시를 복사하세요.
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을 사용하여 플러그인을 설치할 수 있습니다. 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 Setup을 선호한다면, 플러그인을 설치하기 위해 다음 명령어를 실행하고 아래에 플랫폼에 따라 설명된 지침을 따르세요.
bun add @capgo/capacitor-flashbunx cap syncImport
Importimport { 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');}switchOn
__CAPGO_KEEP_0__ 제목__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__ 제목__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);Source Of Truth
Source Of Truth 섹션 제목이 페이지는 플러그인의 src/definitions.ts. upstream에서 변경된 public API를 다시 동기화할 때입니다.
Getting Started에서 계속
Getting Started에서 계속 섹션 제목만약에 사용 중이라면 Getting Started 대시보드와 API 연산을 계획하고 싶다면 native capability을 위해 @capgo/capacitor-flash를 사용하세요 native capability을 위해 @capgo/capacitor-flash를 사용하는 방법 API 개요 API의 구현 세부 사항 소개 __CAPGO_KEEP_0__의 구현 세부 사항 API 키 API의 구현 세부 사항 장치 __CAPGO_KEEP_0__ 구현 세부 사항.