Open jkourou opened 1 year ago
This maybe help: in src directory, create file vue-json-viewer.d.ts
declare module 'vue-json-viewer' {
import { AllowedComponentProps, App, Component, ComponentCustomProps, VNodeProps } from 'vue'
interface JsonViewerProps {
value: Object | Array<any> | string | number | boolean;
expanded: boolean;
expandDepth: number;
copyable: boolean | object;
sort: boolean;
boxed: boolean;
theme: string;
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
}
This maybe help: in src directory, create file vue-json-viewer.d.ts
declare module 'vue-json-viewer' { import { AllowedComponentProps, App, Component, ComponentCustomProps, VNodeProps } from 'vue' interface JsonViewerProps { value: Object | Array<any> | string | number | boolean; expanded: boolean; expandDepth: number; copyable: boolean | object; sort: boolean; boxed: boolean; theme: string; 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 }
has this hint:
I use vue-json-pretty instead
Hey
Typescript projects getting missing declaration for your module when importing it. You should add a declaration so we do not have to do it manually. Thank you!
Error: