Getting Started
このプラグインのインストール手順と全マークダウンガイドを含むセットアッププロンプトをコピーします。
Set up this Capacitor plugin in the project.
Use the package manager already used by the project.
Install these package(s): `@capgo/capacitor-downloader`
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/downloader/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-downloader` plugin in my project.If you prefer Manual Setup, install the plugin by running the following commands and follow the platform-specific instructions below:
bun add @capgo/capacitor-downloaderbunx cap syncImport
「Import」セクションimport { CapacitorDownloader } from '@capgo/capacitor-downloader';API Overview
Section titled “API Overview”download
ダウンロードタスクを開始する__CAPGO_KEEP_0__をクリップボードにコピー
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 });resume
再開ダウンロードを一時停止した位置から再開します。
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 });checkStatus
ステータスダウンロードの現在のステータスを確認します。
import { CapacitorDownloader } from '@capgo/capacitor-downloader';
await CapacitorDownloader.checkStatus({} as { id: string });getFileInfo
ファイル情報ダウンロードしたファイルについての情報を取得します。
import { CapacitorDownloader } from '@capgo/capacitor-downloader';
await CapacitorDownloader.getFileInfo({} as { path: string });タイプ リファレンス
タイプ リファレンスDownloadOptions
ダウンロード オプションダウンロードを開始するための設定オプション
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';}DownloadTask
ダウンロード タスクダウンロードタスクの現在の状態と進行状況を表します。
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. upstreamのpublic APIが変更された場合に再度syncを実行してください。
Getting Startedから続けてください。
Getting Startedから続けてください。Capacitorを使用している場合 Getting Started ダッシュボードとAPIの作業を計画するには、Capacitorを Capacitorのnative capabilityを使用するには@capgo/capacitor-downloader Capacitorのnative capabilityを使用するには@capgo/capacitor-downloader APIの概要 APIの実装詳細 導入 導入の詳細における実装詳細のため API キー 実装詳細のためAPI キー、 デバイス デバイスの実装詳細のため