Typings definitons for Typscript
See original GitHub issueI’m trying to use lunr in a fresh Angular 2 app installed with the cli.
In the app.module.ts I’m trying to import lunr with
import { lunr } from 'lunr';
But I keep getting errors about that not being a module, or it not finding it. (yes lunr is in the node_modules folder)
I think/guess that it needs a Typings definition? I found this one. But it seems to be considerably out of date, and doesn’t solve the problem https://www.npmjs.com/package/@types/lunr
Or is that not what I need?
TIA
Issue Analytics
- State:
- Created 7 years ago
- Reactions:4
- Comments:19 (9 by maintainers)
Top Results From Across the Web
Documentation - Type Declarations - TypeScript
Built-in Type Definitions. TypeScript includes declaration files for all of the standardized built-in APIs available in JavaScript runtimes.
Read more >Typescript Typings: The Complete Guide: @types Compiler ...
The @types scope package contains type definitions for a lot of libraries, like Express, Sequelize, JQuery, and many others. So definitively ...
Read more >typings/typings: *DEPRECATED* The TypeScript Definition ...
Typings is the simple way to manage and install TypeScript definitions. It uses typings.json , which can resolve to the Typings Registry, GitHub,...
Read more >Surviving the TypeScript Ecosystem — Part 4 - Medium
The solution is to make a type definition file. A type definition file is a file that ends in “.d.ts”. It is a...
Read more >TypeScript: Adding Custom Type Definitions for Existing ...
In this case, we're going to make a new folder inside our src folder called customTypings to hold all our definition files, and...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@kchiragowni : As @gnomeontherun said, there is really nothing special to do.
If you are using angular cli :
In tsconfig.json, add :
And in your component ts file, you can do the same thing as in the lunr guide :
I’m happy to re-open the issue as I think having TypeScript definitions would be awesome.
That said, I really don’t think they should live in this repository.
I’m not familiar with the process of creating a typings file, can this not be something that is automated for each new release? Or some kind of test that can highlight missing or incorrect typings?
Do you have some examples of other JavaScript libraries and where they keep their type definitions?