@crowbartools/firebot-types 5.67.0-alpha11 → 5.67.0-alpha13

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 (83) hide show
  1. package/backend/events/filters/builtin/firebot/index.d.ts +1 -1
  2. package/backend/events/filters/builtin/firebot/new-currency-amount.d.ts +1 -1
  3. package/backend/events/filters/builtin/firebot/new-view-time.d.ts +1 -1
  4. package/backend/events/filters/builtin/firebot/previous-currency-amount.d.ts +1 -1
  5. package/backend/events/filters/builtin/firebot/previous-view-time.d.ts +1 -1
  6. package/backend/events/filters/builtin/index.d.ts +1 -1
  7. package/backend/events/filters/builtin/third-party/donation-amount.d.ts +1 -1
  8. package/backend/events/filters/builtin/third-party/index.d.ts +1 -1
  9. package/backend/events/filters/builtin/twitch/bits-badge-tier.d.ts +1 -1
  10. package/backend/events/filters/builtin/twitch/chat-mode-duration.d.ts +1 -1
  11. package/backend/events/filters/builtin/twitch/cheer-bits-amount.d.ts +1 -1
  12. package/backend/events/filters/builtin/twitch/gift-count.d.ts +1 -1
  13. package/backend/events/filters/builtin/twitch/gift-duration.d.ts +1 -1
  14. package/backend/events/filters/builtin/twitch/index.d.ts +1 -1
  15. package/backend/events/filters/builtin/twitch/lifetime-gift-count.d.ts +1 -1
  16. package/backend/events/filters/builtin/twitch/raid-viewer-count.d.ts +1 -1
  17. package/backend/events/filters/builtin/twitch/sub-months.d.ts +1 -1
  18. package/backend/events/filters/builtin/twitch/watch-streak-count.d.ts +1 -1
  19. package/backend/integrations/builtin/streamloots/filters/chest-quantity.d.ts +1 -1
  20. package/backend/overlay-widgets/overlay-widgets-manager.d.ts +1 -1
  21. package/backend/ranks/rank-ladder-helper.d.ts +1 -1
  22. package/backend/restrictions/builtin/index.d.ts +1 -1
  23. package/backend/scripts/script-api/namespaces/http-server.d.ts +2 -0
  24. package/index.d.ts +1 -1
  25. package/package.json +1 -1
  26. package/types/accounts.d.ts +1 -2
  27. package/types/auth.d.ts +1 -10
  28. package/types/channel-rewards.d.ts +1 -5
  29. package/types/chat.d.ts +9 -31
  30. package/types/commands.d.ts +11 -31
  31. package/types/counters.d.ts +1 -2
  32. package/types/currency.d.ts +1 -3
  33. package/types/discord.d.ts +0 -1
  34. package/types/effects.d.ts +9 -42
  35. package/types/events.d.ts +3 -36
  36. package/types/expressionish.d.ts +2 -22
  37. package/types/games.d.ts +1 -4
  38. package/types/hotkeys.d.ts +1 -3
  39. package/types/http-server.d.ts +2 -14
  40. package/types/icons.d.ts +1 -1
  41. package/types/import.d.ts +7 -34
  42. package/types/index.d.ts +1 -1
  43. package/types/integrations.d.ts +41 -65
  44. package/types/moderation.d.ts +1 -8
  45. package/types/modules/event-manager.d.ts +2 -10
  46. package/types/modules/frontend-communicator.d.ts +5 -21
  47. package/types/modules/index.d.ts +1 -1
  48. package/types/notifications.d.ts +1 -6
  49. package/types/overlay-widgets.d.ts +11 -34
  50. package/types/parameters.d.ts +26 -182
  51. package/types/plugins.d.ts +18 -58
  52. package/types/power-ups.d.ts +0 -2
  53. package/types/pronouns.d.ts +1 -2
  54. package/types/quick-actions.d.ts +1 -3
  55. package/types/quotes.d.ts +1 -3
  56. package/types/ranks.d.ts +1 -2
  57. package/types/restrictions.d.ts +7 -24
  58. package/types/roles.d.ts +1 -3
  59. package/types/script-api.d.ts +14 -49
  60. package/types/settings.d.ts +7 -7
  61. package/types/setups.d.ts +2 -4
  62. package/types/sort-tags.d.ts +1 -1
  63. package/types/timers.d.ts +1 -5
  64. package/types/triggers.d.ts +12 -23
  65. package/types/ui/angular.d.ts +5 -26
  66. package/types/ui/effect-helper-service.d.ts +1 -2
  67. package/types/ui/effect-queues-service.d.ts +8 -4
  68. package/types/ui/firebot-root-scope.d.ts +0 -1
  69. package/types/ui/index.d.ts +1 -1
  70. package/types/ui/modal-factory.d.ts +5 -13
  71. package/types/ui/modal-service.d.ts +3 -2
  72. package/types/ui/ng-toast.d.ts +5 -1
  73. package/types/ui/object-copy-helper.d.ts +0 -1
  74. package/types/ui/platform-service.d.ts +1 -1
  75. package/types/ui/preset-effect-lists-service.d.ts +1 -6
  76. package/types/ui/settings-service.d.ts +0 -1
  77. package/types/ui-extensions.d.ts +9 -16
  78. package/types/util-types.d.ts +7 -33
  79. package/types/variable-macros.d.ts +1 -1
  80. package/types/variables.d.ts +5 -19
  81. package/types/viewers.d.ts +1 -3
  82. package/types/webhooks.d.ts +1 -1
  83. package/types/websocket.d.ts +8 -46
