Make a channel have default type for sent and returned message

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-24 09:02:04 +03:00
1 parent 348b214ca0
commit ec2d2056cb
9 files changed
+9 -9

No files matched your search

@@ -13,7 +13,7 @@ export type ApplicationUpdateStatusEventId =
| "download-for-update-failed";
export interface ApplicationUpdateStatusChannelMessage { eventId: ApplicationUpdateStatusEventId; version?: string }
export type ApplicationUpdateStatusChannel = Channel<ApplicationUpdateStatusChannelMessage, never>;
export type ApplicationUpdateStatusChannel = Channel<ApplicationUpdateStatusChannelMessage>;
const applicationUpdateStatusChannelInjectable = getInjectable({
id: "application-update-status-channel",
@@ -6,7 +6,7 @@ import { getInjectable } from "@ogre-tools/injectable";
import type { Channel } from "../channel/channel-injection-token";
import { channelInjectionToken } from "../channel/channel-injection-token";
type AskBooleanAnswerChannel = Channel<{ id: string; value: boolean }, never>;
type AskBooleanAnswerChannel = Channel<{ id: string; value: boolean }>;
const askBooleanAnswerChannelInjectable = getInjectable({
id: "ask-boolean-answer-channel",
@@ -7,7 +7,7 @@ import type { Channel } from "../channel/channel-injection-token";
import { channelInjectionToken } from "../channel/channel-injection-token";
export interface AskBooleanQuestionParameters { id: string; title: string; question: string }
export type AskBooleanQuestionChannel = Channel<AskBooleanQuestionParameters, never>;
export type AskBooleanQuestionChannel = Channel<AskBooleanQuestionParameters>;
const askBooleanQuestionChannelInjectable = getInjectable({
id: "ask-boolean-question-channel",
@@ -5,7 +5,7 @@
import { getInjectionToken } from "@ogre-tools/injectable";
export interface Channel<MessageTemplate, ReturnTemplate> {
export interface Channel<MessageTemplate = void, ReturnTemplate = void> {
id: string;
_messageTemplate?: MessageTemplate;
_returnTemplate?: ReturnTemplate;
+1 -1
View File
@@ -14,7 +14,7 @@ import createLensWindowInjectable from "../../main/start-main-application/lens-w
import type { Channel } from "./channel-injection-token";
import closeAllWindowsInjectable from "../../main/start-main-application/lens-window/hide-all-windows/close-all-windows.injectable";
type TestChannel = Channel<string, never>;
type TestChannel = Channel<string>;
describe("channel", () => {
describe("messaging from main to renderer, given listener for channel in a window and application has started", () => {
@@ -7,7 +7,7 @@ import type { Channel } from "../channel/channel-injection-token";
import { channelInjectionToken } from "../channel/channel-injection-token";
import { IpcRendererNavigationEvents } from "../../renderer/navigation/events";
export type AppNavigationChannel = Channel<string, never>;
export type AppNavigationChannel = Channel<string>;
const appNavigationChannelInjectable = getInjectable({
id: "app-navigation-channel",
@@ -7,7 +7,7 @@ import type { Channel } from "../channel/channel-injection-token";
import { channelInjectionToken } from "../channel/channel-injection-token";
import { IpcRendererNavigationEvents } from "../../renderer/navigation/events";
export type ClusterFrameNavigationChannel = Channel<string, never>;
export type ClusterFrameNavigationChannel = Channel<string>;
const clusterFrameNavigationChannelInjectable = getInjectable({
id: "cluster-frame-navigation-channel",
@@ -6,7 +6,7 @@ import { getInjectable } from "@ogre-tools/injectable";
import type { Channel } from "../channel/channel-injection-token";
import { channelInjectionToken } from "../channel/channel-injection-token";
export type RootFrameRenderedChannel = Channel<void, never>;
export type RootFrameRenderedChannel = Channel;
const rootFrameRenderedChannelInjectable = getInjectable({
id: "root-frame-rendered-channel",
@@ -6,7 +6,7 @@ import { getInjectable } from "@ogre-tools/injectable";
import type { Channel } from "../channel/channel-injection-token";
import { channelInjectionToken } from "../channel/channel-injection-token";
export type SyncBoxChannel = Channel<{ id: string; value: unknown }, never>;
export type SyncBoxChannel = Channel<{ id: string; value: unknown }>;
const syncBoxChannelInjectable = getInjectable({
id: "sync-box-channel",