question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Separate module with typings only

See original GitHub issue

Hi,

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:closed
  • Created 3 years ago
  • Comments:8

github_iconTop GitHub Comments

1reaction
chrispatersoncommented, Jul 10, 2020

@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

1reaction
chrispatersoncommented, Jun 10, 2020

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found