Skip to content
This repository has been archived by the owner on Jan 30, 2023. It is now read-only.

Refactor export of type definitions #200

Open
jonkoops opened this issue Aug 4, 2020 · 0 comments
Open

Refactor export of type definitions #200

jonkoops opened this issue Aug 4, 2020 · 0 comments
Assignees
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed

Comments

@jonkoops
Copy link
Owner

jonkoops commented Aug 4, 2020

Right now we are exporting the types that are used from the root of the library as export { types }, meaning that you can import them and use them as follows:

import { types } from '@datapunt/matomo-tracker-js'

const options: types.UserOptions = {
  id: 1
}

From the perspective of shipping the types this makes very little sense, it also creates empty import statements which result in undefined values being exported in some bundlers.

This will have to be changed so the types are directly exported from the root package as follows:

export * from './types'

Which will make it possible to import these types directly:

import { UserOptions } from '@datapunt/matomo-tracker-js'

const options: UserOptions = {
  id: 1
}
@jonkoops jonkoops added enhancement New feature or request help wanted Extra attention is needed good first issue Good for newcomers labels Aug 4, 2020
@jonkoops jonkoops added this to the 0.2.0 milestone Aug 4, 2020
@jonkoops jonkoops self-assigned this Aug 4, 2020
@jonkoops jonkoops removed this from the 0.2.0 milestone Aug 31, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant