Mulai Berikutnya
Salin prompt pengaturan dengan langkah instalasi dan panduan markdown lengkap untuk plugin ini.
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.
Pasang
Judul Bagian “Pasang”Anda dapat menggunakan Pengaturan Bantuan AI kami untuk memasang plugin. Tambahkan Capgo kemampuan ke alat AI Anda menggunakan perintah berikut:
npx skills add https://github.com/Cap-go/capgo-skills --skill capacitor-pluginsLalu gunakan prompt berikut:
Use the `capacitor-plugins` skill from `Cap-go/capgo-skills` to install the `@capgo/capacitor-downloader` plugin in my project.Jika Anda lebih suka Pengaturan Manual, pasang plugin dengan menjalankan perintah-perintah berikut dan ikuti instruksi spesifik platform di bawah ini:
bun add @capgo/capacitor-downloaderbunx cap syncImpor
Judul Bagian “Impor”import { CapacitorDownloader } from '@capgo/capacitor-downloader';API Pengenalan
Bab berjudul “API Pengenalan”download
Bab berjudul “download”Mulai tugas download baru.
import { CapacitorDownloader } from '@capgo/capacitor-downloader';
const task = await Downloader.download({ id: 'my-download', url: 'https://example.com/file.pdf', destination: 'downloads/file.pdf'});pause
Bab berjudul “pause”Jeda download aktif. Download dapat dilanjutkan dari posisi yang sama kemudian.
import { CapacitorDownloader } from '@capgo/capacitor-downloader';
await CapacitorDownloader.pause({} as { id: string });resume
Bab berjudul “resume”Lanjutkan download yang terhenti. Melanjutkan dari posisi yang terhenti.
import { CapacitorDownloader } from '@capgo/capacitor-downloader';
await CapacitorDownloader.resume({} as { id: string });Hentikan dan batalkan download secara permanen. Data yang telah diunduh akan dihapus.
import { CapacitorDownloader } from '@capgo/capacitor-downloader';
await CapacitorDownloader.stop({} as { id: string });checkStatus
Bagian berjudul “cekStatus”Cek status saat ini dari download.
import { CapacitorDownloader } from '@capgo/capacitor-downloader';
await CapacitorDownloader.checkStatus({} as { id: string });getFileInfo
Bagian berjudul “getFileInfo”Dapatkan informasi tentang file yang telah diunduh.
import { CapacitorDownloader } from '@capgo/capacitor-downloader';
await CapacitorDownloader.getFileInfo({} as { path: string });Referensi Tipe
Bagian berjudul “Referensi Tipe”DownloadOptions
Bagian berjudul “Opsi Download”Pilihan konfigurasi untuk memulai download.
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
Bagian berjudul “DownloadTask”Mewakili keadaan dan kemajuan saat ini dari tugas download.
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';}Sumber Kebenaran
Bagian berjudul “Sumber Kebenaran”Halaman ini dihasilkan dari plugin’s src/definitions.ts. Re-run sinkronisasi ketika publik API berubah di atas.
Teruskan dari Getting Started
Bagian berjudul “Teruskan dari Getting Started”Jika Anda menggunakan Mengawali untuk merencanakan dashboard dan API operasi, hubungkannya dengan Menggunakan @capgo/capacitor-downloader untuk kemampuan asli dalam Menggunakan @capgo/capacitor-downloader, API Ringkasan untuk detail implementasi dalam API Ringkasan, Pendahuluan untuk detail implementasi dalam Pendahuluan, API Kunci untuk detail implementasi dalam API Kunci, dan Perangkat untuk detail implementasi dalam Perangkat.