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

Add top-level type definition for DayPickerInput #762

Merged
merged 1 commit into from Aug 25, 2018

Conversation

5 participants
@kryops
Contributor

kryops commented Jul 29, 2018

This allows importing from 'react-day-picker/DayPickerInput' from TypeScript.
Fixes #586

I chose to keep the existing type definitions for DayPickerInput in the types folder and only reference them from the new top-level definition file. Alternatively, the existing definition file could be moved up to the top level as well, but this would be a breaking change for TypeScript consumers.

The new file also takes care of exporting the DayPickerInput correctly as default export (see #586 (comment))

Add top-level type definition for DayPickerInput.
This allows importing from 'react-daypicker/DayPickerInput' from TypeScript.
Fixes #586
@codecov

This comment has been minimized.

Show comment
Hide comment
@codecov

codecov bot Jul 29, 2018

Codecov Report

Merging #762 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #762   +/-   ##
=======================================
  Coverage   99.84%   99.84%           
=======================================
  Files          15       15           
  Lines         645      645           
  Branches      141      141           
=======================================
  Hits          644      644           
  Misses          1        1

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update bb771db...1eecd04. Read the comment docs.

codecov bot commented Jul 29, 2018

Codecov Report

Merging #762 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #762   +/-   ##
=======================================
  Coverage   99.84%   99.84%           
=======================================
  Files          15       15           
  Lines         645      645           
  Branches      141      141           
=======================================
  Hits          644      644           
  Misses          1        1

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update bb771db...1eecd04. Read the comment docs.

@tomalexhughes

This comment has been minimized.

Show comment
Hide comment
@tomalexhughes

tomalexhughes Aug 14, 2018

@gpbl Any chance of this being merged? :)

tomalexhughes commented Aug 14, 2018

@gpbl Any chance of this being merged? :)

@nucleartux

This comment has been minimized.

Show comment
Hide comment
@nucleartux

nucleartux Aug 23, 2018

@gpbl please merge, without this PR I can't use this library on my current project :(

nucleartux commented Aug 23, 2018

@gpbl please merge, without this PR I can't use this library on my current project :(

@kryops

This comment has been minimized.

Show comment
Hide comment
@kryops

kryops Aug 24, 2018

Contributor

@nucleartux you should be able to add the typings manually as a workaround.

  1. Add a file containing the type definition to a folder that you use for types (e.g. src/@types):

[src/@types/react-day-picker.d.ts]

declare module 'react-day-picker/DayPickerInput' {
    import { DayPickerInput } from 'react-day-picker/types/DayPickerInput'
    export default DayPickerInput
}
  1. Add the directory to typeRoots in your tsconfig.json:
"typeRoots": ["node_modules/@types", "src/@types"],
Contributor

kryops commented Aug 24, 2018

@nucleartux you should be able to add the typings manually as a workaround.

  1. Add a file containing the type definition to a folder that you use for types (e.g. src/@types):

[src/@types/react-day-picker.d.ts]

declare module 'react-day-picker/DayPickerInput' {
    import { DayPickerInput } from 'react-day-picker/types/DayPickerInput'
    export default DayPickerInput
}
  1. Add the directory to typeRoots in your tsconfig.json:
"typeRoots": ["node_modules/@types", "src/@types"],

@gpbl gpbl merged commit d616361 into gpbl:master Aug 25, 2018

3 checks passed

ci/circleci: checkout-and-test Your tests passed on CircleCI!
Details
codecov/patch Coverage not affected when comparing bb771db...1eecd04
Details
codecov/project 99.84% remains the same compared to bb771db
Details

@gpbl gpbl added this to the v7.2.0 milestone Aug 27, 2018

@nnic

This comment has been minimized.

Show comment
Hide comment
@nnic

nnic Aug 29, 2018

This file does not seem to be present in the the npm module - does it need to be explicitly added to the package.json?

nnic commented Aug 29, 2018

This file does not seem to be present in the the npm module - does it need to be explicitly added to the package.json?

@kryops

This comment has been minimized.

Show comment
Hide comment
@kryops

kryops Aug 29, 2018

Contributor

@nnic sorry my bad 😞
I created #784 to add it.

Contributor

kryops commented Aug 29, 2018

@nnic sorry my bad 😞
I created #784 to add it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment