WaterMinder
WaterMinder 是全球数百万用户信赖的领先饮水追踪应用。Protocol Launcher 允许您生成深度链接以在 WaterMinder 中记录饮水量、咖啡因和其他饮料摄入。
使用方式
有两种使用此库的方式:
- 按需导入(On-Demand):从子路径导入支持 tree-shaking,保持较小的打包体积。
- 完整导入(Full Import):从根包导入更方便,但会包含所有应用模块。
生产构建建议选择按需导入;快速脚本或演示可以使用完整导入。
选择安装方式
按需加载
推荐使用。生产环境优化。
全量导入
使用便捷。适合快速脚本。
打开应用
ts
import { open } from 'protocol-launcher/waterminder'
const url = open()添加饮水
ts
import { addWater } from 'protocol-launcher/waterminder'
const url = addWater({
amount: 250,
})添加饮水(带时间)
ts
import { addWater } from 'protocol-launcher/waterminder'
const url = addWater({
amount: 250,
time: '22/01/2026T13:17',
})添加咖啡因
ts
import { addCaffeine } from 'protocol-launcher/waterminder'
const url = addCaffeine({
amount: 115,
})添加咖啡因(带时间)
ts
import { addCaffeine } from 'protocol-launcher/waterminder'
const url = addCaffeine({
amount: 115,
time: '09/04/2026T13:17',
})添加其他饮料
ts
import { addOther } from 'protocol-launcher/waterminder'
const url = addOther({
amount: 250,
type: 'carbonated_water',
})添加其他饮料(带时间)
ts
import { addOther } from 'protocol-launcher/waterminder'
const url = addOther({
amount: 200,
type: 'coffee',
time: '09/04/2026T13:17',
})记录杯子
ts
import { logCup } from 'protocol-launcher/waterminder'
const url = logCup({
amount: 250,
cupName: 'my mug',
})记录杯子(带时间)
ts
import { logCup } from 'protocol-launcher/waterminder'
const url = logCup({
amount: 300,
cupName: 'Morning Glass',
time: '22/01/2026T08:00',
})