-
Notifications
You must be signed in to change notification settings - Fork 29.9k
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
elasticlunr: add type definitions #21779
Conversation
types/elasticlunr/configuration.d.ts Checklist
types/elasticlunr/document_store.d.ts Checklist
types/elasticlunr/event_emitter.d.ts Checklist
types/elasticlunr/index.d.ts Checklist
types/elasticlunr/indexr.d.ts Checklist
types/elasticlunr/inverted_indexr.d.ts Checklist
types/elasticlunr/pipeline.d.ts Checklist
types/elasticlunr/sorted_set.d.ts Checklist
types/elasticlunr/stemmer.d.ts Checklist
types/elasticlunr/stop_word_filter.d.ts Checklist
types/elasticlunr/tokenizer.d.ts Checklist
types/elasticlunr/trimmer.d.ts Checklist
types/elasticlunr/types.d.ts Checklist
types/elasticlunr/utils.d.ts Checklist
|
@AbraaoAlves The Travis CI build failed! Please review the logs for more information. Once you've pushed the fixes, the build will automatically re-run. Thanks! |
After 5 days, no one has reviewed the PR 😞. A maintainer will be reviewing the PR in the next few days and will either merge it or request revisions. Thank you for your patience! |
@@ -0,0 +1,40 @@ | |||
import * as elasticlunr from 'elasticlunr'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Classes and functions cannot be imported using import * as
syntax. Please fix either the test or the definition file to use a correct import form.
@AbraaoAlves Thank you for submitting this PR! Because this is a new definition, a DefinitelyTyped maintainer will be reviewing this PR in the next few days once the Travis CI build passes. In the meantime, if the build fails or a merge conflict occurs, I'll let you know. Have a nice day! |
* | ||
* @constructor | ||
* | ||
* @param {String} config user configuration |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't include types in JSDoc, use TypeScript type declarations instead.
* | ||
* @param {String} config user configuration | ||
* @param {Array} fields fields of index instance | ||
* @module |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This doesn't seem like a module?
* idx.search('oracle database', {fields: {title: {boost: 2}, body: {boost: 1}}}); | ||
* | ||
* | ||
* @constructor |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Avoid unnecessary jsdoc tags like @constructor
, @module
and @memberOf
-- this is clearly a constructor, we don't need documentation for that.
@@ -0,0 +1,123 @@ | |||
/*! | |||
* elasticlunr.DocumentStore | |||
* Copyright (C) @YEAR Wei Song |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If the type definitions aren't under copyright, this comment shouldn't be included. (If they are, we'll have to review the license before merging.)
* | ||
* @param {Integer|String} docRef document id or reference | ||
* @param {String} fieldName field name | ||
* @return {Integer} field length |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If it returns an integer, the return type should be number
.
// Project: https://github.com/weixsong/elasticlunr.js | ||
// Definitions by: Abraão Alves <https://github.com/abraaoalves> | ||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped | ||
// TypeScript Version: 2.5.2 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If possible use a lower version. Also, this can only be 2.X
, not 2.X.Y
.
"extends": "dtslint/dt.json", | ||
"no-any-union": false, | ||
"rules": { | ||
"no-any-union": false, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please re-enable these lint rules, they are important warnings.
A type number | any
will be interpreted as just any
, so we warn for that. (In general try to avoid using any
at all.)
Please fill in this template.
npm run lint package-name
(ortsc
if notslint.json
is present).Select one of these and delete the others:
If adding a new definition:
dts-gen --dt
, not by basing it on an existing project.tslint.json
should be present, andtsconfig.json
should havenoImplicitAny
,noImplicitThis
,strictNullChecks
, andstrictFunctionTypes
set totrue
.