pouchdb-community / pouchdb-adapter-cordova-sqlite

PouchDB adapter for Cordova SQLite. Designed for PouchDB 6+.
Apache License 2.0
73 stars 32 forks source link

Typescript error with cordova-sqlite adapter #73

Open julienkermarec opened 7 years ago

julienkermarec commented 7 years ago

Hello,

I have a typescript error with the cordova-sqllite adapter :

Argument of type '{adapter:"cordova-sqlite";} is not assignable to parameter of type 'FruitDOWNAdapterConfiguration' Types of property 'adapter' are incompatible. Type "cordova-sqlite" is not assignable to type '"fruitdown"'

erreur typescript adapter cordov-sqlite
ghost commented 7 years ago

Hello,

@julienkermarec have you solve this issue? im also having the same error.

julienkermarec commented 7 years ago

No, i have always this problem.

The compilation works, but i have this typescript error

pablomaurer commented 6 years ago
import PouchDB from "pouchdb";
import PouchCdvAdapter from "pouchdb-adapter-cordova-sqlite";

PouchDB.plugin(PouchCdvAdapter);

works for me.

paolosanchi commented 6 years ago

@julienkermarec, hope you already solved.

This works for me:

import PouchDB from 'pouchdb';
import PouchDBAdapterCordovaSqlite from 'pouchdb-adapter-cordova-sqlite';
[...]
PouchDB.plugin(PouchDBAdapterCordovaSqlite);
[...]
this.db = new PouchDB('favoris', {adapter: 'cordova-sqlite') as any);

note the "as any"