mjbondra / koa-session-mongoose

Mongoose store for Koa sessions
MIT License
29 stars 8 forks source link

Could not find a declaration file for module 'koa-session-mongoose' #15

Open berton1982 opened 4 years ago

berton1982 commented 4 years ago

i try to import it in a ts script. but it complains "Could not find a declaration file for module 'koa-session-mongoose'”;

i tried to add types.d.ts as follow, but wont work. please help `import { Session, opts } from "koa-session";

// import mongoose from 'mongoose'; // import * as MongooseStore from "koa-session-mongoose"; declare module "koa-session-mongoose" { interface Config { collection?: string; connection?: any; expires?: number; name?: string; } class MongooseStore { constructor(param: Config); /**

Johnpc123 commented 1 year ago

Node v14 added the ?? operator which mongoose uses, updating from node v12 to node v14 solved this issue for me.