`d.ts` missing property.
See original GitHub issueHello, @timocov
first thx you for your hard work to create this package. it was pretty convenient to bundle a single ts without pain.
I installed dts-bundle-generator
globally, and clone the following package,
and then add npm i @types/react --save-dev
to fix the missing dependency.
https://github.com/chakra-ui/chakra-ui/tree/main/packages/visually-hidden
After the generation without any problems, I get the following .d.ts
files, it’s very legit.
// Generated by dts-bundle-generator v6.0.0
import * as React from 'react';
/**
* Styles to visually hide an element
* but make it accessible to screen-readers
*/
export declare const visuallyHiddenStyle: React.CSSProperties;
/**
* Visually hidden component used to hide
* elements on screen
*/
export declare const VisuallyHidden: import("@chakra-ui/system").ChakraComponent<"span", {}>;
/**
* Visually hidden input component for designing
* custom input components using the html `input`
* as a proxy
*/
export declare const VisuallyHiddenInput: import("@chakra-ui/system").ChakraComponent<"input", {}>;
export {};
But when I check the original files, I found out that there are some properties with literal
was missing from the .d.ts
files.
https://github.com/chakra-ui/chakra-ui/blob/a0de717c98e574e73f8a444f576fc738907230ab/packages/visually-hidden/src/visually-hidden.tsx#L9
May I know why the part of properties was strip away after creation.
My tsconfig:
{
"lib": ["dom", "esnext"],
"allowSyntheticDefaultImports": true,
"jsx": "react"
}
Issue Analytics
- State:
- Created 2 years ago
- Comments:5 (2 by maintainers)
Top GitHub Comments
Thx, my bad, you are right. I forgot it’s declaration file and mess it up with regular typescript files. Appreciate your patience to answer my silly questions
@aboveyunhai Not exactly. This kind of initializer is invalid in declaration files only since they make no sense for anybody It doesn’t matter what values are there, the more important is what types (this is the purpose of typings). Declaration files are about types, not about an actual values.
Not sure that get what you meant here.