chore: Fix types in tests 41/N.

This commit is contained in:
cpojer
2026-02-17 15:48:16 +09:00
parent 3dc8d5656d
commit 6264c5e842
17 changed files with 81 additions and 43 deletions

View File

@@ -117,6 +117,10 @@ const createStubPlugin = (params: {
outbound: params.outbound,
});
type ChannelActionParams = Parameters<
NonNullable<NonNullable<ChannelPlugin["actions"]>["handleAction"]>
>[0];
const createDiscordPollPluginRegistration = () => ({
pluginId: "discord",
source: "test",
@@ -125,11 +129,12 @@ const createDiscordPollPluginRegistration = () => ({
label: "Discord",
actions: {
listActions: () => ["poll"],
handleAction: async ({ action, params, cfg, accountId }) =>
await handleDiscordAction(
handleAction: (async ({ action, params, cfg, accountId }: ChannelActionParams) => {
return await handleDiscordAction(
{ action, to: params.to, accountId: accountId ?? undefined },
cfg,
),
);
}) as unknown as NonNullable<ChannelPlugin["actions"]>["handleAction"],
},
}),
});
@@ -142,11 +147,12 @@ const createTelegramSendPluginRegistration = () => ({
label: "Telegram",
actions: {
listActions: () => ["send"],
handleAction: async ({ action, params, cfg, accountId }) =>
await handleTelegramAction(
handleAction: (async ({ action, params, cfg, accountId }: ChannelActionParams) => {
return await handleTelegramAction(
{ action, to: params.to, accountId: accountId ?? undefined },
cfg,
),
);
}) as unknown as NonNullable<ChannelPlugin["actions"]>["handleAction"],
},
}),
});