-
Notifications
You must be signed in to change notification settings - Fork 161
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
TypeDefinition for this library? #51
Comments
I have the same problem. Here are few details more from my node.js apprication:
Installed lunr types with Tried to merge |
I encountered the same problem and ended up not using @types/lunr at all. |
Here is what I use on my project: // lunr-languages.d.ts
declare module 'lunr-languages/lunr.*' {
import lunr from 'lunr';
function register(l: typeof lunr): void;
export = register;
} // lunr.d.ts
import { Builder } from 'lunr';
declare module 'lunr' {
function multiLanguage(...lang: string[]): Builder.Plugin;
} Put those files in your project's root and it should work automatically. |
Fantastic! Thanks @ultimaweapon ! |
Will lunr-language allow typescript imports to import "lunr-languages/lunr.stemmer.support", "lunr-languages/lunr.multi" and "lunr-languages/lunr.<locale>"?
The workaround is to require(....)(lunr) to add functions to the prototype of lunr and call them in typescript code.
I am not sure how to write the corresponding typedef.d.ts files nor can they be port to typedef files at all.
Please kindly advise.
The text was updated successfully, but these errors were encountered: