Skip to content

Getting Started

GitHub

설치

설치

Capgo의 AI 보조 설치를 사용하여 플러그인을 설치할 수 있습니다. 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-downloader` plugin in my project.

만약 Manual Setup을 사용하는 경우, 플러그인을 설치하려면 다음 명령어를 실행하고 아래의 플랫폼별 지침을 따르세요:

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

새 다운로드 작업을 시작하세요.

import { CapacitorDownloader } from '@capgo/capacitor-downloader';
const task = await Downloader.download({
id: 'my-download',
url: 'https://example.com/file.pdf',
destination: 'downloads/file.pdf'
});

다운로드를 일시 정지합니다. 다운로드는 동일한 위치에서 다시 시작할 수 있습니다.

import { CapacitorDownloader } from '@capgo/capacitor-downloader';
await CapacitorDownloader.pause({} as { id: string });

다운로드를 중단한 곳부터 다시 시작합니다.

import { CapacitorDownloader } from '@capgo/capacitor-downloader';
await CapacitorDownloader.resume({} as { id: string });

stop

중단

다운로드를 영구적으로 중단하고 삭제합니다. 다운로드한 데이터는 삭제됩니다.

import { CapacitorDownloader } from '@capgo/capacitor-downloader';
await CapacitorDownloader.stop({} as { id: string });

클립보드 복사

import { CapacitorDownloader } from '@capgo/capacitor-downloader';
await CapacitorDownloader.checkStatus({} as { id: string });

타입 참조

import { CapacitorDownloader } from '@capgo/capacitor-downloader';
await CapacitorDownloader.getFileInfo({} as { path: string });

다운로드 시작을 위한 구성 옵션

export interface DownloadOptions {
/** Unique identifier for this download task */
id: string;
/** URL of the file to download */
url: string;
/** Local file path where the download will be saved */
destination: string;
/** Optional HTTP headers to include in the request */
headers?: { [key: string]: string };
/** Network type requirement for download */
network?: 'cellular' | 'wifi-only';
/** Download priority level */
priority?: 'high' | 'normal' | 'low';
}

다운로드 작업의 현재 상태 및 진행 상황을 나타냅니다.

export interface DownloadTask {
/** Unique identifier for the download task */
id: string;
/** Download progress from 0 to 100 */
progress: number;
/** Current state of the download */
state: 'PENDING' | 'RUNNING' | 'PAUSED' | 'DONE' | 'ERROR';
}

진실의 근원

플러그인의

공개 __CAPGO_KEEP_0__이 업스트림에서 변경될 때 다시 싱크를 실행하세요. src/definitions.ts. Re-run the sync when the public API changes upstream.

다운로드 플러그인

시작하기를 계속하는 방법

이러한 기능을 사용하고 있다면 시작하기 계획 대시보드 및 API 연산을 위해 시작하기를 사용하고 있다면 API를 Using @capgo/capacitor-downloader Using @capgo/capacitor-downloader API 개요 API 개요 소개 소개 API 키 API 키 기기 기기 구현 세부 사항에 대한 정보입니다.