-
Notifications
You must be signed in to change notification settings - Fork 15
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
Is dist/bundle.d.ts missing? #16
Comments
FWIW, if anyone else runs into it: I added a vue3-json-viewer.d.ts file in my custom typings/ dir set up in tsconfig.json like this:
Not even sure if this is the correct syntax, but it worked :p |
sp00x
changed the title
Is dist/bundle.d.ts missing in 2.2.2 ?
Is dist/bundle.d.ts missing?
Feb 5, 2023
Typescript Support
declare module 'vue3-json-viewer' {
import { AllowedComponentProps, App, Component, ComponentCustomProps, VNodeProps } from 'vue'
interface JsonViewerProps {
value: Object | Array<any> | string | number | boolean; //对象
expanded: boolean; //Auto expand?
expandDepth: number; //Expand Levels
copyable: boolean | object; //copiable
sort: boolean;
boxed: boolean;
theme: string;//"dark" | "light"
previewMode: boolean;
timeformat: (value: any) => string
}
type JsonViewerType = JsonViewerProps & VNodeProps & AllowedComponentProps & ComponentCustomProps
const JsonViewer: Component<JsonViewerType>
export { JsonViewer }
const def: { install: (app: App) => void }
export default def
} |
declare module 'vue3-json-viewer' {
import { AllowedComponentProps, App, Component, ComponentCustomProps, VNodeProps } from 'vue';
interface JsonViewerProps {
value: Record<string, unknown> | Array<any> | string | number | boolean;
expanded: boolean;
expandDepth: number;
copyable: boolean | object;
sort: boolean;
boxed: boolean;
theme: string; //"dark" | "light"
previewMode: boolean;
timeformat: (value: any) => string;
}
type JsonViewerType = JsonViewerProps & VNodeProps & AllowedComponentProps & ComponentCustomProps;
const JsonViewer: Component<JsonViewerType>;
export { JsonViewer };
const def: { install: (app: App) => void };
export default def;
} |
@qiuquanwu can you please add d.ts file to the package? |
@re2005 good fix on value type |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The
package.json
has"types": "dist/bundle.d.ts",
line but that referred file is not included in the npm installed files, leading to trying to include this project from a TypeScript project'smain.ts
resulting in a missing type declarations error.I had to add one manually in my typings/ dir and then it worked...
Checked 2.2.0 and 2.1.0 and it's not there either. Not sure for earlier versions.
The text was updated successfully, but these errors were encountered: