Day One
Day One 是排名第一的日记应用,用于记录生活中的重要时刻。Protocol Launcher 允许您生成深度链接以在 Day One 中创建、编辑和查看日记条目。
使用方式
有两种使用此库的方式:
- 按需导入(On-Demand):从子路径导入支持 tree-shaking,保持较小的打包体积。
- 完整导入(Full Import):从根包导入更方便,但会包含所有应用模块。
生产构建建议选择按需导入;快速脚本或演示可以使用完整导入。
选择安装方式
按需加载
推荐使用。生产环境优化。
全量导入
使用便捷。适合快速脚本。
打开应用
ts
import { open } from 'protocol-launcher/day-one'
const url = open()创建条目
ts
import { createEntry } from 'protocol-launcher/day-one'
const url = createEntry({
entry: 'Hello World',
tags: 'work, test',
})编辑条目
ts
import { editEntry } from 'protocol-launcher/day-one'
const url = editEntry({
entryId: '3415BB00651C4533B41F62544A775CCC',
})查看条目
ts
import { viewEntry } from 'protocol-launcher/day-one'
const url = viewEntry({
entryId: '22B178B33B2A4149538280F9C34102C5',
})按标签筛选
ts
import { filterByTag } from 'protocol-launcher/day-one'
const url = filterByTag({
tag: 'work',
})打开日历
ts
import { openCalendar } from 'protocol-launcher/day-one'
const url = openCalendar()打开每日提示
ts
import { openDailyPrompt } from 'protocol-launcher/day-one'
const url = openDailyPrompt({
promptId: 'ck7zw8sybj6kv09983znvrmof',
})打开日期
ts
import { openDate } from 'protocol-launcher/day-one'
const url = openDate({
date: '2020-04-02',
})打开历史上的今天
ts
import { openOnThisDay } from 'protocol-launcher/day-one'
const url = openOnThisDay()打开设置
ts
import { openSettings } from 'protocol-launcher/day-one'
const url = openSettings()打开星标条目
ts
import { openStarred } from 'protocol-launcher/day-one'
const url = openStarred()打开时间线
ts
import { openTimeline } from 'protocol-launcher/day-one'
const url = openTimeline()