diff --git a/src/lib/notifications/notificationTypes.js b/src/lib/notifications/notificationTypes.js deleted file mode 100644 index 399eab045e4ede0eaac44bf2e1610175c97410c9..0000000000000000000000000000000000000000 --- a/src/lib/notifications/notificationTypes.js +++ /dev/null @@ -1,19 +0,0 @@ -/** @type {{ - * BUY: import("./types").NotificationType<"buy">, - * REFUND: import("./types").NotificationType<"refund">, - * DEPOSIT: import("./types").NotificationType<"deposit">, - * WITHDRAW: import("./types").NotificationType<"withdraw">, - * USE_VOUCHER: import("./types").NotificationType<"use-voucher">, - * SEND_TRANSFER: import("./types").NotificationType<"send-transfer">, - * RECEIVE_TRANSFER: import("./types").NotificationType<"receive-transfer">, - * }} - */ -export const NotificationType = { - BUY: {key: 1<<0, name: "buy"}, - REFUND: {key: 1<<1, name: "refund"}, - DEPOSIT: {key: 1<<2, name: "deposit"}, - WITHDRAW: {key: 1<<3, name: "withdraw"}, - USE_VOUCHER: {key: 1<<4, name: "use-voucher"}, - SEND_TRANSFER: {key: 1<<5, name: "send-transfer"}, - RECEIVE_TRANSFER: {key: 1<<6, name: "receive-transfer"}, -}; diff --git a/src/lib/notifications/notificationTypes.ts b/src/lib/notifications/notificationTypes.ts new file mode 100644 index 0000000000000000000000000000000000000000..56d95d95fc9ac8acea0cf938c7753998a7be799e --- /dev/null +++ b/src/lib/notifications/notificationTypes.ts @@ -0,0 +1,11 @@ +import type { NotificationType as Type } from "./types"; + +export const NotificationType = { + BUY: {key: 1<<0, name: "buy"} as Type<"buy">, + REFUND: {key: 1<<1, name: "refund"} as Type<"refund">, + DEPOSIT: {key: 1<<2, name: "deposit"} as Type<"deposit">, + WITHDRAW: {key: 1<<3, name: "withdraw"} as Type<"withdraw">, + USE_VOUCHER: {key: 1<<4, name: "use-voucher"} as Type<"use-voucher">, + SEND_TRANSFER: {key: 1<<5, name: "send-transfer"} as Type<"send-transfer">, + RECEIVE_TRANSFER: {key: 1<<6, name: "receive-transfer"} as Type<"receive-transfer">, +}; diff --git a/src/lib/server/notifications/channelTypes.js b/src/lib/server/notifications/channelTypes.ts similarity index 58% rename from src/lib/server/notifications/channelTypes.js rename to src/lib/server/notifications/channelTypes.ts index 90df94fb79db659ecbae1d614f1a75bf531d13d2..4b6c9bf304906f5ae39e50b751ede84f588760f7 100644 --- a/src/lib/server/notifications/channelTypes.js +++ b/src/lib/server/notifications/channelTypes.ts @@ -1,12 +1,6 @@ import { handleWebhook } from "./webhookHandler"; import { handleEmail } from "./emailHandler"; -/** - * @type {{ - * WEBHOOK: import("../../notifications/types").ChannelType<?>, - * EMAIL: import("../../notifications/types").ChannelType<?> - * }} - */ export const ChannelType = { WEBHOOK: {key: 1<<0, handler: handleWebhook}, EMAIL: {key: 1<<1, handler: handleEmail},