I'm trying to get TypeScript types working with the stripe-node library in Deno. I've tried this:
/// <reference types="https://esm.sh/v99/stripe@11.1.0/types/2022-11-15/index.d.ts" />
import Stripe from "https://esm.sh/stripe@11.1.0?target=deno";
export const stripeClient = new Stripe(
Deno.env.get("STRIPE_SECRET_KEY") as string,
{
apiVersion: "2022-11-15",
httpClient: Stripe.createFetchHttpClient(),
}
);
but stripeClient is still coming up with type any.
When I use npm module compatibility mode:
import Stripe from 'npm:stripe@11.1.0';
the types are automagically picked up, but unfortunately the environment I'm targeting doesn't support npm module compatibility yet.
Any way to get the types via esm.sh working as expected?