package/types/events.d.ts CHANGED
@@ -1,26 +1,6 @@
1
1
  import type { EffectList } from "./effects";
2
2
  import type { Awaitable } from "./util-types";
3
-
4
- export type ComparisonType =
5
- | "is"
6
- | "is not"
7
- | "greater than"
8
- | "greater than or equal to"
9
- | "less than"
10
- | "less than or equal to"
11
- | "include"
12
- | "doesn't include"
13
- | "contains"
14
- | "doesn't contain"
15
- | "doesn't start with"
16
- | "starts with"
17
- | "doesn't end with"
18
- | "ends with"
19
- | "matches regex"
20
- | "doesn't matches regex"
21
- | "matches regex (case insensitive)"
22
- | "doesn't match regex (case insensitive)";
23
-
3
+ export type ComparisonType = "is" | "is not" | "greater than" | "greater than or equal to" | "less than" | "less than or equal to" | "include" | "doesn't include" | "contains" | "doesn't contain" | "doesn't start with" | "starts with" | "doesn't end with" | "ends with" | "matches regex" | "doesn't matches regex" | "matches regex (case insensitive)" | "doesn't match regex (case insensitive)";
24
4
  export type EventDefinition = {
25
5
  id: string;
26
6
  name: string;
@@ -35,34 +15,28 @@ export type EventDefinition = {
35
15
  excludeFromChatFeed?: boolean;
36
16
  };
37
17
  };
38
-
39
18
  export type EventSource = {
40
19
  id: string;
41
20
  name: string;
42
21
  description?: string;
43
22
  events: EventDefinition[];
44
23
  };
45
-
46
24
  export type PresetValue = {
47
25
  value: any;
48
26
  display: string;
49
27
  };
50
-
51
28
  export type FilterSettings = {
52
29
  type: string;
53
30
  comparisonType: ComparisonType;
54
31
  value: any;
55
32
  };
56
-
57
33
  export type EventSourceAndId = {
58
34
  eventSourceId: string;
59
35
  eventId: string;
60
36
  };
61
-
62
37
  export type EventData = EventSourceAndId & {
63
38
  eventMeta: Record<string, any>;
64
39
  };
