diff --git a/CHANGELOG.md b/CHANGELOG.md index 40ad0b639b..90ad015dab 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -26,6 +26,9 @@ - Fix: 招待コードの発行可能な残り数算出に使用すべきロールポリシーの値が違う問題を修正 (Cherry-picked from https://activitypub.software/TransFem-org/Sharkey/-/merge_requests/706) +### Misskey.js +- Fix: Stream初期化時、別途WebSocketを指定する場合の型定義を修正 + ## 2024.10.1 ### Note diff --git a/packages/backend/test-federation/test/utils.ts b/packages/backend/test-federation/test/utils.ts index 483bf4b254..093277cdb4 100644 --- a/packages/backend/test-federation/test/utils.ts +++ b/packages/backend/test-federation/test/utils.ts @@ -232,7 +232,6 @@ export async function isFired { return new Promise(async (resolve, reject) => { - // @ts-expect-error TODO: why? const stream = new Misskey.Stream(`wss://${host}`, { token: user.i }, { WebSocket }); const connection = stream.useChannel(channel, params); connection.on(type as any, ((msg: any) => { @@ -266,7 +265,6 @@ export async function isNoteUpdatedEventFired( cond: (msg: Parameters[0]) => boolean, ): Promise { return new Promise(async (resolve, reject) => { - // @ts-expect-error TODO: why? const stream = new Misskey.Stream(`wss://${host}`, { token: user.i }, { WebSocket }); stream.send('s', { id: noteId }); stream.on('noteUpdated', msg => { diff --git a/packages/misskey-js/etc/misskey-js.api.md b/packages/misskey-js/etc/misskey-js.api.md index 72c236373d..61de8b8c7e 100644 --- a/packages/misskey-js/etc/misskey-js.api.md +++ b/packages/misskey-js/etc/misskey-js.api.md @@ -7,6 +7,7 @@ import type { AuthenticationResponseJSON } from '@simplewebauthn/types'; import { EventEmitter } from 'eventemitter3'; import type { PublicKeyCredentialRequestOptionsJSON } from '@simplewebauthn/types'; +import _ReconnectingWebsocket from 'reconnecting-websocket'; // Warning: (ae-forgotten-export) The symbol "components" needs to be exported by the entry point index.d.ts // @@ -3137,7 +3138,7 @@ export class Stream extends EventEmitter implements IStream { constructor(origin: string, user: { token: string; } | null, options?: { - WebSocket?: WebSocket; + WebSocket?: _ReconnectingWebsocket.Options['WebSocket']; }); // (undocumented) close(): void; diff --git a/packages/misskey-js/src/streaming.ts b/packages/misskey-js/src/streaming.ts index ffb46c77f6..6e34ec1508 100644 --- a/packages/misskey-js/src/streaming.ts +++ b/packages/misskey-js/src/streaming.ts @@ -51,7 +51,7 @@ export default class Stream extends EventEmitter implements IStrea private idCounter = 0; constructor(origin: string, user: { token: string; } | null, options?: { - WebSocket?: WebSocket; + WebSocket?: _ReconnectingWebsocket.Options['WebSocket']; }) { super();