当前位置: 首页>>代码示例>>TypeScript>>正文


TypeScript chomex.Router类代码示例

本文整理汇总了TypeScript中chomex.Router的典型用法代码示例。如果您正苦于以下问题:TypeScript Router类的具体用法?TypeScript Router怎么用?TypeScript Router使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了Router类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。

示例1: listener

 public listener(): (message: any) => any {
   const router = new Router();
   router.on("/snapshot/prepare", (m) => this.snapshot.prepare(m));
   router.on("/snapshot/show", (m) => this.snapshot.show(m));
   router.on("/snapshot/remove", () => this.snapshot.remove());
   return router.listener();
 }
开发者ID:otiai10,项目名称:kanColleWidget,代码行数:7,代码来源:Kcs2.ts

示例2: Router

import { Router } from "chomex";
import NotificationService from "../../../Services/Notification";

const resolver = (id: string) => {
  const [name, query] = id.split("?");
  return {name};
};

const router = new Router(resolver);

router.on("Mission", async (id) => {
  const ns = new NotificationService();
  await ns.clear(id);
});

router.on("Recovery", async (id) => {
  const ns = new NotificationService();
  await ns.clear(id);
});

router.on("Shipbuilding", async (id) => {
  const ns = new NotificationService();
  await ns.clear(id);
});

export default router.listener();
开发者ID:otiai10,项目名称:kanColleWidget,代码行数:26,代码来源:NotificationClick.ts

示例3: Router

  DamageSnapshotRecord,
} from "../Controllers/Message/DamageSnapshot";
import {
  DebugAvailables,
  DebugController,
} from "../Controllers/Message/Debug";
import {
  OpenDeckCapturePage,
  OpenOptionsPage,
  WindowDecoration,
  WindowOpen,
  WindowRecord,
  WindowToggleMute,
} from "../Controllers/Message/Window";

const router = new Router();
router.on("/window/open", WindowOpen);
router.on("/window/decoration", WindowDecoration);
router.on("/window/record", WindowRecord);
router.on("/window/toggle-mute", WindowToggleMute);

// 設定画面
router.on("/options/open", OpenOptionsPage);

// 編成キャプチャ
router.on("/deckcapture/open", OpenDeckCapturePage);

// スクショとか
router.on("/capture/screenshot", Screenshot);

// 大破進撃防止窓
开发者ID:otiai10,项目名称:kanColleWidget,代码行数:31,代码来源:Message.ts

示例4: URLSearchParams

import { Router } from "chomex";
import { Screenshot } from "../Controllers/Alarms";

const resolver = (alarm) => {
  const [name, query] = alarm.name.split("?");
  alarm.params = new URLSearchParams(query);
  return {name};
};

const router = new Router(resolver);

router.on("/screenshot", Screenshot);

export default router.listener();
开发者ID:otiai10,项目名称:kanColleWidget,代码行数:14,代码来源:Alarms.ts


注:本文中的chomex.Router类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。