-
Notifications
You must be signed in to change notification settings - Fork 13.1k
Closed
Labels
Working as IntendedThe behavior described is the intended behavior; this is not a bugThe behavior described is the intended behavior; this is not a bug
Description
TypeScript Version: (version check command not supplied)
Search Terms:
@ts-ignore .d.ts
Code
For reasons within my codebase, the following code absolutely necessitates // @ts-ignore in order to disable an issue in which ProxiedAny<TYPE extends object> only takes objects for TYPE. Without this line, I get the error: Type 'TYPE' does not satisfy the constraint 'object'
export function isProxied<TYPE>(checkMe: TYPE | Sourcified<TYPE>)
// @ts-ignore
: checkMe is ProxiedAny<TYPE>
{
return checkMe && typeof checkMe === "object" && "_proxied" in checkMe;
}
Expected behavior:
When compiling, I would expect to find this //@ts-ignore included with the .d.ts file.
Actual behavior:
The .d.ts file is broken:

Alternatives:
Maybe arg is TYPE should be able to do something like arg as unknown is TYPE in order to get around this issue. I'm checking if it's an object, and need a way to tell Typescript so.
KotlinIsland, justDo1T and MellKam
Metadata
Metadata
Assignees
Labels
Working as IntendedThe behavior described is the intended behavior; this is not a bugThe behavior described is the intended behavior; this is not a bug