65
-
66
40
  export type EventFilter = {
67
41
  id: string;
68
42
  name: string;
@@ -73,17 +47,12 @@ export type EventFilter = {
73
47
  presetValues?(...args: unknown[]): Awaitable<PresetValue[]>;
74
48
  valueIsStillValid?(filterSettings: FilterSettings, ...args: unknown[]): Awaitable<boolean>;
75
49
  getSelectedValueDisplay?(filterSettings: FilterSettings, ...args: unknown[]): Awaitable<string>;
76
- predicate(
77
- filterSettings: FilterSettings,
78
- eventData: EventData
79
- ): Awaitable<boolean>;
50
+ predicate(filterSettings: FilterSettings, eventData: EventData): Awaitable<boolean>;
80
51
  };
81
-
82
52
  export type EventFilterData = {
83
53
  mode: "inclusive" | "exclusive";
84
54
  filters: FilterSettings[];
85
55
  };
86
-
87
56
  export type EventSettings = {
88
57
  id: string;
89
58
  type: string;
@@ -93,17 +62,15 @@ export type EventSettings = {
93
62
  effects: EffectList;
94
63
  [x: string]: unknown;
95
64
  };
96
-
97
65
  export type EventGroup = {
98
66
  id: string;
99
67
  events: EventSettings[];
100
68
  active?: boolean;
101
69
  };
102
-
103
70
  export type TriggeredEvent = {
104
71
  event: EventDefinition;
105
72
  source: EventSource;
106
73
  meta: Record<string, unknown>;
107
74
  isManual: boolean;
108
75
  isRetrigger: boolean;
109
- };
76
+ };
@@ -1,11 +1,9 @@
1
1
  type ExpressionishBaseToken = {
2
2
  type: "TEXT" | "VARIABLE" | "LOOKUP" | "IF" | "LOGICAL" | "CONDITION" | "UNKNOWN";
3
-
4
3
  /**
5
4
  * Rough character position of the token within the input string
6
5
  */
7
6
  position: number;
8
-
9
7
  /**
10
8
  * Depends on token type.
11
9
  *
@@ -16,59 +14,41 @@ type ExpressionishBaseToken = {
16
14
  * `CONDITION` or `LOGICAL`: operator
17
15
  */
18
16
  value: string;
19
-
20
17
  };
21
-
22
18
  type ExpressionishTokenWithArguments = {
23
19
  /**
24
20
  * Arguments to resolve then pass to calling registered handler
25
21
  */
26
22
  arguments: Array<ExpressionishToken>;
27
23
  };
28
-
29
24
  type ExpressionishTextToken = ExpressionishBaseToken & {
30
25
  type: "TEXT";
31
26
  };
32
-
33
27
  type ExpressionishLookupToken = ExpressionishBaseToken & ExpressionishTokenWithArguments & {
34
28
  type: "LOOKUP";
35
-
36
29
  /**
37
30
  * Lookup prefix
38
31
  */
39
32
  prefix: string;
40
33
  };
41
-
42
34
  type ExpressionishVariableToken = ExpressionishBaseToken & ExpressionishTokenWithArguments & {
43
35
  type: "VARIABLE";
44
36
  };
45
-
46
37
  type ExpressionishComparisonToken = ExpressionishBaseToken & ExpressionishTokenWithArguments & {
47
38
  type: "CONDITION";
48
39
  };
49
-
50
40
  type ExpressionishLogicToken = ExpressionishBaseToken & ExpressionishTokenWithArguments & {
51
41
  type: "LOGICAL";
52
42
  };
53
-
54
43
  type ExpressionishIfToken = ExpressionishBaseToken & ExpressionishTokenWithArguments & {
55
44
  type: "IF";
56
-
57
45
  /**
58
46
  * Condition used for evaluation
59
47
  */
60
48
  condition: ExpressionishLogicToken | ExpressionishComparisonToken;
61
49
  };
62
-
63
50
  type ExpressionishUnknownToken = ExpressionishBaseToken & {
64
51
  type: "UNKNOWN";
65
52
  };
66
-
67
- export type ExpressionishToken =
68
- | ExpressionishTextToken
69
- | ExpressionishLookupToken
70
- | ExpressionishVariableToken
71
- | ExpressionishComparisonToken
72
- | ExpressionishLogicToken
73
- | ExpressionishIfToken
74
- | ExpressionishUnknownToken;
53
+ export type ExpressionishToken = ExpressionishTextToken | ExpressionishLookupToken | ExpressionishVariableToken | ExpressionishComparisonToken | ExpressionishLogicToken | ExpressionishIfToken | ExpressionishUnknownToken;
54
+ export {};
package/types/games.d.ts CHANGED
@@ -1,10 +1,8 @@
1
1
  import type { FirebotParamCategory } from "./parameters";
2
-
3
2
  export type GameSettings = {
4
3
  active: boolean;
5
4
  settings?: Record<string, Record<string, unknown>>;
6
5
  };
7
-
8
6
  export type GameDefinition = {
9
7
  id: string;
10
8
  name: string;
@@ -14,9 +12,8 @@ export type GameDefinition = {
14
12
  active?: boolean;
15
13
  settingCategories: Record<string, FirebotParamCategory<Record<string, unknown>>>;
16
14
  };
17
-
18
15
  export type FirebotGame = GameDefinition & {
19
16
  onLoad: (settings: GameSettings) => void;
20
17
  onUnload: (settings: GameSettings) => void;
21
18
  onSettingsUpdate: (settings: GameSettings) => void;
22
- };
19
+ };
@@ -1,12 +1,10 @@
1
1
  import type { EffectList } from "./effects";
2
-
3
2
  export type FirebotHotkey = {
4
3
  id: string;
5
4
  name: string;
6
5
  active: boolean;
7
- // Electron accelerator string (see https://www.electronjs.org/docs/latest/api/accelerator)
8
6
  code: string;
9
7
  warning: string;
10
8
  effects: EffectList;
11
9
  sortTags: string[];
12
- };
10
+ };
@@ -1,23 +1,11 @@
1
1
  import type { Request, Response } from "express";
