@allior/wmake-streamelements-events 0.0.6 → 0.0.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (65) hide show
  1. package/package.json +4 -4
  2. package/dist/react/hooks/index.d.ts +0 -4
  3. package/dist/react/hooks/index.d.ts.map +0 -1
  4. package/dist/react/hooks/use-event-listener.d.ts +0 -4
  5. package/dist/react/hooks/use-event-listener.d.ts.map +0 -1
  6. package/dist/react/hooks/use-on-event-received.d.ts +0 -44
  7. package/dist/react/hooks/use-on-event-received.d.ts.map +0 -1
  8. package/dist/react/hooks/use-on-widget-load.d.ts +0 -4
  9. package/dist/react/hooks/use-on-widget-load.d.ts.map +0 -1
  10. package/dist/react/index.d.ts +0 -4
  11. package/dist/react/index.d.ts.map +0 -1
  12. package/dist/react/types/index.d.ts +0 -2
  13. package/dist/react/types/index.d.ts.map +0 -1
  14. package/dist/react/types/window-events.d.ts +0 -3
  15. package/dist/react/types/window-events.d.ts.map +0 -1
  16. package/dist/root/aggregate.d.ts +0 -12
  17. package/dist/root/aggregate.d.ts.map +0 -1
  18. package/dist/root/classifier.d.ts +0 -9
  19. package/dist/root/classifier.d.ts.map +0 -1
  20. package/dist/root/commands.d.ts +0 -9
  21. package/dist/root/commands.d.ts.map +0 -1
  22. package/dist/root/data/event-detail.d.ts +0 -10
  23. package/dist/root/data/event-detail.d.ts.map +0 -1
  24. package/dist/root/data/field-value.d.ts +0 -3
  25. package/dist/root/data/field-value.d.ts.map +0 -1
  26. package/dist/root/data/index.d.ts +0 -3
  27. package/dist/root/data/index.d.ts.map +0 -1
  28. package/dist/root/data/widget-load.d.ts +0 -5
  29. package/dist/root/data/widget-load.d.ts.map +0 -1
  30. package/dist/root/index.d.ts +0 -11
  31. package/dist/root/index.d.ts.map +0 -1
  32. package/dist/root/keys.d.ts +0 -6
  33. package/dist/root/keys.d.ts.map +0 -1
  34. package/dist/root/message/event.d.ts +0 -7
  35. package/dist/root/message/event.d.ts.map +0 -1
  36. package/dist/root/message/index.d.ts +0 -5
  37. package/dist/root/message/index.d.ts.map +0 -1
  38. package/dist/root/message/message.d.ts +0 -37
  39. package/dist/root/message/message.d.ts.map +0 -1
  40. package/dist/root/message/roles.d.ts +0 -4
  41. package/dist/root/message/roles.d.ts.map +0 -1
  42. package/dist/root/message/tags.d.ts +0 -69
  43. package/dist/root/message/tags.d.ts.map +0 -1
  44. package/dist/root/queue/alert-queue.d.ts +0 -11
  45. package/dist/root/queue/alert-queue.d.ts.map +0 -1
  46. package/dist/root/queue/index.d.ts +0 -3
  47. package/dist/root/queue/index.d.ts.map +0 -1
  48. package/dist/root/queue/next-alert-callback.d.ts +0 -4
  49. package/dist/root/queue/next-alert-callback.d.ts.map +0 -1
  50. package/dist/root/sources/alerts.d.ts +0 -162
  51. package/dist/root/sources/alerts.d.ts.map +0 -1
  52. package/dist/root/sources/index.d.ts +0 -5
  53. package/dist/root/sources/index.d.ts.map +0 -1
  54. package/dist/root/sources/messages.d.ts +0 -963
  55. package/dist/root/sources/messages.d.ts.map +0 -1
  56. package/dist/root/sources/on-widget-load-detail.d.ts +0 -542
  57. package/dist/root/sources/on-widget-load-detail.d.ts.map +0 -1
  58. package/dist/root/types/index.d.ts +0 -3
  59. package/dist/root/types/index.d.ts.map +0 -1
  60. package/dist/root/types/on-event-received.d.ts +0 -196
  61. package/dist/root/types/on-event-received.d.ts.map +0 -1
  62. package/dist/root/types/on-widget-load.d.ts +0 -135
  63. package/dist/root/types/on-widget-load.d.ts.map +0 -1
  64. package/dist/root/window-event-map.d.ts +0 -10
  65. package/dist/root/window-event-map.d.ts.map +0 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@allior/wmake-streamelements-events",
