Merge branch 'develop' into enh-14794
This commit is contained in:
commit
d7ca816dbf
18 changed files with 495 additions and 48 deletions
|
|
@ -232,7 +232,6 @@ export async function isFired<C extends keyof Misskey.Channels, T extends keyof
|
|||
params?: Misskey.Channels[C]['params'],
|
||||
): Promise<boolean> {
|
||||
return new Promise<boolean>(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<Misskey.StreamEvents['noteUpdated']>[0]) => boolean,
|
||||
): Promise<boolean> {
|
||||
return new Promise<boolean>(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 => {
|
||||
|
|
|
|||
|
|
@ -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<StreamEvents> implements IStream {
|
|||
constructor(origin: string, user: {
|
||||
token: string;
|
||||
} | null, options?: {
|
||||
WebSocket?: WebSocket;
|
||||
WebSocket?: _ReconnectingWebsocket.Options['WebSocket'];
|
||||
});
|
||||
// (undocumented)
|
||||
close(): void;
|
||||
|
|
|
|||
|
|
@ -51,7 +51,7 @@ export default class Stream extends EventEmitter<StreamEvents> implements IStrea
|
|||
private idCounter = 0;
|
||||
|
||||
constructor(origin: string, user: { token: string; } | null, options?: {
|
||||
WebSocket?: WebSocket;
|
||||
WebSocket?: _ReconnectingWebsocket.Options['WebSocket'];
|
||||
}) {
|
||||
super();
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue