Hello. That is probably a silly question.
For me, register and async counterpart using useFactory seems trivial, but I'm not sure how to create providers when useExisting/useClass provided.
private static createStripeAsyncProvider(
options: typeof STRIPE_ASYNC_OPTIONS_TYPE,
): Provider | Promise<Provider> {
if (options.useFactory) {
const config = options.useFactory();
if (config instanceof Promise) {
return config.then((resolvedConfig) => {
return this.createStripeProvider(resolvedConfig);
});
} else {
return this.createStripeProvider(config);
}
}
if (options.useClass) {
// ?
}
if (options.useExisting) {
// ?
}
throw new Error('Invalid Stripe async options');
}