Skip to content

Commit

Permalink
Update elasticlunr for TS 4.7 (DefinitelyTyped#59607)
Browse files Browse the repository at this point in the history
* Update elasticlunr for TS 4.7

* Update index.d.ts

* Update index.d.ts

* Update index.d.ts
  • Loading branch information
weswigham authored Apr 18, 2022
1 parent b63a668 commit 4bf4f91
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions types/elasticlunr/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@
// Project: http://weixsong.github.io
// Definitions by: Luis Rodrigues <https://github.com/goblindegook>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.1
// Minimum TypeScript Version: 4.1

export = elasticlunr;

declare function elasticlunr<T>(
declare function elasticlunr<T extends {}>(
config?: (this: elasticlunr.Index<T>, idx: elasticlunr.Index<T>) => void,
): elasticlunr.Index<T>;

declare namespace elasticlunr {
class Configuration<T> {
class Configuration<T extends {}> {
constructor(config: string, fields: Array<keyof T>);

addAllFields2UserConfig(bool: Bool, expand: boolean, fields: Array<keyof T>): void;
Expand Down Expand Up @@ -94,7 +94,7 @@ declare namespace elasticlunr {
};
};

interface SearchConfig<T> {
interface SearchConfig<T extends {}> {
fields?: FieldSearchConfig<T> | undefined;
expand?: boolean | undefined;
bool?: Bool;
Expand Down Expand Up @@ -124,7 +124,7 @@ declare namespace elasticlunr {
index: { [K in keyof T]?: InvertedIndexNode };
}

class Index<T> {
class Index<T extends {}> {
constructor();

documentStore: DocumentStore<T>;
Expand Down Expand Up @@ -173,7 +173,7 @@ declare namespace elasticlunr {

use(plugin: (...args: any[]) => any, ...args: any[]): void;

static load<T>(serialisedData: SerialisedIndexData<T>): Index<T>;
static load<T extends {}>(serialisedData: SerialisedIndexData<T>): Index<T>;
}

interface TokenInfo {
Expand Down

0 comments on commit 4bf4f91

Please sign in to comment.