Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No declaration file found in TypeScript/VS Code #1

Open
weber-d opened this issue Apr 23, 2018 · 1 comment
Open

No declaration file found in TypeScript/VS Code #1

weber-d opened this issue Apr 23, 2018 · 1 comment

Comments

@weber-d
Copy link

weber-d commented Apr 23, 2018

Using a TypeScript 2.8.1 project in VS Code 1.22.2, I got the error

src/main.ts(23,24): error TS7016: Could not find a declaration file for module 'couchdb-expression'. 'node_modules/couchdb-expression/lib/index.js' implicitly has an 'any' type.
Try npm install @types/couchdb-expression if it exists or add a new declaration (.d.ts) file containing declare module 'couchdb-expression';

when importing the module in line

import Expression from "couchdb-expression";

Sadly, it seems that no typings-package exist. Also the declare module line cause another error, that "couchdb-expression" was resolved in a not-typed module.

I also tried

import { Expression } from "couchdb-expression";
import * as Expression from "couchdb-expression";
import Expression = require("couchdb-expression");
const Expression = require("couchdb-expression");

Only the last one const Expression = require("couchdb-expression"); doesn't show me an error in VS Code. But after compiling, I get

error TS7016: Could not find a declaration file for module 'couchdb-expression'. 'node_modules/couchdb-expression/lib/index.js' implicitly has an 'any' type.

So it seems completely unusable with TS...

@tkshnwesper
Copy link
Owner

tkshnwesper commented Oct 19, 2018

I have to apologize for my late response, and my badly documented repository.

Typescript support is something I will need to implement in the future, but for now, the module can be imported like such:

const session = require('express-session');
const Expression = require('couchdb-expression')(session);

Sorry for all the trouble!

tkshnwesper added a commit that referenced this issue Oct 20, 2018
tkshnwesper added a commit that referenced this issue Oct 20, 2018
tkshnwesper added a commit that referenced this issue Oct 20, 2018
implemented length

added all method

changed repo, main, name

1.0.1-0

added postinstall build script

1.0.1

added in lib

1.0.2-0

forgot to remove postinstall

1.0.3-0

changed includes to indexOf [incompat]

1.0.3

added devDeps for testing

added touch

added some more validations

1.0.4

added readme

added license

1.0.5

made doc more elaborate

1.0.6

oh shit, removed trailing ')'

1.0.7

added some more validations

1.0.8

forgot to build

1.1.0

just solved a big bug in setting cookie

1.1.1

forgot to build again

1.1.2

added rev to set method to prevent document update conflicts

1.1.3

my goodness, now that's the 3rd time I forgot to build

1.1.4

fixed error that occurs when underscores are used as _ids

1.1.5

forgot to build

1.1.6

forgot the return statements

1.1.7

refactored

1.2.0

trying to fix race conds

1.2.1

changed a little bit of doc

1.2.2

Adds tests | upgrades dependencies | adds eslint

1.3.0

Updates README with updated sample program and MD reformatting

1.3.1

Updates dependency in README

1.3.2

fixes npm vulnerabilities

1.3.3

removes babel-register and adds compiling .js files using babel into lib

1.3.4

Changes file path in index.js

1.3.5

Adds tests

1.3.6

Adds babel register

1.3.7

Simplified build operation

Adds travis support, coverage on source files

1.3.8

changes name and password to blank

1.3.9

changes hostname

Fixes tests on travis

removes table calls to `_`

travis attempt #0

travis attempt #1

travis attempt #3

travis attempt #4

travis golden attempt

golden attempt #1

travis docker attempt

runs couchdb as daemon

adds coverage script to run post build

1.4.0

Adds license, snyk and fury badges

adds npm badge
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants