diff --git a/packages/misskey-js/etc/misskey-js.api.md b/packages/misskey-js/etc/misskey-js.api.md index 3592153f9..1dba2a70d 100644 --- a/packages/misskey-js/etc/misskey-js.api.md +++ b/packages/misskey-js/etc/misskey-js.api.md @@ -2165,7 +2165,7 @@ type IResponse = operations['i']['responses']['200']['content']['application/jso type IRevokeTokenRequest = operations['i/revoke-token']['requestBody']['content']['application/json']; // @public (undocumented) -function isAPIError(reason: any): reason is APIError; +function isAPIError(reason: Record): reason is APIError; // @public (undocumented) type ISigninHistoryRequest = operations['i/signin-history']['requestBody']['content']['application/json']; diff --git a/packages/misskey-js/src/api.ts b/packages/misskey-js/src/api.ts index 2e85fc293..134ead0d7 100644 --- a/packages/misskey-js/src/api.ts +++ b/packages/misskey-js/src/api.ts @@ -17,7 +17,7 @@ export type APIError = { info: Record; }; -export function isAPIError(reason: any): reason is APIError { +export function isAPIError(reason: Record): reason is APIError { return reason[MK_API_ERROR] === true; } diff --git a/packages/misskey-js/src/api.types.ts b/packages/misskey-js/src/api.types.ts index 632008192..af0bade5b 100644 --- a/packages/misskey-js/src/api.types.ts +++ b/packages/misskey-js/src/api.types.ts @@ -15,10 +15,10 @@ type Overwrite = Omit< keyof U > & U; -type SwitchCase = { +type SwitchCase = { $switch: { - $cases: [any, any][], - $default: any; + $cases: [Condition, Result][], + $default: Result; }; };