コンテンツにジャンプ

Getting Started

GitHub

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.

マニュアルセットアップを使用する場合は、以下のコマンドを実行してプラットフォーム固有の指示を以下に従ってください:

ターミナルウィンドウ
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 });

ダウンロードを終了し、永久にキャンセルします。 ダウンロードしたデータは削除されます。

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';
}

このページはプラグインの src/definitions.ts公開 API がアップストリームで変更された場合に再度同期を実行してください。

「始めから始める」から続けて

「始めから始める」から続けて

「始めから始める」から続けて 「始めから始める」から続けて to plan dashboard and API operations, connect it with Using @capgo/capacitor-downloader for the native capability in Using @capgo/capacitor-downloader, API 在给一定义的回笔因为一定义的回笔因 for the implementation detail in API Overview, 一定义的课程 一定义的课程的说明会一定义的课程 API Keys for the implementation detail in API Keys, and 一定义的设置为一定义的设置 一定义的回笔因为一定义的回笔因