GithubHelp home page GithubHelp logo

Comments (6)

windmaomao avatar windmaomao commented on July 4, 2024 1

I'm newbie for typings. Since I am using angular2 cli, they have a build system, what I did is to put

    declare module 'relational-pouch';

in typings.d.ts under src. And then in your own file reference them as.

    import * as PouchDB from 'pouchdb';
    import * as Relational from 'relational-pouch';
    PouchDB.plugin(Relational);

I did import pouchdb typings, so that one has no issue. Once i declare the module, seems everything is fine to me. I'm using it now. If I need to do createIndex, I'll have to do the same thing with package pouchdb-find.

In short, I didn't use the approach outlined in above thread. Of course angular2 cli build might be doing its own thing.

from relational-pouch.

broerse avatar broerse commented on July 4, 2024

It seems we can do the same fix for relational-pouch but can we test is? I don't know typescript. Can you test it?

from relational-pouch.

broerse avatar broerse commented on July 4, 2024

Looks good! Can this issue be closed?

from relational-pouch.

lakinmohapatra avatar lakinmohapatra commented on July 4, 2024

I am facing issues while including it in typescript. ANy help will be greatly appreciated.

from relational-pouch.

lakinmohapatra avatar lakinmohapatra commented on July 4, 2024

Promise.resolve is not a function error

from relational-pouch.

danobot avatar danobot commented on July 4, 2024

Facing this save issue, doing the steps suggested by @windmaomao. THe compiler complains about the import * as PouchDB from 'pouchdb'; throwing a warning:

55:8-22 "export 'plugin' (imported as 'PouchDB') was not found in 'pouchdb'

This compiles at the very least:

import PouchDB from 'pouchdb';
import * as Relational from 'relational-pouch';
PouchDB.plugin(Relational); // in constructor

I found this is the only way to get it to compile correctly but then I get the Promise.resolve is not a function error.

from relational-pouch.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.