Skip to content

Pleco

Pleco is the world's best Chinese dictionary app for iOS and Android. Protocol Launcher allows you to generate deep links to search words, view definitions, and import flashcards in Pleco.

Usage

There are two ways to use this library:

  • On-Demand import from subpaths enables tree-shaking and keeps bundles small.
  • Full Import from the root package is convenient but includes all app modules.

Pick On-Demand for production builds; Full Import is fine for quick scripts or demos.

Select Installation Method

On-Demand
Recommended. Optimized for production.
Full Import
Convenient. Good for quick scripts.
On-Demand
ts
import { search } from 'protocol-launcher/pleco'

const url = search({
  q: '你好',
  xSource: 'MyApp',
  xSuccess: 'myapp://success',
})

Definition

On-Demand
ts
import { definition } from 'protocol-launcher/pleco'

const url = definition({
  hw: '你好',
  py: 'ni3hao3',
  sec: 'stroke',
  xSource: 'MyApp',
  xSuccess: 'myapp://success',
})

Clipboard

On-Demand
ts
import { clipboard } from 'protocol-launcher/pleco'

const url = clipboard()

Import Flashcards

On-Demand
ts
import { importFlashcards } from 'protocol-launcher/pleco'

const url = importFlashcards({
  u: 'https://example.com/flashcards.txt',
  xSource: 'MyApp',
  xSuccess: 'myapp://success',
})