Separate module with typings only
See original GitHub issueHi,
Thanks for this amazing project ❤️ We are a publisher and use it to test and integrate the new TCF 2 consent platform.
As a publisher we don’t implement our own CMP, but we integrate with a cmp provider and use the _tcfapi
to check purpose and vendor consents for 3rd party modules we have integrated (e.g. google analytics).
It would be very helpful if the typings for the __tcfapi
interface would be available as a separate module that we could use. At the moment we are writing the typings ourselves and the ones in this project are a bit scattered over the core
and cmpapi
module.
thanks a lot for your work, Muki
Issue Analytics
- State:
- Created 3 years ago
- Comments:8
Top Results From Across the Web
Defining Typescript module typings on separate file
I have project with a few components containing a large set of types and interfaces. For example, src/components/MyComponent.tsx .
Read more >Documentation - Modules - TypeScript
How modules work in TypeScript. ... function, class, interface, etc. exported from a different module, ... Import a module for side-effects only.
Read more >Declaring typings for modules in subfolders #17945 - GitHub
This behavior only occurs if the typings are used inside an npm-module. Using the (linked) typigns locally or inside @types/material-ui ...
Read more >Typescript Typings: The Complete Guide: @types Compiler ...
This means that the types are shipped directly inside the node module itself, and don't have to be installed separately. Let's start with...
Read more >How to create strongly-typed npm packages - Medium
Answer: Ambient module declarations. Ambient module declarations allow you to ship the typings of a package separately from the package ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@muuki88 I’ve cleaned up the exported interfaces quite a bit in the @iabtcf/cmpapi package. I just released this in pre-minor version 1.1.0-0. This should help calling scripts, let me know if it works for you
It looks like DefinitelyTyped only wants modules for non-typescript projects. Since this project is all written in TypeScript you should have access to the types by including the modules in your dependencies. I don’t think it needs its own type-only module. That being said let me make the
@iabtcf/cmpapi
types more accessible for a publisher.