메뉴로 바로가기

Getting Started

GitHub

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 Setup을 선호한다면, 플러그인을 설치하기 위해 다음 명령어를 실행하고 아래의 플랫폼별 지침을 따르세요:

터미널 창
bun add @capgo/capacitor-flash
bunx cap sync
import { CapacitorFlash } from '@capgo/capacitor-flash';

API 개요

API 개요

__CAPGO_KEEP_0__가 장치에 사용 가능한지 확인합니다.

import { CapacitorFlash } from '@capgo/capacitor-flash';
const { value } = await CapacitorFlash.isAvailable();
if (value) {
console.log('Flashlight is available');
}

__CAPGO_KEEP_0__를 켭니다.

import { CapacitorFlash } from '@capgo/capacitor-flash';
// Turn on at full brightness
await CapacitorFlash.switchOn({ intensity: 1.0 });
// Turn on at half brightness
await CapacitorFlash.switchOn({ intensity: 0.5 });

__CAPGO_KEEP_0__를 끕니다.

import { CapacitorFlash } from '@capgo/capacitor-flash';
await CapacitorFlash.switchOff();

__CAPGO_KEEP_0__가 현재 켜져 있는지 확인합니다.

import { CapacitorFlash } from '@capgo/capacitor-flash';
const { value } = await CapacitorFlash.isSwitchedOn();
console.log('Flashlight is on:', value);

flashlight를 켜거나 끄세요.

import { CapacitorFlash } from '@capgo/capacitor-flash';
const { value } = await CapacitorFlash.toggle();
console.log('Flashlight toggled, now on:', value);

진실의 근원

진실의 근원 제목

이 페이지는 플러그인의 src/definitions.ts. upstream에서 pubic API이 변경될 때 다시 싱크를 실행하세요.

Getting Started에서 계속하세요

Getting Started에서 계속하세요 제목

Capgo를 사용 중이라면 Getting Started 대시보드와 API 운영을 계획하고 연결하세요. Using @capgo/capacitor-flash Using @capgo/capacitor-flash API 개요 for the implementation detail in API Overview, Capacitor Overview __CAPGO_KEEP_0__ 키 API Keys for the implementation detail in API Keys, and Capacitor Overview Capacitor Overview