mirror of
https://github.com/FlipsideCrypto/DefinitelyTyped.git
synced 2026-02-06 10:56:53 +00:00
[lunr] Refine Builder.fieid argument type (#43044)
This commit is contained in:
parent
8379f5d24f
commit
bcba5e2eaf
6
types/lunr/index.d.ts
vendored
6
types/lunr/index.d.ts
vendored
@ -131,10 +131,10 @@ declare namespace lunr {
|
||||
* importance when ranking search results. Use a field boost to specify that matches
|
||||
* within one field are more important than other fields.
|
||||
*
|
||||
* @param field - The name of a field to index in all documents.
|
||||
* @param fieldName - The name of a field to index in all documents.
|
||||
* @param attributes - Optional attributes associated with this field.
|
||||
*/
|
||||
field(field: string, attributes?: object): void;
|
||||
field(fieldName: string, attributes?: { boost?: number, extractor?: (doc: object) => string | object | object[] }): void;
|
||||
|
||||
/**
|
||||
* A parameter to tune the amount of field length normalisation that is applied when
|
||||
@ -171,7 +171,7 @@ declare namespace lunr {
|
||||
* @param doc - The document to add to the index.
|
||||
* @param attributes - Optional attributes associated with this document.
|
||||
*/
|
||||
add(doc: object, attributes?: object): void;
|
||||
add(doc: object, attributes?: { boost?: number }): void;
|
||||
|
||||
/**
|
||||
* Builds the index, creating an instance of lunr.Index.
|
||||
|
||||
@ -22,6 +22,7 @@ function basic_test() {
|
||||
title: "Bar",
|
||||
body: "Bar bar bar!"
|
||||
});
|
||||
this.use((builder: lunr.Builder) => builder.field("text"));
|
||||
});
|
||||
|
||||
index.search("foo");
|
||||
|
||||
Loading…
Reference in New Issue
Block a user