Skip to content

MultiTimer

MultiTimer 是一款适用于 iPhone、iPad、Mac、Apple Watch 和 Apple Vision 的多功能计时器应用。Protocol Launcher 允许您生成深度链接以在 MultiTimer 中启动、停止、暂停和恢复计时器。

使用方式

有两种使用此库的方式:

  • 按需导入(On-Demand):从子路径导入支持 tree-shaking,保持较小的打包体积。
  • 完整导入(Full Import):从根包导入更方便,但会包含所有应用模块。

生产构建建议选择按需导入;快速脚本或演示可以使用完整导入。

选择安装方式

按需加载
推荐使用。生产环境优化。
全量导入
使用便捷。适合快速脚本。

启动计时器

On-Demand
ts
import { startTimer } from 'protocol-launcher/multi-timer'

const url = startTimer({
  name: 'Lunch',
})

在指定面板上启动计时器

On-Demand
ts
import { startTimer } from 'protocol-launcher/multi-timer'

const url = startTimer({
  name: 'Lunch',
  board: 'Work',
})

停止计时器

On-Demand
ts
import { stopTimer } from 'protocol-launcher/multi-timer'

const url = stopTimer({
  name: 'Lunch',
})

暂停计时器

On-Demand
ts
import { pauseTimer } from 'protocol-launcher/multi-timer'

const url = pauseTimer({
  name: 'Lunch',
})

恢复计时器

On-Demand
ts
import { resumeTimer } from 'protocol-launcher/multi-timer'

const url = resumeTimer({
  name: 'Lunch',
})