arktypea
arktypeโ€ข3y ago
OnkelTem

How to properly make a property of a class type?

I tried this:
class TokenManager {}
const params = type({
  tokenManager: type(['instanceof', TokenManager]),
})

but typeof params.infer didn't bring the correct type, instead it looks like:
    tokenManager: {
        refreshToken: Promise<TokenInfo>;
        readonly isTokenValid: boolean;
        readonly token: string | undefined;
    };

i.e. like some properties
Was this page helpful?