mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-04-23 21:00:01 +08:00
lunr: Use export as namespace instead of global declarations + declare module (#20045)
This commit is contained in:
7
types/lunr/index.d.ts
vendored
7
types/lunr/index.d.ts
vendored
@@ -4,6 +4,9 @@
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.3
|
||||
|
||||
export as namespace lunr;
|
||||
export = lunr;
|
||||
|
||||
/**
|
||||
* lunr - http://lunrjs.com - A bit like Solr, but much smaller and not as bright
|
||||
* Copyright (C) 2014 Oliver Nightingale
|
||||
@@ -999,7 +1002,3 @@ declare namespace lunr {
|
||||
* ```
|
||||
*/
|
||||
declare function lunr(config: lunr.ConfigFunction): lunr.Index;
|
||||
|
||||
declare module "lunr" {
|
||||
export = lunr;
|
||||
}
|
||||
|
||||
@@ -22,12 +22,12 @@ function basic_test() {
|
||||
|
||||
function pipeline_test() {
|
||||
const index = lunr(function() {
|
||||
this.pipeline.add(function(token, tokenIndex, tokens) {
|
||||
this.pipeline.add((token, tokenIndex, tokens) => {
|
||||
// text processing in here
|
||||
return token;
|
||||
});
|
||||
|
||||
this.pipeline.after(lunr.stopWordFilter, function(token, tokenIndex, tokens) {
|
||||
this.pipeline.after(lunr.stopWordFilter, (token, tokenIndex, tokens) => {
|
||||
// text processing in here
|
||||
return token;
|
||||
});
|
||||
|
||||
@@ -1,9 +1 @@
|
||||
{
|
||||
"extends": "dtslint/dt.json",
|
||||
"rules": {
|
||||
"ban-types": false,
|
||||
"only-arrow-functions": [false],
|
||||
"no-single-declare-module": false,
|
||||
"no-unnecessary-qualifier": true
|
||||
}
|
||||
}
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
Reference in New Issue
Block a user