3
- "version": "0.0.6",
3
+ "version": "0.0.8",
4
4
  "description": "Twitch/StreamElements subscription event normalizer for widgets (alerts).",
5
5
  "type": "module",
6
6
  "types": "./dist/root/index.d.ts",
@@ -23,10 +23,10 @@
23
23
  ],
24
24
  "scripts": {
25
25
  "pub": "npm publish --access public",
26
- "build": "rimraf dist && vite build && cross-env VITE_IIFE_ENTRY=root vite build --config vite.iife.config.ts && cross-env VITE_IIFE_ENTRY=react vite build --config vite.iife.config.ts && tsc -p tsconfig.types.json",
27
- "build:iife": "cross-env VITE_IIFE_ENTRY=root vite build --config vite.iife.config.ts && cross-env VITE_IIFE_ENTRY=react vite build --config vite.iife.config.ts",
26
+ "build": "bun -e \"import fs from 'node:fs'; try { fs.rmSync('dist', { recursive: true, force: true }); } catch {}\" && bun ../node_modules/vite/bin/vite.js build && bun ../node_modules/cross-env/dist/bin/cross-env.js VITE_IIFE_ENTRY=root bun ../node_modules/vite/bin/vite.js build --config vite.iife.config.ts && bun ../node_modules/cross-env/dist/bin/cross-env.js VITE_IIFE_ENTRY=react bun ../node_modules/vite/bin/vite.js build --config vite.iife.config.ts",
27
+ "build:iife": "bun ../node_modules/cross-env/dist/bin/cross-env.js VITE_IIFE_ENTRY=root bun ../node_modules/vite/bin/vite.js build --config vite.iife.config.ts && bun ../node_modules/cross-env/dist/bin/cross-env.js VITE_IIFE_ENTRY=react bun ../node_modules/vite/bin/vite.js build --config vite.iife.config.ts",
28
28
  "clean": "rimraf dist",
29
- "prepublishOnly": "pnpm run build"
29
+ "prepublishOnly": "bun run build"
30
30
  },
