You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// Initializes the `files` service on path `/api/v1/files`import{ServiceAddons}from'@feathersjs/feathers';importBlobServicefrom'feathers-blob';importmulterfrom'multer';import{Application}from'../../declarations';importloggerfrom'../../logger';importhooksfrom'./files.hooks';interfaceData{}interfaceServiceOptions{}// Add this service to the service type indexdeclare module '../../declarations'{interfaceServiceTypes{'api/v1/files': ServiceAddons<any>;}}constlog=(msg)=>logger.info('[File Service]: '+msg)constmultipartMiddleware=multer();exportdefaultfunction(app: Application){conststoreOptions=app.get('blobStore');letstore;if(storeOptions.type==='local'){log('Creating new local blob store:'+storeOptions.path)constBlobStore=require('fs-blob-store');store=BlobStore(storeOptions.path);}elseif(storeOptions.type==='s3'){constAWS=require('aws-sdk');constBlobStore=require('s3-blob-store')log('Creating new s3 blob store:'+storeOptions.bucket)AWS.config.update(storeOptions);consts3=newAWS.S3();store=newBlobStore({client: s3,bucket: storeOptions.bucket,});}constFiles=new(BlobServiceasany)({Model: store,})app.use('/api/v1/files',// multer parses the file named 'uri'.// Without extra params the data is// temporarely kept in memorymultipartMiddleware.single('uri'),// another middleware, this time to// transfer the received file to feathersfunction(req: any,res: any,next){req.feathers.file=req.file;next();},Files,);// Get our initialized service so that we can register hooksconstservice=app.service('api/v1/files');service.hooks(hooks);}
running tsc from the npm run compile command gives this error.
"compile": "rm -rf lib/ && tsc"
(First please check that this issue is not already solved as described
here)
Expected behavior
Feathers blob works with typescript
Actual behavior
node_modules/feathers-blob/types/index.d.ts:34:12 - error TS2709: Cannot use namespace 'AbstractBlobStore' as a type.
34 Model: AbstractBlobStore;
~~~~~~~~~~~~~~~~~
Found 1 error.
System configuration
Tell us about the applicable parts of your setup.
Module versions (especially the part that's not working):
Steps to reproduce
Using files.service.ts like so:
running tsc from the
npm run compile
command gives this error.(First please check that this issue is not already solved as described
here)
Expected behavior
Feathers blob works with typescript
Actual behavior
System configuration
Tell us about the applicable parts of your setup.
Module versions (especially the part that's not working):
NodeJS version:
14.14.0
Operating System:
MacOS
Browser Version:
Firefox
The text was updated successfully, but these errors were encountered: