@types/lunr
Advanced tools
Comparing version 2.1.2 to 2.1.3
@@ -118,3 +118,3 @@ // Type definitions for lunr.js 2.1 | ||
* | ||
* @param {string} ref - The name of the reference field in the document. | ||
* @param ref - The name of the reference field in the document. | ||
*/ | ||
@@ -131,3 +131,3 @@ ref(ref: string): void; | ||
* | ||
* @param {string} field - The name of a field to index in all documents. | ||
* @param field - The name of a field to index in all documents. | ||
*/ | ||
@@ -142,3 +142,3 @@ field(field: string): void; | ||
* | ||
* @param {number} number - The value to set for this tuning parameter. | ||
* @param number - The value to set for this tuning parameter. | ||
*/ | ||
@@ -152,3 +152,3 @@ b(number: number): void; | ||
* | ||
* @param {number} number - The value to set for this tuning parameter. | ||
* @param number - The value to set for this tuning parameter. | ||
*/ | ||
@@ -167,3 +167,3 @@ k1(number: number): void; | ||
* | ||
* @param {object} doc - The document to add to the index. | ||
* @param doc - The document to add to the index. | ||
*/ | ||
@@ -178,3 +178,2 @@ add(doc: object): void; | ||
* | ||
* @returns {lunr.Index} | ||
*/ | ||
@@ -195,3 +194,3 @@ build(): Index; | ||
* | ||
* @param {Function} plugin The plugin to apply. | ||
* @param plugin The plugin to apply. | ||
*/ | ||
@@ -250,4 +249,3 @@ use(plugin: Builder.Plugin, ...args: any[]): void; | ||
* @callback lunr.Index~queryBuilder | ||
* @param {lunr.Query} query - The query object to build up. | ||
* @this lunr.Query | ||
* @param query - The query object to build up. | ||
*/ | ||
@@ -321,5 +319,4 @@ type QueryBuilder = (this: Query, query: Query) => void; | ||
* | ||
* @param {lunr.Index~QueryString} queryString - A string containing a lunr query. | ||
* @param queryString - A string containing a lunr query. | ||
* @throws {lunr.QueryParseError} If the passed query string cannot be parsed. | ||
* @returns {lunr.Index~Result[]} | ||
*/ | ||
@@ -341,4 +338,3 @@ search(queryString: Index.QueryString): Index.Result[]; | ||
* | ||
* @param {lunr.Index~queryBuilder} fn - A function that is used to build the query. | ||
* @returns {lunr.Index~Result[]} | ||
* @param fn - A function that is used to build the query. | ||
*/ | ||
@@ -353,3 +349,2 @@ query(fn: Index.QueryBuilder): Index.Result[]; | ||
* | ||
* @returns {Object} | ||
*/ | ||
@@ -361,4 +356,3 @@ toJSON(): object; | ||
* | ||
* @param {Object} serializedIndex - A previously serialized lunr.Index | ||
* @returns {lunr.Index} | ||
* @param serializedIndex - A previously serialized lunr.Index | ||
*/ | ||
@@ -380,5 +374,5 @@ static load(serializedIndex: object): Index; | ||
/** | ||
* @param {string} term - The term this match data is associated with | ||
* @param {string} field - The field in which the term was found | ||
* @param {object} metadata - The metadata recorded about this term in this field | ||
* @param term - The term this match data is associated with | ||
* @param field - The field in which the term was found | ||
* @param metadata - The metadata recorded about this term in this field | ||
*/ | ||
@@ -393,3 +387,3 @@ constructor(term: string, field: string, metadata: object) | ||
* | ||
* @param {lunr.MatchData} otherMatchData - Another instance of match data to merge with this one. | ||
* @param otherMatchData - Another instance of match data to merge with this one. | ||
* @see {@link lunr.Index~Result} | ||
@@ -414,7 +408,5 @@ */ | ||
* | ||
* @interface lunr.PipelineFunction | ||
* @param {lunr.Token} token - A token from the document being processed. | ||
* @param {number} i - The index of this token in the complete list of tokens for this document/field. | ||
* @param {lunr.Token[]} tokens - All tokens for this document/field. | ||
* @returns {(?lunr.Token|lunr.Token[])} | ||
* @param token - A token from the document being processed. | ||
* @param i - The index of this token in the complete list of tokens for this document/field. | ||
* @param tokens - All tokens for this document/field. | ||
*/ | ||
@@ -466,4 +458,4 @@ type PipelineFunction = ( | ||
* | ||
* @param {lunr.PipelineFunction} fn - The function to check for. | ||
* @param {String} label - The label to register this function with | ||
* @param fn - The function to check for. | ||
* @param label - The label to register this function with | ||
*/ | ||
@@ -479,4 +471,3 @@ static registerFunction(fn: PipelineFunction, label: string): void; | ||
* | ||
* @param {Object} serialised - The serialised pipeline to load. | ||
* @returns {lunr.Pipeline} | ||
* @param serialised - The serialised pipeline to load. | ||
*/ | ||
@@ -490,3 +481,3 @@ static load(serialised: object): Pipeline; | ||
* | ||
* @param {lunr.PipelineFunction[]} functions - Any number of functions to add to the pipeline. | ||
* @param functions - Any number of functions to add to the pipeline. | ||
*/ | ||
@@ -501,4 +492,4 @@ add(...functions: PipelineFunction[]): void; | ||
* | ||
* @param {lunr.PipelineFunction} existingFn - A function that already exists in the pipeline. | ||
* @param {lunr.PipelineFunction} newFn - The new function to add to the pipeline. | ||
* @param existingFn - A function that already exists in the pipeline. | ||
* @param newFn - The new function to add to the pipeline. | ||
*/ | ||
@@ -513,4 +504,4 @@ after(existingFn: PipelineFunction, newFn: PipelineFunction): void; | ||
* | ||
* @param {lunr.PipelineFunction} existingFn - A function that already exists in the pipeline. | ||
* @param {lunr.PipelineFunction} newFn - The new function to add to the pipeline. | ||
* @param existingFn - A function that already exists in the pipeline. | ||
* @param newFn - The new function to add to the pipeline. | ||
*/ | ||
@@ -522,3 +513,3 @@ before(existingFn: PipelineFunction, newFn: PipelineFunction): void; | ||
* | ||
* @param {lunr.PipelineFunction} fn The function to remove from the pipeline. | ||
* @param fn The function to remove from the pipeline. | ||
*/ | ||
@@ -531,4 +522,3 @@ remove(fn: PipelineFunction): void; | ||
* | ||
* @param {Array} tokens The tokens to run through the pipeline. | ||
* @returns {Array} | ||
* @param tokens The tokens to run through the pipeline. | ||
*/ | ||
@@ -542,4 +532,3 @@ run(tokens: Token[]): Token[]; | ||
* | ||
* @param {string} str - The string to pass through the pipeline. | ||
* @returns {string[]} | ||
* @param str - The string to pass through the pipeline. | ||
*/ | ||
@@ -559,3 +548,2 @@ runString(str: string): string[]; | ||
* | ||
* @returns {Array} | ||
*/ | ||
@@ -575,17 +563,14 @@ toJSON(): PipelineFunction[]; | ||
* match that term against a {@link lunr.Index}. | ||
* | ||
* @typedef {Object} lunr.Query~Clause | ||
* @property {string} term | ||
* @property {string[]} fields - The fields in an index this clause should be matched against. | ||
* @property {number} [boost=1] - Any boost that should be applied when matching this clause. | ||
* @property {number} [editDistance] - Whether the term should have fuzzy matching applied, and how fuzzy the match should be. | ||
* @property {boolean} [usePipeline] - Whether the term should be passed through the search pipeline. | ||
* @property {number} [wildcard=0] - Whether the term should have wildcards appended or prepended. | ||
*/ | ||
interface Clause { | ||
term: string; | ||
/** The fields in an index this clause should be matched against. */ | ||
fields: string[]; | ||
/** Any boost that should be applied when matching this clause. */ | ||
boost: number; | ||
/** Whether the term should have fuzzy matching applied, and how fuzzy the match should be. */ | ||
editDistance: number; | ||
/** Whether the term should be passed through the search pipeline. */ | ||
usePipeline: boolean; | ||
/** Whether the term should have wildcards appended or prepended. */ | ||
wildcard: number; | ||
@@ -601,5 +586,2 @@ } | ||
* so the query object is pre-initialized with the right index fields. | ||
* | ||
* @property {lunr.Query~Clause[]} clauses - An array of query clauses. | ||
* @property {string[]} allFields - An array of all available fields in a lunr.Index. | ||
*/ | ||
@@ -628,5 +610,4 @@ class Query { | ||
* | ||
* @param {lunr.Query~Clause} clause - The clause to add to this query. | ||
* @param clause - The clause to add to this query. | ||
* @see lunr.Query~Clause | ||
* @returns {lunr.Query} | ||
*/ | ||
@@ -639,5 +620,4 @@ clause(clause: Query.Clause): Query; | ||
* | ||
* @param {string} term - The term to add to the query. | ||
* @param {Object} [options] - Any additional properties to add to the query clause. | ||
* @returns {lunr.Query} | ||
* @param term - The term to add to the query. | ||
* @param [options] - Any additional properties to add to the query clause. | ||
* @see lunr.Query#clause | ||
@@ -670,6 +650,5 @@ * @see lunr.Query~Clause | ||
* | ||
* @static | ||
* @implements {lunr.PipelineFunction} | ||
* @param {lunr.Token} token - The string to stem | ||
* @returns {lunr.Token} | ||
* Implements {lunr.PipelineFunction} | ||
* | ||
* @param token - The string to stem | ||
* @see {@link lunr.Pipeline} | ||
@@ -686,5 +665,5 @@ */ | ||
* | ||
* @implements {lunr.PipelineFunction} | ||
* @params {lunr.Token} token - A token to check for being a stop word. | ||
* @returns {lunr.Token} | ||
* Implements {lunr.PipelineFunction} | ||
* | ||
* @param token - A token to check for being a stop word. | ||
* @see {@link lunr.Pipeline} | ||
@@ -700,4 +679,4 @@ */ | ||
* @callback lunr.Token~updateFunction | ||
* @param {string} str - The string representation of the token. | ||
* @param {Object} metadata - All metadata associated with this token. | ||
* @param str - The string representation of the token. | ||
* @param metadata - All metadata associated with this token. | ||
*/ | ||
@@ -713,4 +692,4 @@ type UpdateFunction = (str: string, metadata: object) => void; | ||
/** | ||
* @param {string} [str=''] - The string token being wrapped. | ||
* @param {object} [metadata={}] - Metadata associated with this token. | ||
* @param [str=''] - The string token being wrapped. | ||
* @param [metadata={}] - Metadata associated with this token. | ||
*/ | ||
@@ -722,3 +701,2 @@ constructor(str: string, metadata: object) | ||
* | ||
* @returns {string} | ||
*/ | ||
@@ -735,4 +713,3 @@ toString(): string; | ||
* | ||
* @param {lunr.Token~updateFunction} fn - A function to apply to the token string. | ||
* @returns {lunr.Token} | ||
* @param fn - A function to apply to the token string. | ||
*/ | ||
@@ -745,6 +722,5 @@ update(fn: Token.UpdateFunction): Token; | ||
* | ||
* @param {lunr.Token~updateFunction} [fn] - An optional function to apply to the cloned token. | ||
* @returns {lunr.Token} | ||
* @param fn - An optional function to apply to the cloned token. | ||
*/ | ||
clone(fn: Token.UpdateFunction): Token; | ||
clone(fn?: Token.UpdateFunction): Token; | ||
} | ||
@@ -777,4 +753,3 @@ | ||
* | ||
* @param {String[]} arr - A sorted array of strings to create the set from. | ||
* @returns {lunr.TokenSet} | ||
* @param arr - A sorted array of strings to create the set from. | ||
* @throws Will throw an error if the input array is not sorted. | ||
@@ -795,5 +770,4 @@ */ | ||
* | ||
* @param {string} str - The string to create the token set from. | ||
* @param {number} editDistance - The allowed edit distance to match. | ||
* @returns {lunr.Vector} | ||
* @param str - The string to create the token set from. | ||
* @param editDistance - The allowed edit distance to match. | ||
*/ | ||
@@ -809,4 +783,3 @@ fromFuzzyString(str: string, editDistance: number): Vector; | ||
* | ||
* @param {string} str - The string to create a TokenSet from. | ||
* @returns {lunr.TokenSet} | ||
* @param str - The string to create a TokenSet from. | ||
*/ | ||
@@ -819,3 +792,2 @@ fromString(str: string): TokenSet; | ||
* | ||
* @returns {string[]} | ||
*/ | ||
@@ -832,3 +804,2 @@ toArray(): string[]; | ||
* | ||
* @returns {string} | ||
*/ | ||
@@ -844,4 +815,3 @@ toString(): string; | ||
* | ||
* @param {lunr.TokenSet} b - An other TokenSet to intersect with. | ||
* @returns {lunr.TokenSet} | ||
* @param b - An other TokenSet to intersect with. | ||
*/ | ||
@@ -856,3 +826,2 @@ intersect(b: TokenSet): TokenSet; | ||
* | ||
* @static | ||
* @see lunr.tokenizer | ||
@@ -872,5 +841,3 @@ */ | ||
* | ||
* @static | ||
* @param {?(string|object|object[])} obj - The object to convert into tokens | ||
* @returns {lunr.Token[]} | ||
* @param obj - The object to convert into tokens | ||
*/ | ||
@@ -888,6 +855,5 @@ function tokenizer(obj?: null | string | object | object[]): Token[]; | ||
* | ||
* @static | ||
* @implements {lunr.PipelineFunction} | ||
* @param {lunr.Token} token The token to pass through the filter | ||
* @returns {lunr.Token} | ||
* Implements {lunr.PipelineFunction} | ||
* | ||
* @param token The token to pass through the filter | ||
* @see lunr.Pipeline | ||
@@ -904,4 +870,3 @@ */ | ||
* | ||
* @param {String} message The message to be printed. | ||
* @memberOf Utils | ||
* @param message The message to be printed. | ||
*/ | ||
@@ -917,5 +882,4 @@ function warn(message: string): void; | ||
* | ||
* @param {Any} obj The object to convert to a string. | ||
* @return {String} string representation of the passed object. | ||
* @memberOf Utils | ||
* @param obj The object to convert to a string. | ||
* @return string representation of the passed object. | ||
*/ | ||
@@ -940,3 +904,3 @@ function asString(obj: any): string; | ||
/** | ||
* @param {Number[]} [elements] - The flat list of element index and element value pairs. | ||
* @param [elements] - The flat list of element index and element value pairs. | ||
*/ | ||
@@ -952,4 +916,3 @@ constructor(elements: number[]) | ||
* | ||
* @param {Number} insertIdx - The index at which the element should be inserted. | ||
* @returns {Number} | ||
* @param insertIdx - The index at which the element should be inserted. | ||
*/ | ||
@@ -964,4 +927,4 @@ positionForIndex(index: number): number; | ||
* | ||
* @param {Number} insertIdx - The index at which the element should be inserted. | ||
* @param {Number} val - The value to be inserted into the vector. | ||
* @param insertIdx - The index at which the element should be inserted. | ||
* @param val - The value to be inserted into the vector. | ||
*/ | ||
@@ -973,5 +936,5 @@ insert(insertIdx: number, val: number): void; | ||
* | ||
* @param {Number} insertIdx - The index at which the element should be inserted. | ||
* @param {Number} val - The value to be inserted into the vector. | ||
* @param {function} fn - A function that is called for updates, the existing value and the | ||
* @param insertIdx - The index at which the element should be inserted. | ||
* @param val - The value to be inserted into the vector. | ||
* @param fn - A function that is called for updates, the existing value and the | ||
* requested value are passed as arguments | ||
@@ -988,3 +951,2 @@ */ | ||
* | ||
* @returns {Number} | ||
*/ | ||
@@ -996,4 +958,3 @@ magnitude(): number; | ||
* | ||
* @param {lunr.Vector} otherVector - The vector to compute the dot product with. | ||
* @returns {Number} | ||
* @param otherVector - The vector to compute the dot product with. | ||
*/ | ||
@@ -1006,5 +967,4 @@ dot(otherVector: Vector): number; | ||
* | ||
* @param {lunr.Vector} otherVector - The other vector to calculate the | ||
* @param otherVector - The other vector to calculate the | ||
* similarity with. | ||
* @returns {Number} | ||
*/ | ||
@@ -1016,3 +976,2 @@ similarity(otherVector: Vector): number; | ||
* | ||
* @returns {Number[]} | ||
*/ | ||
@@ -1024,3 +983,2 @@ toArray(): number[]; | ||
* | ||
* @returns {Number[]} | ||
*/ | ||
@@ -1027,0 +985,0 @@ toJSON(): number[]; |
{ | ||
"name": "@types/lunr", | ||
"version": "2.1.2", | ||
"version": "2.1.3", | ||
"description": "TypeScript definitions for lunr.js", | ||
@@ -20,4 +20,4 @@ "license": "MIT", | ||
"dependencies": {}, | ||
"typesPublisherContentHash": "7500e9cd65d87da5641880708c960544458bbdf91ea09a752436b83d9ec04753", | ||
"typesPublisherContentHash": "0937c722818160f9d920934a54cda20f1e321211ab0bf3b609330ae0696ffdd0", | ||
"typeScriptVersion": "2.3" | ||
} |
@@ -11,3 +11,3 @@ # Installation | ||
Additional Details | ||
* Last updated: Fri, 13 Oct 2017 22:26:39 GMT | ||
* Last updated: Wed, 25 Oct 2017 01:11:50 GMT | ||
* Dependencies: none | ||
@@ -14,0 +14,0 @@ * Global values: lunr |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
39428
876