31
31
  "keywords": [
32
32
  "wmake",
@@ -1,4 +0,0 @@
1
- export * from "./use-event-listener.js";
2
- export * from "./use-on-event-received.js";
3
- export * from "./use-on-widget-load.js";
4
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/react/hooks/index.ts"],"names":[],"mappings":"AAAA,cAAc,yBAAyB,CAAC;AACxC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,yBAAyB,CAAC"}
@@ -1,4 +0,0 @@
1
- import { type DependencyList } from "react";
2
- import type { WindowEventKey, WindowEventListener } from "../types/window-events.js";
3
- export declare function useEventListener<K extends WindowEventKey>(eventName: K, handler: WindowEventListener<K>, deps?: DependencyList): void;
4
- //# sourceMappingURL=use-event-listener.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"use-event-listener.d.ts","sourceRoot":"","sources":["../../../src/react/hooks/use-event-listener.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,cAAc,EAAqB,MAAM,OAAO,CAAC;AAC/D,OAAO,KAAK,EAAE,cAAc,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAErF,wBAAgB,gBAAgB,CAAC,CAAC,SAAS,cAAc,EACvD,SAAS,EAAE,CAAC,EACZ,OAAO,EAAE,mBAAmB,CAAC,CAAC,CAAC,EAC/B,IAAI,GAAE,cAAmB,GACxB,IAAI,CASN"}
@@ -1,44 +0,0 @@
1
- import type { DependencyList } from "react";
2
- import type { WindowEventListener } from "../types/window-events";
3
- import type { CheerDetail, CommunityGiftPurchaseDetail, DonationDetail, FollowerDetail, RaidDetail, SubscriberDetail, SubscriberLatestDetail } from "@/root/types/on-event-received";
4
- import type { WidgetButtonDetail } from "@/root/data/event-detail";
5
- import type { MessageEvent } from "@/root/message";
6
- /** Проверка, что detail — сообщение чата (listener "message"). */
7
- export declare function isMessageEvent(d: unknown): d is MessageEvent;
8
- /** Проверка, что detail — FollowerDetail (follower-latest). */
9
- export declare function isFollowerDetail(d: unknown): d is FollowerDetail;
10
- /** Проверка, что detail — CommunityGiftPurchaseDetail. */
11
- export declare function isCommunityGiftPurchaseDetail(d: unknown): d is CommunityGiftPurchaseDetail;
12
- /** Проверка, что detail — SubscriberLatestDetail. */
13
- export declare function isSubscriberLatestDetail(d: unknown): d is SubscriberLatestDetail;
14
- /** Проверка, что detail — SubscriberDetail (event type subscriber). */
15
- export declare function isSubscriberDetail(d: unknown): d is SubscriberDetail;
16
- /** Проверка, что detail — CheerDetail. */
17
- export declare function isCheerDetail(d: unknown): d is CheerDetail;
18
- /** Проверка, что detail — RaidDetail. */
19
- export declare function isRaidDetail(d: unknown): d is RaidDetail;
20
- /** Проверка, что detail — DonationDetail. */
21
- export declare function isDonationDetail(d: unknown): d is DonationDetail;
22
- /** Проверка, что detail — WidgetButtonDetail (event:test, widget-button). */
23
- export declare function isWidgetButtonDetail(d: unknown): d is WidgetButtonDetail;
24
- /** Общий хук на любое событие onEventReceived. */
25
- export declare function useOnEventReceived(handler: WindowEventListener<"onEventReceived">, deps?: DependencyList): void;
26
- /** Хук на сообщение чата (listener "message"). */
27
- export declare function useOnMessageReceived(handler: (ev: CustomEvent<MessageEvent>) => void, deps?: DependencyList): void;
28
- /** Хук на нажатие кнопки виджета (event:test, widget-button). В detail.event.field — имя поля кнопки. */
29
- export declare function useOnWidgetButtonReceived(handler: (ev: CustomEvent<WidgetButtonDetail>) => void, deps?: DependencyList): void;
30
- /** Хук на алерт follower-latest. */
31
- export declare function useOnFollowerReceived(handler: (ev: CustomEvent<FollowerDetail>) => void, deps?: DependencyList): void;
32
- /** Хук на алерт communityGiftPurchase. */
33
- export declare function useOnCommunityGiftPurchaseReceived(handler: (ev: CustomEvent<CommunityGiftPurchaseDetail>) => void, deps?: DependencyList): void;
34
- /** Хук на алерт subscriber-latest. */
35
- export declare function useOnSubscriberLatestReceived(handler: (ev: CustomEvent<SubscriberLatestDetail>) => void, deps?: DependencyList): void;
36
- /** Хук на алерт subscriber (self / подарок / продление). */
37
- export declare function useOnSubscriberReceived(handler: (ev: CustomEvent<SubscriberDetail>) => void, deps?: DependencyList): void;
38
- /** Хук на алерт cheer-latest (биты). */
39
- export declare function useOnCheerReceived(handler: (ev: CustomEvent<CheerDetail>) => void, deps?: DependencyList): void;
40
- /** Хук на алерт raid-latest. */
41
- export declare function useOnRaidReceived(handler: (ev: CustomEvent<RaidDetail>) => void, deps?: DependencyList): void;
42
- /** Хук на алерт donation. */
43
- export declare function useOnDonationReceived(handler: (ev: CustomEvent<DonationDetail>) => void, deps?: DependencyList): void;
44
- //# sourceMappingURL=use-on-event-received.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"use-on-event-received.d.ts","sourceRoot":"","sources":["../../../src/react/hooks/use-on-event-received.ts"],"names":[],"mappings":"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"}
@@ -1,4 +0,0 @@
1
- import type { DependencyList } from "react";
2
- import type { OnWidgetLoadEventDetails } from "@/root/types/on-widget-load";
3
- export declare function useOnWidgetLoad(handler: (ev: CustomEvent<OnWidgetLoadEventDetails>) => void, deps?: DependencyList): void;
4
- //# sourceMappingURL=use-on-widget-load.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"use-on-widget-load.d.ts","sourceRoot":"","sources":["../../../src/react/hooks/use-on-widget-load.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAE5C,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,6BAA6B,CAAC;AAG5E,wBAAgB,eAAe,CAC7B,OAAO,EAAE,CAAC,EAAE,EAAE,WAAW,CAAC,wBAAwB,CAAC,KAAK,IAAI,EAC5D,IAAI,GAAE,cAAmB,GACxB,IAAI,CAMN"}
@@ -1,4 +0,0 @@
1
- export * from "../root";
2
- export * from "./hooks";
3
- export * from "./types";
4
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/react/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC"}
@@ -1,2 +0,0 @@
1
- export * from "./window-events";
2
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/react/types/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC"}
@@ -1,3 +0,0 @@
1
- export type WindowEventKey = keyof WindowEventMap;
2
- export type WindowEventListener<K extends WindowEventKey> = (this: Window, ev: WindowEventMap[K]) => unknown;
3
- //# sourceMappingURL=window-events.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"window-events.d.ts","sourceRoot":"","sources":["../../../src/react/types/window-events.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,cAAc,GAAG,MAAM,cAAc,CAAC;AAElD,MAAM,MAAM,mBAAmB,CAAC,CAAC,SAAS,cAAc,IAAI,CAC1D,IAAI,EAAE,MAAM,EACZ,EAAE,EAAE,cAAc,CAAC,CAAC,CAAC,KAClB,OAAO,CAAC"}
@@ -1,12 +0,0 @@
1
- /**
2
- * Event normalizer — aggregate mode: buffer events by activityGroup,
3
- * merge into one normalized event per action (timeout 2.5s).
4
- */
5
- import type { IncomingDetail, NormalizerOptions, ClassifiedEvent } from "./types/on-event-received.js";
6
- /**
7
- * Normalizes an incoming subscription event (StreamElements/Twitch).
8
- * Buffers community-gift recipients by activityGroup, then emits one normalized event per group.
9
- * For self-sub, solo-sub, sub-renewal emits immediately (with optional cache dedup).
10
- */
11
- export declare function normalizeIncomingEvent(detail: IncomingDetail, options: NormalizerOptions | undefined, onNormalized: (event: ClassifiedEvent | null) => void): void;
12
- //# sourceMappingURL=aggregate.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"aggregate.d.ts","sourceRoot":"","sources":["../../src/root/aggregate.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,KAAK,EACV,cAAc,EACd,iBAAiB,EAEjB,eAAe,EAGhB,MAAM,8BAA8B,CAAC;AAuHtC;;;;GAIG;AACH,wBAAgB,sBAAsB,CACpC,MAAM,EAAE,cAAc,EACtB,OAAO,EAAE,iBAAiB,GAAG,SAAS,EACtC,YAAY,EAAE,CAAC,KAAK,EAAE,eAAe,GAAG,IAAI,KAAK,IAAI,GACpD,IAAI,CAmHN"}
@@ -1,9 +0,0 @@
1
- /**
2
- * Shared classification and tier parsing for Twitch/StreamElements subscription events.
3
- * Used by aggregate normalizer.
4
- */
5
- import type { IncomingDetail, TierInfo, ClassifiedEvent } from "./types/on-event-received.js";
6
- export declare function parseTier(raw: string | number | null | undefined): TierInfo;
7
- export declare function getCacheKey(detail: IncomingDetail): string;
8
- export declare function classifyEvent(detail: IncomingDetail): ClassifiedEvent | null;
9
- //# sourceMappingURL=classifier.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"classifier.d.ts","sourceRoot":"","sources":["../../src/root/classifier.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EACV,cAAc,EACd,QAAQ,EACR,eAAe,EAChB,MAAM,8BAA8B,CAAC;AAEtC,wBAAgB,SAAS,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,GAAG,SAAS,GAAG,QAAQ,CAO3E;AAED,wBAAgB,WAAW,CAAC,MAAM,EAAE,cAAc,GAAG,MAAM,CAoB1D;AAED,wBAAgB,aAAa,CAAC,MAAM,EAAE,cAAc,GAAG,eAAe,GAAG,IAAI,CAwO5E"}
@@ -1,9 +0,0 @@
1
- /**
2
- * Отправляет тестовое сообщение по ключу: диспатчит CustomEvent onEventReceived.
3
- */
4
- export declare function testMessage(key: string): void;
5
- /**
6
- * Отправляет тестовый алерт по ключу: диспатчит CustomEvent onEventReceived.
7
- */
8
- export declare function testAlert(key: string): void;
9
- //# sourceMappingURL=commands.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"commands.d.ts","sourceRoot":"","sources":["../../src/root/commands.ts"],"names":[],"mappings":"AAQA;;GAEG;AACH,wBAAgB,WAAW,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAQ7C;AAED;;GAEG;AACH,wBAAgB,SAAS,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAQ3C"}
@@ -1,10 +0,0 @@
1
- export interface EventDetail<T = string, R = unknown> {
2
- listener: T;
3
- event: R;
4
- }
5
- export type FollowerLatestDetail = EventDetail<"follower-latest">;
6
- export type WidgetButtonDetail = EventDetail<"event:test", {
7
- listener: "widget-button";
8
- field: string;
9
- }>;
10
- //# sourceMappingURL=event-detail.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"event-detail.d.ts","sourceRoot":"","sources":["../../../src/root/data/event-detail.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,WAAW,CAAC,CAAC,GAAG,MAAM,EAAE,CAAC,GAAG,OAAO;IAClD,QAAQ,EAAE,CAAC,CAAC;IACZ,KAAK,EAAE,CAAC,CAAC;CACV;AAED,MAAM,MAAM,oBAAoB,GAAG,WAAW,CAAC,iBAAiB,CAAC,CAAC;AAElE,MAAM,MAAM,kBAAkB,GAAG,WAAW,CAC1C,YAAY,EACZ;IACE,QAAQ,EAAE,eAAe,CAAC;IAC1B,KAAK,EAAE,MAAM,CAAC;CACf,CACF,CAAC"}
@@ -1,3 +0,0 @@
1
- /** Минимальный тип для fieldData в WidgetLoadDetail (без зависимости от streamelements). */
2
- export type FieldValue = string | number | boolean | undefined | null;
3
- //# sourceMappingURL=field-value.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"field-value.d.ts","sourceRoot":"","sources":["../../../src/root/data/field-value.ts"],"names":[],"mappings":"AAAA,4FAA4F;AAC5F,MAAM,MAAM,UAAU,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,SAAS,GAAG,IAAI,CAAC"}
@@ -1,3 +0,0 @@
1
- export * from "./event-detail";
2
- export * from "./widget-load";
3
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/root/data/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,eAAe,CAAC"}
@@ -1,5 +0,0 @@
1
- import type { FieldValue } from "./field-value.js";
2
- export interface WidgetLoadDetail {
3
- fieldData: Record<string, FieldValue>;
4
- }
5
- //# sourceMappingURL=widget-load.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"widget-load.d.ts","sourceRoot":"","sources":["../../../src/root/data/widget-load.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAEnD,MAAM,WAAW,gBAAgB;IAC/B,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC;CACvC"}
@@ -1,11 +0,0 @@
1
- export * from "./classifier.js";
2
- export * from "./aggregate.js";
3
- export * from "./types";
4
- import "./window-event-map";
5
- export * from "./data";
6
- export * from "./sources/index";
7
- export * from "./commands";
8
- export * from "./keys";
9
- export * from "./message";
10
- export * from "./queue";
11
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/root/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC;AAChC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,SAAS,CAAC;AACxB,OAAO,oBAAoB,CAAC;AAC5B,cAAc,QAAQ,CAAC;AACvB,cAAc,iBAAiB,CAAC;AAChC,cAAc,YAAY,CAAC;AAC3B,cAAc,QAAQ,CAAC;AACvB,cAAc,WAAW,CAAC;AAC1B,cAAc,SAAS,CAAC"}
@@ -1,6 +0,0 @@
1
- /**
2
- * Преобразование fieldId виджета в ключ тестовых данных.
3
- */
4
- export declare function getTestMessageKey(fieldId: string): string | null;
5
- export declare function getTestAlertKey(fieldId: string): string | null;
6
- //# sourceMappingURL=keys.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"keys.d.ts","sourceRoot":"","sources":["../../src/root/keys.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAIhE;AAED,wBAAgB,eAAe,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAI9D"}
@@ -1,7 +0,0 @@
1
- import type { Message } from "./message";
2
- /** Событие сообщения чата (формат onEventReceived, listener "message"). */
3
- export interface MessageEvent {
4
- listener: "message";
5
- event: Message.Event;
6
- }
7
- //# sourceMappingURL=event.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"event.d.ts","sourceRoot":"","sources":["../../../src/root/message/event.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEzC,2EAA2E;AAC3E,MAAM,WAAW,YAAY;IAC3B,QAAQ,EAAE,SAAS,CAAC;IACpB,KAAK,EAAE,OAAO,CAAC,KAAK,CAAC;CACtB"}
@@ -1,5 +0,0 @@
1
- export * from "./event";
2
- export * from "./message";
3
- export * from "./roles";
4
- export * from "./tags";
5
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/root/message/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAA;AACvB,cAAc,WAAW,CAAA;AACzB,cAAc,SAAS,CAAA;AACvB,cAAc,QAAQ,CAAA"}
@@ -1,37 +0,0 @@
1
- import type { TwitchMessageTags } from "./tags";
2
- export declare namespace Message {
3
- interface Event {
4
- service: "twitch";
5
- data: Data;
6
- renderedText: string;
7
- }
8
- interface Data {
9
- tags: TwitchMessageTags;
10
- nick: string;
11
- userId: string;
12
- displayName: string;
13
- displayColor?: string;
14
- badges: Array<Badge>;
15
- channel: string;
16
- text: string;
17
- isAction: boolean;
18
- emotes: Array<Emote>;
19
- msgId: string;
20
- time?: number;
21
- }
22
- interface Badge {
23
- type: string;
24
- version?: string;
25
- url?: string;
26
- description?: string;
27
- }
28
- interface Emote {
29
- type: string;
30
- name: string;
31
- id: string;
32
- urls: Record<string, string>;
33
- start?: number;
34
- end?: number;
35
- }
36
- }
37
- //# sourceMappingURL=message.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"message.d.ts","sourceRoot":"","sources":["../../../src/root/message/message.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,QAAQ,CAAC;AAEhD,yBAAiB,OAAO,CAAC;IACvB,UAAiB,KAAK;QACpB,OAAO,EAAE,QAAQ,CAAC;QAClB,IAAI,EAAE,IAAI,CAAC;QACX,YAAY,EAAE,MAAM,CAAC;KACtB;IAED,UAAiB,IAAI;QACnB,IAAI,EAAE,iBAAiB,CAAC;QACxB,IAAI,EAAE,MAAM,CAAC;QACb,MAAM,EAAE,MAAM,CAAC;QACf,WAAW,EAAE,MAAM,CAAC;QACpB,YAAY,CAAC,EAAE,MAAM,CAAC;QACtB,MAAM,EAAE,KAAK,CAAC,KAAK,CAAC,CAAC;QACrB,OAAO,EAAE,MAAM,CAAC;QAChB,IAAI,EAAE,MAAM,CAAC;QACb,QAAQ,EAAE,OAAO,CAAC;QAClB,MAAM,EAAE,KAAK,CAAC,KAAK,CAAC,CAAC;QACrB,KAAK,EAAE,MAAM,CAAC;QACd,IAAI,CAAC,EAAE,MAAM,CAAC;KACf;IAED,UAAiB,KAAK;QACpB,IAAI,EAAE,MAAM,CAAC;QACb,OAAO,CAAC,EAAE,MAAM,CAAC;QACjB,GAAG,CAAC,EAAE,MAAM,CAAC;QACb,WAAW,CAAC,EAAE,MAAM,CAAC;KACtB;IAED,UAAiB,KAAK;QACpB,IAAI,EAAE,MAAM,CAAC;QACb,IAAI,EAAE,MAAM,CAAC;QACb,EAAE,EAAE,MAAM,CAAC;QACX,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;QAC7B,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,GAAG,CAAC,EAAE,MAAM,CAAC;KACd;CACF"}
@@ -1,4 +0,0 @@
1
- import { type TwitchMessageTags } from "./tags";
2
- export type UserRole = "broadcaster" | "moderator" | "vip" | "artist" | "subscriber" | "turbo" | "default";
3
- export declare function determineUserRoles(tags: TwitchMessageTags | Record<string, string>): UserRole[];
4
- //# sourceMappingURL=roles.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"roles.d.ts","sourceRoot":"","sources":["../../../src/root/message/roles.ts"],"names":[],"mappings":"AAAA,OAAO,EAOL,KAAK,iBAAiB,EACvB,MAAM,QAAQ,CAAC;AAEhB,MAAM,MAAM,QAAQ,GAChB,aAAa,GACb,WAAW,GACX,KAAK,GACL,QAAQ,GACR,YAAY,GACZ,OAAO,GACP,SAAS,CAAC;AAEd,wBAAgB,kBAAkB,CAChC,IAAI,EAAE,iBAAiB,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAC/C,QAAQ,EAAE,CAqBZ"}
@@ -1,69 +0,0 @@
1
- /**
2
- * Минимальный тип тегов Twitch (IRCParser / StreamElements)
3
- */
4
- export type TwitchMessageTags = Record<string, unknown> & {
5
- "badge-info"?: string;
6
- badges?: string;
7
- "first-msg"?: string;
8
- turbo?: string;
9
- subscriber?: string;
10
- mod?: string;
11
- vip?: string;
12
- "user-type"?: string;
13
- };
14
- /**
15
- * Бейдж пользователя (как в event.data.badges)
16
- */
17
- export interface TwitchBadge {
18
- type: string;
19
- version?: string;
20
- url?: string;
21
- description?: string;
22
- }
23
- /**
24
- * Парсит месяц подписки из badge-info.
25
- * Формат: "subscriber/<NUMBER>" — номер месяца текущей подписки.
26
- * @returns номер месяца или null, если нет/не подписчик
27
- */
28
- export declare function parseSubscriberMonth(tags: TwitchMessageTags): number | null;
29
- /**
30
- * Подписка активна, если:
31
- * - в badge-info subscriber/<NUMBER> и NUMBER !== 0, или
32
- * - в badges есть broadcaster/1 (стример всегда «активный подписчик» в своём чате).
33
- */
34
- export declare function isSubscriptionActive(tags: TwitchMessageTags): boolean;
35
- export declare const isSubscriber: typeof isSubscriptionActive;
36
- /**
37
- * Подписка активна, если:
38
- * - в badge-info subscriber/<NUMBER> и NUMBER !== 0, или
39
- * - в badges есть broadcaster/1 (стример всегда «активный подписчик» в своём чате).
40
- */
41
- export declare function isBroadcaster(tags: TwitchMessageTags): boolean;
42
- /**
43
- * Первое сообщение в чате: first-msg === "1".
44
- */
45
- export declare function isFirstMessageChatter(tags: TwitchMessageTags): boolean;
46
- /**
47
- * Twitch Turbo: turbo === "1".
48
- */
49
- export declare function isTurbo(tags: TwitchMessageTags): boolean;
50
- /**
51
- * VIP: vip === "1" или бейдж vip/1.
52
- */
53
- export declare function isVip(tags: TwitchMessageTags): boolean;
54
- /**
55
- * Модератор: mod === "1", бейдж moderator/1 или user-type === "mod".
56
- */
57
- export declare function isModerator(tags: TwitchMessageTags): boolean;
58
- /**
59
- * Artist: бейдж artist-badge/1.
60
- */
61
- export declare function isArtist(tags: TwitchMessageTags): boolean;
62
- /**
63
- * Возвращает URL бейджа по типу из массива бейджей (формат как в event.data.badges).
64
- * @param badges массив вида [{ type, version, url, description }, ...]
65
- * @param type тип бейджа (например "subscriber", "broadcaster")
66
- * @returns url бейджа или undefined
67
- */
68
- export declare function getBadgeUrlByType(badges: TwitchBadge[], type: string): string | undefined;
69
- //# sourceMappingURL=tags.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"tags.d.ts","sourceRoot":"","sources":["../../../src/root/message/tags.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,MAAM,iBAAiB,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG;IACxD,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB,CAAA;AAED;;GAEG;AACH,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED;;;;GAIG;AACH,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,iBAAiB,GAAG,MAAM,GAAG,IAAI,CAQ3E;AAED;;;;GAIG;AACH,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,iBAAiB,GAAG,OAAO,CAOrE;AAED,eAAO,MAAM,YAAY,6BAAuB,CAAC;AAEjD;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,IAAI,EAAE,iBAAiB,GAAG,OAAO,CAG9D;AAED;;GAEG;AACH,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,iBAAiB,GAAG,OAAO,CAEtE;AAED;;GAEG;AACH,wBAAgB,OAAO,CAAC,IAAI,EAAE,iBAAiB,GAAG,OAAO,CAExD;AAED;;GAEG;AACH,wBAAgB,KAAK,CAAC,IAAI,EAAE,iBAAiB,GAAG,OAAO,CAGtD;AAED;;GAEG;AACH,wBAAgB,WAAW,CAAC,IAAI,EAAE,iBAAiB,GAAG,OAAO,CAM5D;AAED;;GAEG;AACH,wBAAgB,QAAQ,CAAC,IAAI,EAAE,iBAAiB,GAAG,OAAO,CAGzD;AAED;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAC/B,MAAM,EAAE,WAAW,EAAE,EACrB,IAAI,EAAE,MAAM,GACX,MAAM,GAAG,SAAS,CAGpB"}
@@ -1,11 +0,0 @@
1
- import type { ClassifiedEvent } from "@/root";
2
- import type { NextAlertCallback } from ".";
3
- export declare class AlertQueue {
4
- private readonly queue;
5
- isShowingAlert: boolean;
6
- onNextAlert: NextAlertCallback;
7
- constructor(onNextAlert: NextAlertCallback);
8
- push(event: ClassifiedEvent): void;
9
- processNextAlert(): void;
10
- }
11
- //# sourceMappingURL=alert-queue.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"alert-queue.d.ts","sourceRoot":"","sources":["../../../src/root/queue/alert-queue.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,QAAQ,CAAC;AAC9C,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,GAAG,CAAC;AAE3C,qBAAa,UAAU;IACrB,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAyB;IACxC,cAAc,EAAE,OAAO,CAAS;IAChC,WAAW,EAAE,iBAAiB,CAAC;gBAE1B,WAAW,EAAE,iBAAiB;IAInC,IAAI,CAAC,KAAK,EAAE,eAAe;IAK3B,gBAAgB;CAUxB"}
@@ -1,3 +0,0 @@
1
- export * from "./next-alert-callback";
2
- export * from "./alert-queue";
3
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/root/queue/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAA;AACrC,cAAc,eAAe,CAAA"}
@@ -1,4 +0,0 @@
1
- import type { ClassifiedEvent } from "@/root";
2
- import type { AlertQueue } from ".";
3
- export type NextAlertCallback = (self: AlertQueue, event: ClassifiedEvent | null) => void;
4
- //# sourceMappingURL=next-alert-callback.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"next-alert-callback.d.ts","sourceRoot":"","sources":["../../../src/root/queue/next-alert-callback.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,QAAQ,CAAC;AAC9C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,GAAG,CAAC;AAEpC,MAAM,MAAM,iBAAiB,GAAG,CAAC,IAAI,EAAE,UAAU,EAAE,KAAK,EAAE,eAAe,GAAG,IAAI,KAAK,IAAI,CAAC"}
@@ -1,162 +0,0 @@
1
- export declare const testAlerts: {
2
- follower: {
3
- listener: string;
4
- event: {
5
- name: string;
6
- };
7
- };
8
- communityGiftAnonymous: {
9
- listener: string;
10
- event: {
11
- type: string;
12
- provider: string;
13
- channel: string;
14
- activityGroup: string;
15
- data: {
16
- amount: number;
17
- username: string;
18
- displayName: string;
19
- tier: string;
20
- sender: string;
21
- };
22
- _id: string;
23
- activityId: string;
24
- };
25
- };
26
- communityGift: {
27
- listener: string;
28
- event: {
29
- type: string;
30
- provider: string;
31
- channel: string;
32
- activityGroup: string;
33
- data: {
34
- amount: number;
35
- username: string;
36
- displayName: string;
37
- tier: string;
38
- sender: string;
39
- };
40
- _id: string;
41
- activityId: string;
42
- };
43
- };
44
- sub: {
45
- listener: string;
46
- event: {
47
- name: string;
48
- amount: number;
49
- };
50
- };
51
- selfSub: {
52
- listener: string;
53
- event: {
54
- type: string;
55
- provider: string;
56
- channel: string;
57
- data: {
58
- amount: number;
59
- username: string;
60
- displayName: string;
61
- tier: string;
62
- };
63
- _id: string;
64
- activityId: string;
65
- };
66
- };
67
- soloSubToSomeone: {
68
- listener: string;
69
- event: {
70
- type: string;
71
- provider: string;
72
- channel: string;
73
- data: {
74
- amount: number;
75
- username: string;
76
- displayName: string;
77
- message: string;
78
- tier: string;
79
- sender: string;
80
- gifted: boolean;
81
- };
82
- _id: string;
83
- activityId: string;
84
- };
85
- };
86
- subRenewal: {
87
- listener: string;
88
- event: {
89
- type: string;
90
- provider: string;
91
- channel: string;
92
- data: {
93
- amount: number;
94
- username: string;
95
- displayName: string;
96
- tier: string;
97
- };
98
- _id: string;
99
- activityId: string;
100
- };
101
- };
102
- bits: {
103
- listener: string;
104
- event: {
105
- name: string;
106
- amount: number;
107
- };
108
- };
109
- raid: {
110
- listener: string;
111
- event: {
112
- name: string;
113
- amount: number;
114
- };
115
- };
116
- donationShortText: {
117
- listener: string;
118
- event: {
119
- data: {
120
- alert_type: string;
121
- currency: string;
122
- billing_system: string;
123
- id: number;
124
- amount_main: number;
125
- amount: number;
126
- username: string;
127
- message: string;
128
- };
129
- };
130
- };
131
- donationLongText: {
132
- listener: string;
133
- event: {
134
- data: {
135
- alert_type: string;
136
- currency: string;
137
- billing_system: string;
138
- id: number;
139
- amount_main: number;
140
- amount: number;
141
- username: string;
142
- message: string;
143
- };
144
- };
145
- };
146
- donation: {
147
- listener: string;
148
- event: {
149
- data: {
150
- alert_type: string;
151
- currency: string;
152
- billing_system: string;
153
- id: number;
154
- amount_main: number;
155
- amount: number;
156
- username: string;
157
- message: string;
158
- };
159
- };
160
- };
161
- };
162
- //# sourceMappingURL=alerts.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"alerts.d.ts","sourceRoot":"","sources":["../../../src/root/sources/alerts.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAkKtB,CAAC"}
@@ -1,5 +0,0 @@
1
- import testOnWidgetLoadDetail from "./on-widget-load-detail.js";
2
- export * from "./alerts.js";
3
- export * from "./messages.js";
4
- export { testOnWidgetLoadDetail };
5
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/root/sources/index.ts"],"names":[],"mappings":"AAAA,OAAO,sBAAsB,MAAM,4BAA4B,CAAC;AAEhE,cAAc,aAAa,CAAC;AAC5B,cAAc,eAAe,CAAC;AAC9B,OAAO,EAAE,sBAAsB,EAAE,CAAC"}