mirror of
https://github.com/misskey-dev/misskey.git
synced 2025-01-16 05:40:42 +01:00
fix(frontend): frontend / frontend-embedにあるtsconfig.jsonのmoduleをES2022にする (#15215)
* fix(frontend): frontend / frontend-embedにあるtsconfig.jsonのmoduleをES2022にする * fixed errors * fixed errors * fixed errors
This commit is contained in:
parent
99ba7ebaa2
commit
f7da2bad6f
4 changed files with 13 additions and 11 deletions
packages
|
@ -10,8 +10,8 @@
|
|||
"declaration": false,
|
||||
"sourceMap": false,
|
||||
"target": "ES2022",
|
||||
"module": "nodenext",
|
||||
"moduleResolution": "nodenext",
|
||||
"module": "ES2022",
|
||||
"moduleResolution": "Bundler",
|
||||
"removeComments": false,
|
||||
"noLib": false,
|
||||
"strict": true,
|
||||
|
|
|
@ -10,8 +10,8 @@
|
|||
"declaration": false,
|
||||
"sourceMap": false,
|
||||
"target": "ES2022",
|
||||
"module": "nodenext",
|
||||
"moduleResolution": "nodenext",
|
||||
"module": "ES2022",
|
||||
"moduleResolution": "Bundler",
|
||||
"removeComments": false,
|
||||
"noLib": false,
|
||||
"strict": true,
|
||||
|
|
|
@ -6,8 +6,8 @@
|
|||
|
||||
import type { AuthenticationResponseJSON } from '@simplewebauthn/types';
|
||||
import { EventEmitter } from 'eventemitter3';
|
||||
import { Options } from 'reconnecting-websocket';
|
||||
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
|
||||
//
|
||||
|
@ -3150,7 +3150,7 @@ export class Stream extends EventEmitter<StreamEvents> implements IStream {
|
|||
constructor(origin: string, user: {
|
||||
token: string;
|
||||
} | null, options?: {
|
||||
WebSocket?: _ReconnectingWebsocket.Options['WebSocket'];
|
||||
WebSocket?: Options['WebSocket'];
|
||||
});
|
||||
// (undocumented)
|
||||
close(): void;
|
||||
|
|
|
@ -1,8 +1,10 @@
|
|||
import { EventEmitter } from 'eventemitter3';
|
||||
import _ReconnectingWebsocket from 'reconnecting-websocket';
|
||||
import _ReconnectingWebSocket, { Options } from 'reconnecting-websocket';
|
||||
import type { BroadcastEvents, Channels } from './streaming.types.js';
|
||||
|
||||
const ReconnectingWebsocket = _ReconnectingWebsocket as unknown as typeof _ReconnectingWebsocket['default'];
|
||||
// コンストラクタとクラスそのものの定義が上手く解決出来ないため再定義
|
||||
const ReconnectingWebSocketConstructor = _ReconnectingWebSocket as unknown as typeof _ReconnectingWebSocket.default;
|
||||
type ReconnectingWebSocket = _ReconnectingWebSocket.default;
|
||||
|
||||
export function urlQuery(obj: Record<string, string | number | boolean | undefined>): string {
|
||||
const params = Object.entries(obj)
|
||||
|
@ -43,7 +45,7 @@ export interface IStream extends EventEmitter<StreamEvents> {
|
|||
*/
|
||||
// eslint-disable-next-line import/no-default-export
|
||||
export default class Stream extends EventEmitter<StreamEvents> implements IStream {
|
||||
private stream: _ReconnectingWebsocket.default;
|
||||
private stream: ReconnectingWebSocket;
|
||||
public state: 'initializing' | 'reconnecting' | 'connected' = 'initializing';
|
||||
private sharedConnectionPools: Pool[] = [];
|
||||
private sharedConnections: SharedConnection[] = [];
|
||||
|
@ -51,7 +53,7 @@ export default class Stream extends EventEmitter<StreamEvents> implements IStrea
|
|||
private idCounter = 0;
|
||||
|
||||
constructor(origin: string, user: { token: string; } | null, options?: {
|
||||
WebSocket?: _ReconnectingWebsocket.Options['WebSocket'];
|
||||
WebSocket?: Options['WebSocket'];
|
||||
}) {
|
||||
super();
|
||||
|
||||
|
@ -80,7 +82,7 @@ export default class Stream extends EventEmitter<StreamEvents> implements IStrea
|
|||
|
||||
const wsOrigin = origin.replace('http://', 'ws://').replace('https://', 'wss://');
|
||||
|
||||
this.stream = new ReconnectingWebsocket(`${wsOrigin}/streaming?${query}`, '', {
|
||||
this.stream = new ReconnectingWebSocketConstructor(`${wsOrigin}/streaming?${query}`, '', {
|
||||
minReconnectionDelay: 1, // https://github.com/pladaria/reconnecting-websocket/issues/91
|
||||
WebSocket: options.WebSocket,
|
||||
});
|
||||
|
|
Loading…
Reference in a new issue