Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

export types #34

Open
binaryartifex opened this issue Oct 4, 2023 · 1 comment
Open

export types #34

binaryartifex opened this issue Oct 4, 2023 · 1 comment

Comments

@binaryartifex
Copy link

any chance of exporting the VerifyCallback and Options types? typescript isn't inferring the super class at all when used as part of a nestjs implementation...

import { Injectable } from "@nestjs/common";
import { PassportStrategy } from "@nestjs/passport";
import Strategy from "passport-magic-login";

@Injectable()
export class MagicLoginStrategy extends PassportStrategy(Strategy) {
  constructor() {
    super({...} as Options); // <-- would be nice to cast to the Option type here instead of digging through the type declarations
  }
}
@adrianbienias
Copy link

adrianbienias commented Jan 20, 2024

Workaround:

// ...
import Strategy from "passport-magic-login";
// ...
type Options = ConstructorParameters<typeof Strategy>[number];
// ...
    super({...} as Options);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants