Currently, I am in need of a file storage database and after some research, it appears that UploadFS
is the most suitable option for my project. My development involves Angular2 typescript and Meteor.
meteor add jalik:ufs-gridfs
However, I am encountering an issue when attempting to import the library using the following code:
import {UploadFS} from 'meteor/jalik:ufs'
An error message indicates that the library cannot be found (on the client side).
I speculated that the problem could be due to the library being in javascript
, while the rest of my project is in
typescript</code. As a solution, I tried creating a stub file <code>ufs.d.ts
first manually, then with dstmake, and finally by hand again after realizing that I needed to export the module UploadFS
for meteor (barbatus:typescript?) to recognize it:
declare module 'meteor/jalik:ufs' {
export module UploadFS{
interface UploadFS {
...
}
}
}
Initially, I placed my ufs.d.ts
stub file in the typings/
folder and linked it in the main.d.ts
. No errors occurred during compilation. Meteor confirmed that the DB was successfully created... but later on, issues emerged when attempting to use it.
Further investigation revealed that UploadFS was undefined, suggesting that despite successful compilation by Meteor, the library was not properly referenced.
At this point, it seems like my only option is to manually translate jalik:ufs
and jalik:ufs-gridfs
to typescript. Is there an easier method to get ufs working with angular2-meteor?
Would you recommend considering alternative storage solutions? Any advice on resolving issues with this library or selecting a different one?