2
2
  import type { Awaitable } from "./util-types";
3
-
4
- export type HttpMethod =
5
- | "GET"
6
- | "POST"
7
- | "PUT"
8
- | "PATCH"
9
- | "DELETE"
10
- | "HEAD"
11
- | "CONNECT"
12
- | "OPTIONS"
13
- | "TRACE";
14
-
3
+ export type HttpMethod = "GET" | "POST" | "PUT" | "PATCH" | "DELETE" | "HEAD" | "CONNECT" | "OPTIONS" | "TRACE";
15
4
  export interface CustomHttpRoute {
16
5
  path: string;
17
6
  method: HttpMethod;
18
7
  handler: (req: Request, res: Response) => Awaitable<void>;
19
8
  }
20
-
21
9
  /**
22
10
  * Defines custom HTTP routes that plugins can add to the internal Firebot HTTP server.
23
11
  * Paths can contain multiple levels and parameters (e.g. `/item/:id`).
@@ -28,4 +16,4 @@ export interface CustomHttpRoute {
28
16
  export interface PluginHttpRouteDefinition {
29
17
  prefix: string;
30
18
  routes: Array<CustomHttpRoute>;
31
- }
19
+ }
package/types/icons.d.ts CHANGED
@@ -3,4 +3,4 @@ export type FontAwesomeIcon = {
3
3
  className: string;
4
4
  style: string;
5
5
  searchTerms: string[];
6
- };
6
+ };
package/types/import.d.ts CHANGED
@@ -1,69 +1,42 @@
1
1
  import type { Quote } from "./quotes";
2
2
  import type { FileFilter, Awaitable } from "./util-types";
3
-
4
3
  export interface LoadRequest {
5
4
  appId: string;
6
5
  filepath: string;
7
6
  }
8
-
9
7
  export interface LoadResult<T = unknown[]> {
10
8
  success: boolean;
11
9
  data?: T;
12
10
  error?: string;
13
11
  }
14
-
15
12
  export type ParsedQuotes = {
16
13
  quotes: Quote[];
17
14
  };
18
-
19
15
  export type ParsedViewers<V = unknown> = {
20
16
  viewers: V[];
21
17
  ranks: string[];
22
18
  };
23
-
24
19
  export interface ImportRequest<Data = unknown, Settings = unknown> {
25
20
  appId: string;
26
21
  data: Data;
27
22
  settings: Settings;
28
23
  }
29
-
30
24
  export interface ImportResult {
31
25
  success: boolean;
32
26
  error?: string;
33
27
  }
34
-
35
28
  type CustomImporterSettings = {
36
29
  quotes?: unknown;
37
30
  viewers?: unknown;
38
31
  };
39
-
40
- export type ThirdPartyImporter<
41
- Settings extends CustomImporterSettings = CustomImporterSettings,
42
- ViewerType = unknown
43
- > = {
32
+ export type ThirdPartyImporter<Settings extends CustomImporterSettings = CustomImporterSettings, ViewerType = unknown> = {
44
33
  id: string;
45
34
  appName: string;
46
35
  defaultSettings?: Settings;
47
36
  filetypes: FileFilter[];
48
-
49
- loadQuotes?: (
50
- filename: string,
51
- settings?: Settings["quotes"]
52
- ) => Awaitable<LoadResult<ParsedQuotes>>;
53
-
54
- importQuotes?: (
55
- quotes: Quote[],
56
- settings: Settings["quotes"]
57
- ) => Awaitable<ImportResult>;
58
-
59
- loadViewers?: (
60
- filename: string,
61
- settings?: Settings["viewers"]
62
- ) => Awaitable<LoadResult<ParsedViewers>>;
63
-
64
- importViewers?: (
65
- viewers: ViewerType[],
66
- settings: Settings["viewers"],
67
- abortSignal: AbortSignal
68
- ) => Awaitable<ImportResult>;
69
- };
37
+ loadQuotes?: (filename: string, settings?: Settings["quotes"]) => Awaitable<LoadResult<ParsedQuotes>>;
38
+ importQuotes?: (quotes: Quote[], settings: Settings["quotes"]) => Awaitable<ImportResult>;
39
+ loadViewers?: (filename: string, settings?: Settings["viewers"]) => Awaitable<LoadResult<ParsedViewers>>;
40
+ importViewers?: (viewers: ViewerType[], settings: Settings["viewers"], abortSignal: AbortSignal) => Awaitable<ImportResult>;
41
+ };
42
+ export {};
package/types/index.d.ts CHANGED
@@ -41,4 +41,4 @@ export * from "./variable-macros";
41
41
  export * from "./variables";
42
42
  export * from "./viewers";
43
43
  export * from "./webhooks";
44
- export * from "./websocket";
44
+ export * from "./websocket";
@@ -1,93 +1,69 @@
1
- import type {
2
- FirebotParameterCategories,
3
- FirebotParams
4
- } from "./parameters";
1
+ import type { FirebotParameterCategories } from "./parameters";
5
2
  import type { Awaitable, ObjectOfUnknowns } from "./util-types";
6
-
7
- export type Integration<Params extends FirebotParams = FirebotParams> = {
3
+ export type IntegrationParams = Record<string, Record<string, unknown>>;
4
+ export type Integration<Params extends IntegrationParams = IntegrationParams> = {
8
5
  definition: IntegrationDefinition<Params>;
9
6
  integration: IntegrationController<Params>;
10
7
  };
11
-
12
- export type IntegrationDefinition<
13
- Params extends FirebotParams = FirebotParams
14
- > = {
8
+ export type IntegrationDefinition<Params extends IntegrationParams = IntegrationParams> = {
15
9
  id: string;
16
10
  name: string;
17
11
  description: string;
18
12
  connectionToggle?: boolean;
19
13
  configurable?: boolean;
20
14
  settingCategories: FirebotParameterCategories<Params>;
21
- } & (
22
- | {
23
- linkType: "id";
24
- idDetails: {
25
- steps: string;
26
- };
27
- }
28
- | {
29
- linkType: "auth";
30
- authProviderDetails: {
15
+ } & ({
16
+ linkType: "id";
17
+ idDetails: {
18
+ steps: string;
19
+ };
20
+ } | {
21
+ linkType: "auth";
22
+ authProviderDetails: {
23
+ id: string;
24
+ name: string;
25
+ redirectUriHost?: string;
26
+ client: {
31
27
  id: string;
32
- name: string;
33
- redirectUriHost?: string;
34
- client: {
35
- id: string;
36
- secret: string;
37
- };
38
- auth: {
39
- tokenHost: string;
40
- tokenPath: string;
41
- authorizePath: string;
42
- };
43
- autoRefreshToken?: boolean;
44
- scopes: string;
28
+ secret: string;
29
+ };
30
+ auth: {
31
+ tokenHost: string;
32
+ tokenPath: string;
33
+ authorizePath: string;
45
34
  };
46
- }
47
- | { linkType: "other" | "none" }
48
- );
49
-
35
+ autoRefreshToken?: boolean;
36
+ scopes: string;
37
+ };
38
+ } | {
39
+ linkType: "other" | "none";
40
+ });
50
41
  export interface IntegrationEvents {
51
42
  connected: (id: string) => void;
52
43
  disconnected: (id: string) => void;
53
44
  "settings-update": (id: string, settings: Record<string, any>) => void;
54
45
  }
55
-
56
- type LinkData =
57
- | {
58
- accountId: string;
59
- }
60
- | {
61
- auth: Record<string, unknown>;
62
- }
63
- | null;
64
-
65
- export type IntegrationData<Params extends FirebotParams = FirebotParams> = {
46
+ type LinkData = {
47
+ accountId: string;
48
+ } | {
49
+ auth: Record<string, unknown>;
50
+ } | null;
51
+ export type IntegrationData<Params extends IntegrationParams = IntegrationParams> = {
66
52
  settings: any;
67
53
  userSettings?: Params;
68
54
  oauth?: any;
69
55
  accountId?: string;
70
56
  };
71
-
72
- export interface IntegrationController<
73
- Params extends FirebotParams = FirebotParams
74
- > {
57
+ export interface IntegrationController<Params extends IntegrationParams = IntegrationParams> {
75
58
  connected: boolean;
76
- init(
77
- linked: boolean,
78
- integrationData: IntegrationData<Params>
79
- ): Awaitable<void>;
59
+ init(linked: boolean, integrationData: IntegrationData<Params>): Awaitable<void>;
80
60
  link?(linkData: LinkData): Awaitable<void>;
81
- connect?(
82
- integrationData: IntegrationData<Params>
83
- ): Awaitable<void>;
61
+ connect?(integrationData: IntegrationData<Params>): Awaitable<void>;
84
62
  disconnect?(): Awaitable<void>;
85
- onUserSettingsUpdate?(
86
- integrationData: IntegrationData<Params>
87
- ): Awaitable<void>;
63
+ onUserSettingsUpdate?(integrationData: IntegrationData<Params>): Awaitable<void>;
88
64
  }
89
-
90
- type IntegrationWithUnknowns = {
65
+ export type IntegrationWithUnknowns = {
91
66
  definition: IntegrationDefinition & ObjectOfUnknowns;
92
67
  integration: IntegrationController & ObjectOfUnknowns;
93
- };
68
+ };
69
+ export {};
@@ -2,38 +2,31 @@ export type ModerationTerm = {
2
2
  text: string;
3
3
  createdAt: number;
4
4
  };
5
-
6
5
  export type ModerationUser = {
7
6
  id: string;
8
7
  username: string;
9
8
  displayName: string;
10
9
  };
11
-
12
10
  export type AllowedUser = {
13
11
  id: string;
14
12
  username: string;
15
13
  displayName: string;
16
14
  createdAt: number;
17
15
  };
18
-
19
16
  export type BannedWords = {
20
17
  words: ModerationTerm[];
21
18
  };
22
-
23
19
  export type BannedRegularExpressions = {
24
20
  regularExpressions: ModerationTerm[];
25
21
  };
26
-
27
22
  export type AllowList = {
28
23
  urls: ModerationTerm[];
29
24
  users: AllowedUser[];
30
25
  };
31
-
32
26
  export type ModerationImportRequest = {
33
27
  filePath: string;
34
28
  delimiter: "newline" | "comma" | "space";
35
29
  };
36
-
37
30
  export type ChatModerationSettings = {
38
31
  bannedWordList: {
39
32
  enabled: boolean;
@@ -56,4 +49,4 @@ export type ChatModerationSettings = {
56
49
  outputMessage?: string;
57
50
  };
58
51
  exemptRoles: string[];
59
- };
52
+ };
@@ -1,18 +1,15 @@
1
1
  import type { EventSource } from "../events";
2
-
3
2
  export type EventManagerModule = {
4
3
  /**
5
4
  * Registers an event source in Firebot.
6
5
  * @param eventSource The {@linkcode EventSource} you want to register.
7
6
  */
