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.

Expose TS types from the main export

See original GitHub issue

Feature Request

Hello 👋,

Since an update from v2 to v3, the type, the following does not work anymore:

import * as mmd from 'music-metadata';

const test: mmd.IAudioMetadata = { ... }; // IAudioMetadata is not defined...

I managed to fix it by importing it with import { IAudioMetadata } from 'music-metadata/lib/type'; , but it kind of triggers my OCD 😄

Could we imagine putting the types back (or at least exporting them) to index.d.ts?

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
Borewitcommented, Mar 16, 2019

IPicture added in v3.5.3

1reaction
martpiecommented, Nov 22, 2018

🎉

screen shot 2018-11-22 at 10 43 56

Read more comments on GitHub >

github_iconTop Results From Across the Web

Documentation - Modules - TypeScript
Any declaration (such as a variable, function, class, type alias, or interface) can be exported by adding the export keyword. StringValidator.ts. ts. export...
Read more >
How to export types in a TypeScript npm module
Without declaration files you can develop a package in TypeScript, compile it and expose it to other users as JavaScript code.
Read more >
TypeScript: exposing module types in the global context and ...
MyLib.imports.ts import MyClassFromModule from 'moduleA' declare global { namespace MyLib { export type MyClass = MyClassFromModule; export ...
Read more >
[request] allow `export type * from` · Issue #37238 - GitHub
I just stumbled upon this. ... When publishing, we strip away TS types and compile to CJS. The types-only files becomes an empty...
Read more >
TypeScript library tips: Rollup your types! | by Martin Hochel
- On the left side, we have 3 TypeScript files, amongst which logger.ts contains private API parts that are not exposed via barrel...
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