Pushcut
Pushcut 是一款自动化应用。Protocol Launcher 可以生成官方 Pushcut URL scheme 链接,用于打开 Pushcut 及其文档列出的视图。
Pushcut 官方 URL scheme 以 pushcut:// 开头。文档列出的打开形式是 pushcut://open/ 后接视图名:notifications、triggers、widgets、server、account、runServer、monitorServer 或 notificationsLog。
使用方式
有两种使用此库的方式:
- 按需导入(On-Demand):从子路径导入支持 tree-shaking,保持较小的打包体积。
- 完整导入(Full Import):从根包导入更方便,但会包含所有应用模块。
生产构建建议选择按需导入;快速脚本或演示可以使用完整导入。
选择安装方式
按需加载
推荐使用。生产环境优化。
全量导入
使用便捷。适合快速脚本。
打开 Pushcut
ts
import { open } from 'protocol-launcher/pushcut'
const url = open()打开视图
ts
import { openView } from 'protocol-launcher/pushcut'
const url = openView({
view: 'notifications',
})打开 Notifications
ts
import { openNotifications } from 'protocol-launcher/pushcut'
const url = openNotifications()打开 Triggers
ts
import { openTriggers } from 'protocol-launcher/pushcut'
const url = openTriggers()打开 Widgets
ts
import { openWidgets } from 'protocol-launcher/pushcut'
const url = openWidgets()打开 Server
ts
import { openServer } from 'protocol-launcher/pushcut'
const url = openServer()打开 Account
ts
import { openAccount } from 'protocol-launcher/pushcut'
const url = openAccount()Run Server
ts
import { runServer } from 'protocol-launcher/pushcut'
const url = runServer()Monitor Server
ts
import { monitorServer } from 'protocol-launcher/pushcut'
const url = monitorServer()打开 Notifications Log
ts
import { openNotificationsLog } from 'protocol-launcher/pushcut'
const url = openNotificationsLog()