Todoist
Todoist 是一款待办事项和任务管理应用程序。Protocol Launcher 允许您生成深度链接以在 Todoist 中打开视图和添加任务。
使用方式
有两种使用此库的方式:
- 按需导入(On-Demand):从子路径导入支持 tree-shaking,保持较小的打包体积。
- 完整导入(Full Import):从根包导入更方便,但会包含所有应用模块。
生产构建建议选择按需导入;快速脚本或演示可以使用完整导入。
选择安装方式
按需加载
推荐使用。生产环境优化。
全量导入
使用便捷。适合快速脚本。
打开应用
ts
import { open } from 'protocol-launcher/todoist'
const url = open()添加任务
向 Todoist 添加任务(仅限移动端)。这会打开并预填表单,但不会自动提交。
ts
import { addTask } from 'protocol-launcher/todoist'
const url = addTask({
content: 'Buy Milk',
date: 'Tomorrow @ 14:00',
priority: 4,
})打开快速添加
打开全局快速添加面板(仅限桌面端,9.2.0+)。这会打开并预填面板,但不会自动提交。
ts
import { openQuickAdd } from 'protocol-launcher/todoist'
const url = openQuickAdd({
content: 'My Task',
description: 'This is a description',
})搜索
在 Todoist 中搜索(Android 移动端和桌面端 9.10.0+)。
ts
import { search } from 'protocol-launcher/todoist'
const url = search({
query: 'Test & Today',
})打开收件箱
打开 Todoist 的收件箱视图。
ts
import { openInbox } from 'protocol-launcher/todoist'
const url = openInbox()打开今天
打开 Todoist 的今天视图。
ts
import { openToday } from 'protocol-launcher/todoist'
const url = openToday()打开即将到期
打开 Todoist 的即将到期视图。
ts
import { openUpcoming } from 'protocol-launcher/todoist'
const url = openUpcoming()打开项目
通过 ID 打开特定项目。
ts
import { openProject } from 'protocol-launcher/todoist'
const url = openProject({
id: '128501470',
})打开项目列表
打开项目列表视图。在桌面端,您可以选择按工作区 ID 过滤。
ts
import { openProjects } from 'protocol-launcher/todoist'
const url = openProjects({
workspaceId: '1234',
})打开标签
打开特定标签。在移动端使用标签名称,在桌面端使用标签 ID。
ts
import { openLabel } from 'protocol-launcher/todoist'
const url = openLabel({
name: 'Urgent',
})打开标签列表
打开标签列表视图(仅限移动端)。
ts
import { openLabels } from 'protocol-launcher/todoist'
const url = openLabels()打开过滤器
通过 ID 打开特定过滤器。
ts
import { openFilter } from 'protocol-launcher/todoist'
const url = openFilter({
id: '9',
})打开过滤器列表
打开过滤器列表视图(仅限移动端)。
ts
import { openFilters } from 'protocol-launcher/todoist'
const url = openFilters()打开过滤器和标签
打开过滤器和标签视图(仅限桌面端)。
ts
import { openFiltersLabels } from 'protocol-launcher/todoist'
const url = openFiltersLabels()打开任务
通过 ID 打开特定任务。
ts
import { openTask } from 'protocol-launcher/todoist'
const url = openTask({
id: '12345',
})打开团队收件箱
打开团队收件箱视图(仅限移动端,企业账户)。非企业账户将被重定向到普通收件箱。
ts
import { openTeaminbox } from 'protocol-launcher/todoist'
const url = openTeaminbox()打开模板
打开模板视图(仅限桌面端)。您可以选择通过 ID 打开特定模板。
ts
import { openTemplates } from 'protocol-launcher/todoist'
const url = openTemplates({
id: '123',
})打开通知
打开 Todoist 的通知视图。
ts
import { openNotifications } from 'protocol-launcher/todoist'
const url = openNotifications()打开个人资料
打开个人资料视图(仅限移动端)。
ts
import { openProfile } from 'protocol-launcher/todoist'
const url = openProfile()