OCA.js | A JavaScript OCA controller library | Model View Controller library
kandi X-RAY | OCA.js Summary
kandi X-RAY | OCA.js Summary
A JavaScript OCA controller library
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of OCA.js
OCA.js Key Features
OCA.js Examples and Code Snippets
Community Discussions
Trending Discussions on OCA.js
QUESTION
ANSWER
Answered 2019-Feb-27 at 15:25The issue here is that you have written your plugin in TypeScript. So at a minimum, there are two type definitions:
- index.d.ts - Contains type definitions for
index.ts
file after compilation - vue.d.ts - Contains your Vue.js module augmentation code for the Vue plugin.
Now your package.json
has types/typings
field is pointing to vue.d.ts
. For TypeScript, when this library is imported, it infers the module augmentation code. It can never find at index.d.ts
file. So, in your Vue component, this.$voca()
will work with TS but not import { VueCoca } from 'vue-coca';
As a solution, set your types
field to /index.d.ts
file. Also, rename vue.d.ts
to augment.d.ts
for the sake of brevity. The caller of this library should then write his own typings file - *.d.ts file where he will import this file like:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install OCA.js
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page