Make different MessageChannels not require explicit "extends JsonObject"

Note: Non-escaped lint breaks type here for forcing interface over type. Reasonable effort brought no understanding for what is the relevant difference between the two.

Co-authored-by: Janne Savolainen <janne.savolainen@live.fi>

Signed-off-by: Iku-turso <mikko.aspiala@gmail.com>
This commit is contained in:
Iku-tursoandJanne Savolainen committed 2022-05-30 13:25:14 +03:00
1 parent 2fc30f6ce5
commit ac4642ec04
2 files changed
+4 -4

No files matched your search

@@ -3,7 +3,6 @@
* Licensed under MIT License. See LICENSE in root directory for more information. * Licensed under MIT License. See LICENSE in root directory for more information.
*/ */
import { getInjectable } from "@ogre-tools/injectable"; import { getInjectable } from "@ogre-tools/injectable";
import type { JsonObject } from "type-fest";
import type { MessageChannel } from "../channel/message-channel-injection-token"; import type { MessageChannel } from "../channel/message-channel-injection-token";
import { messageChannelInjectionToken } from "../channel/message-channel-injection-token"; import { messageChannelInjectionToken } from "../channel/message-channel-injection-token";
@@ -13,7 +12,8 @@ export type ApplicationUpdateStatusEventId =
| "download-for-update-started" | "download-for-update-started"
| "download-for-update-failed"; | "download-for-update-failed";
export interface ApplicationUpdateStatusChannelMessage extends JsonObject { eventId: ApplicationUpdateStatusEventId; version?: string } // eslint-disable-next-line @typescript-eslint/consistent-type-definitions
export type ApplicationUpdateStatusChannelMessage = { eventId: ApplicationUpdateStatusEventId; version?: string };
export type ApplicationUpdateStatusChannel = MessageChannel<ApplicationUpdateStatusChannelMessage>; export type ApplicationUpdateStatusChannel = MessageChannel<ApplicationUpdateStatusChannelMessage>;
const applicationUpdateStatusChannelInjectable = getInjectable({ const applicationUpdateStatusChannelInjectable = getInjectable({
@@ -3,11 +3,11 @@
* Licensed under MIT License. See LICENSE in root directory for more information. * Licensed under MIT License. See LICENSE in root directory for more information.
*/ */
import { getInjectable } from "@ogre-tools/injectable"; import { getInjectable } from "@ogre-tools/injectable";
import type { JsonObject } from "type-fest";
import type { MessageChannel } from "../channel/message-channel-injection-token"; import type { MessageChannel } from "../channel/message-channel-injection-token";
import { messageChannelInjectionToken } from "../channel/message-channel-injection-token"; import { messageChannelInjectionToken } from "../channel/message-channel-injection-token";
export interface AskBooleanQuestionParameters extends JsonObject { id: string; title: string; question: string } // eslint-disable-next-line @typescript-eslint/consistent-type-definitions
export type AskBooleanQuestionParameters = { id: string; title: string; question: string };
export type AskBooleanQuestionChannel = MessageChannel<AskBooleanQuestionParameters>; export type AskBooleanQuestionChannel = MessageChannel<AskBooleanQuestionParameters>;
const askBooleanQuestionChannelInjectable = getInjectable({ const askBooleanQuestionChannelInjectable = getInjectable({