diff --git a/packages/misskey-js/src/api.ts b/packages/misskey-js/src/api.ts index 1704b6e46..fcc988446 100644 --- a/packages/misskey-js/src/api.ts +++ b/packages/misskey-js/src/api.ts @@ -1,4 +1,4 @@ -import { Endpoints } from './api.types'; +import type { Endpoints } from './api.types'; const MK_API_ERROR = Symbol(); @@ -83,7 +83,7 @@ export class APIClient { cache: 'no-cache', }).then(async (res) => { const body = res.status === 204 ? null : await res.json(); - + if (res.status === 200) { resolve(body); } else if (res.status === 204) { @@ -96,7 +96,7 @@ export class APIClient { } }).catch(reject); }); - + return promise as any; } } diff --git a/packages/misskey-js/src/api.types.ts b/packages/misskey-js/src/api.types.ts index 4fbf42f91..63f0b77e8 100644 --- a/packages/misskey-js/src/api.types.ts +++ b/packages/misskey-js/src/api.types.ts @@ -1,5 +1,5 @@ -import { - Ad, Announcement, Antenna, App, AuthSession, Blocking, Channel, Clip, DateString, DetailedInstanceMetadata, DriveFile, DriveFolder, Following, FollowingFolloweePopulated, FollowingFollowerPopulated, FollowRequest, GalleryPost, Instance, InstanceMetadata, +import type { + Ad, Announcement, Antenna, App, AuthSession, Blocking, Channel, Clip, DateString, DetailedInstanceMetadata, DriveFile, DriveFolder, Following, FollowingFolloweePopulated, FollowingFollowerPopulated, FollowRequest, GalleryPost, Instance, LiteInstanceMetadata, MeDetailed, Note, NoteFavorite, OriginType, Page, ServerInfo, Stats, User, UserDetailed, UserGroup, UserList, UserSorting, Notification, NoteReaction, Signin, MessagingMessage, diff --git a/packages/misskey-js/src/streaming.ts b/packages/misskey-js/src/streaming.ts index 92b83192c..638882868 100644 --- a/packages/misskey-js/src/streaming.ts +++ b/packages/misskey-js/src/streaming.ts @@ -1,7 +1,7 @@ import autobind from 'autobind-decorator'; import { EventEmitter } from 'eventemitter3'; import ReconnectingWebsocket from 'reconnecting-websocket'; -import { BroadcastEvents, Channels } from './streaming.types'; +import type { BroadcastEvents, Channels } from './streaming.types'; export function urlQuery(obj: Record): string { const params = Object.entries(obj) @@ -40,7 +40,7 @@ export default class Stream extends EventEmitter { const query = urlQuery({ i: user?.token, - + // To prevent cache of an HTML such as error screen _t: Date.now(), }); diff --git a/packages/misskey-js/src/streaming.types.ts b/packages/misskey-js/src/streaming.types.ts index f711b8d6e..d58b90530 100644 --- a/packages/misskey-js/src/streaming.types.ts +++ b/packages/misskey-js/src/streaming.types.ts @@ -1,4 +1,4 @@ -import { Antenna, CustomEmoji, DriveFile, MeDetailed, MessagingMessage, Note, Notification, PageEvent, User, UserGroup } from './entities'; +import type { Antenna, CustomEmoji, DriveFile, MeDetailed, MessagingMessage, Note, Notification, PageEvent, User, UserGroup } from './entities'; type FIXME = any;