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

Declaration file for Typescript #11

Open
tdonhauser opened this issue Sep 7, 2023 · 1 comment
Open

Declaration file for Typescript #11

tdonhauser opened this issue Sep 7, 2023 · 1 comment

Comments

@tdonhauser
Copy link

Hello,

is there a declaration file to use with Typescript? npm i --save-dev @types/ga-gtag doesn't exist.
Thanks!

@adiffmike
Copy link

This may not be complete here's a quick workaround add the gtag.js types package to your project @types/gtag.js (make sure that this is picked up from your compilerOptions.types array or typeRoots.

If you've already created a declaration file as a placeholder then you should be able to change it to

declare module 'ga-gtag' { export function install(id: string) export type gtag = Gtag.Gtag }

The Gtag.Gtag type comes from the @types/gtag.js types

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