1
0
mirror of https://github.com/lensapp/lens.git synced 2025-05-20 05:10:56 +00:00

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-turso 2022-05-23 18:01:42 +03:00
parent 348b214ca0
commit ec2d2056cb
9 changed files with 9 additions and 9 deletions

View File

@ -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",

View File

@ -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",

View File

@ -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",

View File

@ -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;

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", () => {

View File

@ -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",

View File

@ -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",

View File

@ -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",

View File

@ -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",