-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.d.ts
More file actions
80 lines (78 loc) · 2.62 KB
/
index.d.ts
File metadata and controls
80 lines (78 loc) · 2.62 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
/* tslint:disable */
/* eslint-disable */
/* auto-generated by NAPI-RS */
export declare class ExternalObject<T> {
readonly '': {
readonly '': unique symbol
[K: symbol]: T
}
}
export declare function openInDir(pathStr: string): ExternalObject<Index>
export declare function search(index: ExternalObject<Index>, query: string, searchOptions?: JsSearchOptions | undefined | null): Array<TopDocFruit>
export declare function getDocumentByAddress(index: ExternalObject<Index>, docAddress: JsDocAddress): string
export interface FieldResult {
fieldId: number
path: string
}
export interface DocAddress {
segmentOrd: number
docId: number
}
export interface SearchOptions {
fields?: Array<string>
limit?: number
}
export type JsTopDocFruit = TopDocFruit
export declare class TopDocFruit {
score: number
docAddress: JsDocAddress
}
export type JsTopDocs = TopDocs
export declare class TopDocs { }
export type JsIndex = Index
export declare class Index {
static openInDir(directoryPath: string): JsIndex
reader(): JsIndexReader
loadMetas(): JsIndexMeta
}
export type JsIndexMeta = IndexMeta
export declare class IndexMeta { }
export type JsIndexReader = IndexReader
export declare class IndexReader { }
export type JsQuery = Query
export declare class Query { }
export type JsQueryParser = QueryParser
export declare class QueryParser {
/** Static method to create a new QueryParser */
static forIndex(index: Index, fields: Array<ExternalObject<Field>>): JsQueryParser
/** Parses a query string */
parseQuery(query: string): Query
}
export type JsField = Field
export declare class Field {
static fromFieldId(fieldId: number): JsField
get fieldId(): number
}
export type JsSchema = Schema
export declare class Schema { }
export declare class JsSchemaBuilder {
constructor()
/** Adds a text field with indexing options */
addTextField(name: string, options: Array<string>): string
/** Adds a u64 (unsigned integer) field */
addU64Field(name: string, options: Array<string>): string
/** Adds an i64 (signed integer) field */
addI64Field(name: string, options: Array<string>): string
/** Adds an f64 (floating-point) field */
addF64Field(name: string, options: Array<string>): string
/** Adds a boolean field */
addBoolField(name: string, options: Array<string>): string
/** Adds a JSON field */
addJsonField(name: string, options: Array<string>): string
/** Adds a date field (i64 internally, representing timestamp in microseconds) */
addDateField(name: string, options: Array<string>): string
/** Builds the final schema */
build(): Schema
}
export type JsSearcher = Searcher
export declare class Searcher { }