8
7
  registerEventSource: (eventSource: EventSource) => void;
9
-
10
8
  /**
11
9
  * Unregisters an event source from Firebot.
12
10
  * @param eventSourceId The ID of the event source to unregister.
13
11
  */
14
12
  unregisterEventSource: (eventSourceId: string) => void;
15
-
16
13
  /**
17
14
  * Triggers an event in Firebot.
18
15
  * @param eventSourceId The ID of the event source.
@@ -20,10 +17,5 @@ export type EventManagerModule = {
20
17
  * @param meta Any metadata you want to include with the event.
21
18
  * @param isManual `true` if the event is being triggered manually, `false` otherwise.
22
19
  */
23
- triggerEvent: (
24
- eventSourceId: string,
25
- eventId: string,
26
- meta: Record<string, unknown>,
27
- isManual?: boolean
28
- ) => void;
29
- };
20
+ triggerEvent: (eventSourceId: string, eventId: string, meta: Record<string, unknown>, isManual?: boolean) => void;
21
+ };
@@ -4,11 +4,7 @@ export interface FrontendCommunicatorModule {
4
4
  * @param eventName The name of the event to send.
5
5
  * @param data Data to provide to the event handler.
6
6
  */
7
- send<ExpectedArg = unknown>(
8
- eventName: string,
9
- data?: ExpectedArg
10
- ): void;
11
-
7
+ send<ExpectedArg = unknown>(eventName: string, data?: ExpectedArg): void;
12
8
  /** Handle a synchronous event triggered by the frontend.
13
9
  * @template ExpectedArgs The type of data provided with the event.
14
10
  * @template ReturnPayload The type of data returned from the event handler.
@@ -16,11 +12,7 @@ export interface FrontendCommunicatorModule {
16
12
  * @param callback A function to handle the event.
17
13
  * @returns Unique ID of the registered event handler.
18
14
  */
19
- on<ExpectedArgs extends Array<unknown> = [], ReturnPayload = void>(
20
- eventName: string,
21
- callback: (...args: ExpectedArgs) => ReturnPayload
22
- ): void;
23
-
15
+ on<ExpectedArgs extends Array<unknown> = [], ReturnPayload = void>(eventName: string, callback: (...args: ExpectedArgs) => ReturnPayload): void;
24
16
  /** Handle an asynchronous event triggered by the frontend.
25
17
  * @template ExpectedArgs The type of data provided with the event.
26
18
  * @template ReturnPayload The type of data returned from the event handler.
@@ -28,26 +20,18 @@ export interface FrontendCommunicatorModule {
28
20
  * @param callback A function to asynchronously handle the event.
29
21
  * @returns Unique ID of the registered event handler.
30
22
  */
31
- onAsync<ExpectedArgs extends Array<unknown> = [], ReturnPayload = void>(
32
- eventName: string,
33
- callback: (...args: ExpectedArgs) => Promise<ReturnPayload>
34
- ): void;
35
-
23
+ onAsync<ExpectedArgs extends Array<unknown> = [], ReturnPayload = void>(eventName: string, callback: (...args: ExpectedArgs) => Promise<ReturnPayload>): void;
36
24
  /** Send an asynchronous event to the frontend that is capable of returning a result.
37
25
  * @template ReturnPayload The type of data returned from the event handler.
38
26
  * @template ExpectedArg The type of data provided with the event.
39
27
  * @param eventName The name of the event to send.
40
28
  * @param data The data to provide with the event.
41
29
  */
42
- fireEventAsync<ReturnPayload = void, ExpectedArg = unknown>(
43
- eventName: string,
44
- data?: ExpectedArg
45
- ): Promise<ReturnPayload>;
46
-
30
+ fireEventAsync<ReturnPayload = void, ExpectedArg = unknown>(eventName: string, data?: ExpectedArg): Promise<ReturnPayload>;
47
31
  /**
48
32
  * Unregisters a previously registered frontend event handler.
49
33
  * @param eventName The name of the event.
50
34
  * @param id The unique ID of the event handler to unregister. This ID is returned when you create an event handler using {@linkcode FrontendCommunicator.on | on} or {@linkcode FrontendCommunicator.onAsync | onAsync}.
51
35
  */
52
36
  off(eventName: string, id: string): void;
53
- }
37
+ }
@@ -1,2 +1,2 @@
1
1
  export * from "./event-manager";
2
- export * from "./frontend-communicator";
2
+ export * from "./frontend-communicator";
@@ -1,14 +1,11 @@
1
1
  export type NotificationSource = "external" | "internal" | "script";
2
-
3
2
  export type NotificationType = "info" | "tip" | "update" | "alert";
4
-
5
3
  export type ExternalNotification = {
6
4
  id: string;
7
5
  title: string;
8
6
  message: string;
9
7
  type: NotificationType;
10
8
  };
11
-
12
9
  export type NotificationBase = {
13
10
  title: string;
14
11
  message: string;
@@ -18,16 +15,14 @@ export type NotificationBase = {
18
15
  externalId?: string;
19
16
  metadata?: Record<string, unknown>;
20
17
  };
21
-
22
18
  export type Notification = NotificationBase & {
23
19
  id: string;
24
20
  timestamp: Date;
25
21
  saved: boolean;
26
22
  read: boolean;
27
23
  };
28
-
29
24
  export interface NotificationCache {
30
25
  dbVersion?: string;
31
26
  notifications: Notification[];
32
27
  knownExternalIds: string[];
33
- }
28
+ }