Coder Social home page Coder Social logo

Comments (5)

philippedasilva-orizone avatar philippedasilva-orizone commented on July 24, 2024 3

My quick and dirty solution to get it working @SamCcp if you didn't manage to have it working yet is using the followiing approach (this is a workaround and won't provide you with any typing):

  1. Create a folder in your src and call it @types.
  2. Create inside this folder a file named alltypes.d.ts
  3. In this newly created file, just add this line declare module 'localbase';
  4. In your tsconfig.json file, insert "typeRoots": ["node_modules/@types", "src/@types"] in your 'compilerOptions'

Reload your project to reload TS analyser in your IDE if it doesn't automatically and you should be good.

@dannyconnell btw, have you started or thought working on a typescript definition for Localbase or not? If not, I may actually do so and I'll send a PR ;) (don't know where to start but I'm a quick learner and I should figure it out :) )

from localbase.

SamCcp avatar SamCcp commented on July 24, 2024 2

Thanks for your reply @philippedasilva-orizone.

But the quickest ( and dirtiest ) solution I used is a plain and simple //@ts-ignore on my localbase import.
I've been trying to create a module definition of my own but hadn't had the chance yet, maybe we should team up on this?

Cheers!

from localbase.

SamCcp avatar SamCcp commented on July 24, 2024

Have you managed to make this work with typescript intellisense?

from localbase.

philippedasilva-orizone avatar philippedasilva-orizone commented on July 24, 2024

Sure thing, I'll let you know here when I'll get started linking a fork I'd use to work on this typescript friendly port ;)

from localbase.

VidTDM avatar VidTDM commented on July 24, 2024

@philippedasilva-orizone I tried this but when I compile it has an require statement for ordered-uuid. I'm using react with typescript.

from localbase.

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.