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.
インストール
「インストール」というタイトルのセクション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-downloaderbunx cap syncimport { CapacitorDownloader } from '@capgo/capacitor-downloader';API の概要
Section titled “API の概要”download
Section titled “ダウンロード”新しいダウンロードタスクを開始します。
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
Section titled “再開”一時停止したダウンロードを再開します。 一時停止した位置から続きます。
import { CapacitorDownloader } from '@capgo/capacitor-downloader';
await CapacitorDownloader.resume({} as { id: string });stop
__CAPGO_KEEP_1____CAPGO_KEEP_2__
import { CapacitorDownloader } from '@capgo/capacitor-downloader';
await CapacitorDownloader.stop({} as { id: string });checkStatus
__CAPGO_KEEP_1____CAPGO_KEEP_3__
import { CapacitorDownloader } from '@capgo/capacitor-downloader';
await CapacitorDownloader.checkStatus({} as { id: string });getFileInfo
__CAPGO_KEEP_1____CAPGO_KEEP_4__
import { CapacitorDownloader } from '@capgo/capacitor-downloader';
await CapacitorDownloader.getFileInfo({} as { path: string });__CAPGO_KEEP_5__
__CAPGO_KEEP_1__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';}ソースオブトゥルスのセクション
このページはプラグインの. 公開 __CAPGO_KEEP_0__ の上流で変更されたときに再度同期を実行してください。 src/definitions.ts. Re-run the sync when the public API changes upstream.
Getting Startedから続けてのセクション
ダウンロードタスクの現在の状態と進行状況を表しますCapgoを使用している場合 Getting Started ダッシュボードとAPIの操作を計画するには、APIに接続してください native capabilityのために@capgo/capacitor-downloaderを使用する native capabilityのために@capgo/capacitor-downloaderを使用する APIの概要 APIの実装詳細 概要 __CAPGO_KEEP_0__の実装詳細 APIのキー APIの実装詳細 デバイス __CAPGO_KEEP_0__の実装詳細については、デバイスのページを参照してください。