okf-search-native 0.2.0 → 0.3.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +123 -41
- package/dist/index.cjs +15792 -0
- package/dist/index.d.cts +156 -0
- package/dist/index.d.mts +156 -0
- package/dist/index.d.ts +156 -0
- package/dist/index.mjs +15795 -0
- package/{index.js → native.cjs} +54 -54
- package/{index.d.ts → native.d.cts} +8 -17
- package/okf-search-native.darwin-arm64.node +0 -0
- package/okf-search-native.darwin-x64.node +0 -0
- package/okf-search-native.linux-x64-gnu.node +0 -0
- package/okf-search-native.win32-x64-msvc.node +0 -0
- package/package.json +36 -14
package/dist/index.d.cts
ADDED
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
type IsoDateTime = string;
|
|
2
|
+
type OkfStatus = "draft" | "stable" | "deprecated";
|
|
3
|
+
type OkfTrustTier = "unverified" | "machine-confirmed" | "human-reviewed";
|
|
4
|
+
interface OkfTimeWindow {
|
|
5
|
+
from: IsoDateTime;
|
|
6
|
+
to: IsoDateTime;
|
|
7
|
+
}
|
|
8
|
+
interface OkfSource {
|
|
9
|
+
id?: string;
|
|
10
|
+
resource: string;
|
|
11
|
+
title?: string;
|
|
12
|
+
author?: string;
|
|
13
|
+
usageCount?: number;
|
|
14
|
+
lastModified?: IsoDateTime;
|
|
15
|
+
usageWindow?: OkfTimeWindow;
|
|
16
|
+
}
|
|
17
|
+
interface OkfGeneration {
|
|
18
|
+
by: string;
|
|
19
|
+
at?: IsoDateTime;
|
|
20
|
+
}
|
|
21
|
+
interface OkfVerification {
|
|
22
|
+
by: string;
|
|
23
|
+
at: IsoDateTime;
|
|
24
|
+
}
|
|
25
|
+
interface OkfParameter {
|
|
26
|
+
name: string;
|
|
27
|
+
type: string;
|
|
28
|
+
required: boolean;
|
|
29
|
+
}
|
|
30
|
+
interface OkfExecutor {
|
|
31
|
+
resource: string;
|
|
32
|
+
receipt: string[];
|
|
33
|
+
}
|
|
34
|
+
interface OkfAttester {
|
|
35
|
+
resource: string;
|
|
36
|
+
}
|
|
37
|
+
interface OkfDocument {
|
|
38
|
+
id: string;
|
|
39
|
+
type: string;
|
|
40
|
+
title: string;
|
|
41
|
+
description?: string;
|
|
42
|
+
resource?: string;
|
|
43
|
+
tags: string[];
|
|
44
|
+
sources: OkfSource[];
|
|
45
|
+
usageWindow?: OkfTimeWindow;
|
|
46
|
+
generated?: OkfGeneration;
|
|
47
|
+
verified: OkfVerification[];
|
|
48
|
+
status: OkfStatus;
|
|
49
|
+
staleAfter?: IsoDateTime;
|
|
50
|
+
runtime?: string;
|
|
51
|
+
parameters?: OkfParameter[];
|
|
52
|
+
computation?: string;
|
|
53
|
+
executor?: OkfExecutor;
|
|
54
|
+
attester?: OkfAttester;
|
|
55
|
+
body: string;
|
|
56
|
+
extensions: Record<string, unknown>;
|
|
57
|
+
}
|
|
58
|
+
interface OkfDocumentInput {
|
|
59
|
+
/**
|
|
60
|
+
* Relative POSIX identity. Empty and `.` segments normalize away;
|
|
61
|
+
* case and `\\` remain significant.
|
|
62
|
+
*/
|
|
63
|
+
path: string;
|
|
64
|
+
markdown: string;
|
|
65
|
+
}
|
|
66
|
+
type OkfDiagnosticCode = "ERR_OKF_PARSE" | "ERR_OKF_FIELD";
|
|
67
|
+
type OkfErrorCode = "ERR_OKF_READ" | "ERR_OKF_PARSE" | "ERR_OKF_FIELD" | "ERR_OKF_INDEX_UNUSABLE" | "ERR_OKF_UNSUPPORTED";
|
|
68
|
+
interface OkfDiagnostic {
|
|
69
|
+
code: OkfDiagnosticCode;
|
|
70
|
+
path: string;
|
|
71
|
+
field?: string;
|
|
72
|
+
message: string;
|
|
73
|
+
}
|
|
74
|
+
type OkfValidationResult = {
|
|
75
|
+
readonly isValid: true;
|
|
76
|
+
readonly isIndexable: true;
|
|
77
|
+
readonly errors: readonly [];
|
|
78
|
+
} | {
|
|
79
|
+
readonly isValid: false;
|
|
80
|
+
readonly isIndexable: true;
|
|
81
|
+
readonly errors: readonly [OkfDiagnostic, ...OkfDiagnostic[]];
|
|
82
|
+
} | {
|
|
83
|
+
readonly isValid: false;
|
|
84
|
+
readonly isIndexable: false;
|
|
85
|
+
readonly errors: readonly [OkfDiagnostic, ...OkfDiagnostic[]];
|
|
86
|
+
};
|
|
87
|
+
interface OkfDegradedDocument {
|
|
88
|
+
readonly documentId: string;
|
|
89
|
+
readonly path: string;
|
|
90
|
+
readonly diagnostics: readonly [OkfDiagnostic, ...OkfDiagnostic[]];
|
|
91
|
+
}
|
|
92
|
+
type OkfConformance = "strict" | "degraded";
|
|
93
|
+
type OkfIngestResult = {
|
|
94
|
+
readonly conformance: "strict";
|
|
95
|
+
readonly document: OkfDocument;
|
|
96
|
+
} | ({
|
|
97
|
+
readonly conformance: "degraded";
|
|
98
|
+
} & OkfDegradedDocument);
|
|
99
|
+
type OkfSearchField = "resource" | "title" | "heading" | "description" | "tags" | "type" | "sources" | "body";
|
|
100
|
+
interface OkfSearchOptions {
|
|
101
|
+
limit?: number;
|
|
102
|
+
where?: {
|
|
103
|
+
types?: readonly string[];
|
|
104
|
+
tagsAny?: readonly string[];
|
|
105
|
+
statuses?: readonly OkfStatus[];
|
|
106
|
+
trustTiers?: readonly OkfTrustTier[];
|
|
107
|
+
stale?: boolean;
|
|
108
|
+
conformance?: readonly OkfConformance[];
|
|
109
|
+
};
|
|
110
|
+
asOf?: Date;
|
|
111
|
+
match?: "any" | "all";
|
|
112
|
+
fields?: readonly OkfSearchField[];
|
|
113
|
+
boost?: Readonly<Partial<Record<OkfSearchField, number>>>;
|
|
114
|
+
fuzzy?: boolean | number;
|
|
115
|
+
}
|
|
116
|
+
interface OkfSearchHit {
|
|
117
|
+
documentId: string;
|
|
118
|
+
title: string;
|
|
119
|
+
sectionId: string;
|
|
120
|
+
score: number;
|
|
121
|
+
conformance: OkfConformance;
|
|
122
|
+
matchedFields: OkfSearchField[];
|
|
123
|
+
headingPath: string;
|
|
124
|
+
path: string;
|
|
125
|
+
startLine: number;
|
|
126
|
+
endLine: number;
|
|
127
|
+
snippet: string;
|
|
128
|
+
}
|
|
129
|
+
interface OkfSearch {
|
|
130
|
+
ingest(input: OkfDocumentInput): OkfIngestResult;
|
|
131
|
+
listDegradedDocuments(): readonly OkfDegradedDocument[];
|
|
132
|
+
listTypes(): readonly string[];
|
|
133
|
+
remove(path: string): boolean;
|
|
134
|
+
search(query: string, options?: OkfSearchOptions): OkfSearchHit[];
|
|
135
|
+
autoSuggest(query: string, options?: OkfSearchOptions): never;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
declare function createOkfSearch(documents: readonly OkfDocumentInput[]): OkfSearch;
|
|
139
|
+
|
|
140
|
+
interface OkfErrorOptions {
|
|
141
|
+
readonly field?: string;
|
|
142
|
+
readonly cause?: unknown;
|
|
143
|
+
}
|
|
144
|
+
declare class OkfError extends Error {
|
|
145
|
+
readonly code: OkfErrorCode;
|
|
146
|
+
readonly path: string;
|
|
147
|
+
readonly field?: string;
|
|
148
|
+
constructor(code: OkfErrorCode, path: string, options?: OkfErrorOptions);
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
declare function openOkf(root: string): Promise<OkfSearch>;
|
|
152
|
+
|
|
153
|
+
declare function validateOkfDocument(input: OkfDocumentInput): OkfValidationResult;
|
|
154
|
+
|
|
155
|
+
export { OkfError, createOkfSearch, openOkf, validateOkfDocument };
|
|
156
|
+
export type { IsoDateTime, OkfAttester, OkfConformance, OkfDegradedDocument, OkfDiagnostic, OkfDiagnosticCode, OkfDocument, OkfDocumentInput, OkfErrorCode, OkfExecutor, OkfGeneration, OkfIngestResult, OkfParameter, OkfSearch, OkfSearchField, OkfSearchHit, OkfSearchOptions, OkfSource, OkfStatus, OkfTimeWindow, OkfTrustTier, OkfValidationResult, OkfVerification };
|
package/dist/index.d.mts
ADDED
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
type IsoDateTime = string;
|
|
2
|
+
type OkfStatus = "draft" | "stable" | "deprecated";
|
|
3
|
+
type OkfTrustTier = "unverified" | "machine-confirmed" | "human-reviewed";
|
|
4
|
+
interface OkfTimeWindow {
|
|
5
|
+
from: IsoDateTime;
|
|
6
|
+
to: IsoDateTime;
|
|
7
|
+
}
|
|
8
|
+
interface OkfSource {
|
|
9
|
+
id?: string;
|
|
10
|
+
resource: string;
|
|
11
|
+
title?: string;
|
|
12
|
+
author?: string;
|
|
13
|
+
usageCount?: number;
|
|
14
|
+
lastModified?: IsoDateTime;
|
|
15
|
+
usageWindow?: OkfTimeWindow;
|
|
16
|
+
}
|
|
17
|
+
interface OkfGeneration {
|
|
18
|
+
by: string;
|
|
19
|
+
at?: IsoDateTime;
|
|
20
|
+
}
|
|
21
|
+
interface OkfVerification {
|
|
22
|
+
by: string;
|
|
23
|
+
at: IsoDateTime;
|
|
24
|
+
}
|
|
25
|
+
interface OkfParameter {
|
|
26
|
+
name: string;
|
|
27
|
+
type: string;
|
|
28
|
+
required: boolean;
|
|
29
|
+
}
|
|
30
|
+
interface OkfExecutor {
|
|
31
|
+
resource: string;
|
|
32
|
+
receipt: string[];
|
|
33
|
+
}
|
|
34
|
+
interface OkfAttester {
|
|
35
|
+
resource: string;
|
|
36
|
+
}
|
|
37
|
+
interface OkfDocument {
|
|
38
|
+
id: string;
|
|
39
|
+
type: string;
|
|
40
|
+
title: string;
|
|
41
|
+
description?: string;
|
|
42
|
+
resource?: string;
|
|
43
|
+
tags: string[];
|
|
44
|
+
sources: OkfSource[];
|
|
45
|
+
usageWindow?: OkfTimeWindow;
|
|
46
|
+
generated?: OkfGeneration;
|
|
47
|
+
verified: OkfVerification[];
|
|
48
|
+
status: OkfStatus;
|
|
49
|
+
staleAfter?: IsoDateTime;
|
|
50
|
+
runtime?: string;
|
|
51
|
+
parameters?: OkfParameter[];
|
|
52
|
+
computation?: string;
|
|
53
|
+
executor?: OkfExecutor;
|
|
54
|
+
attester?: OkfAttester;
|
|
55
|
+
body: string;
|
|
56
|
+
extensions: Record<string, unknown>;
|
|
57
|
+
}
|
|
58
|
+
interface OkfDocumentInput {
|
|
59
|
+
/**
|
|
60
|
+
* Relative POSIX identity. Empty and `.` segments normalize away;
|
|
61
|
+
* case and `\\` remain significant.
|
|
62
|
+
*/
|
|
63
|
+
path: string;
|
|
64
|
+
markdown: string;
|
|
65
|
+
}
|
|
66
|
+
type OkfDiagnosticCode = "ERR_OKF_PARSE" | "ERR_OKF_FIELD";
|
|
67
|
+
type OkfErrorCode = "ERR_OKF_READ" | "ERR_OKF_PARSE" | "ERR_OKF_FIELD" | "ERR_OKF_INDEX_UNUSABLE" | "ERR_OKF_UNSUPPORTED";
|
|
68
|
+
interface OkfDiagnostic {
|
|
69
|
+
code: OkfDiagnosticCode;
|
|
70
|
+
path: string;
|
|
71
|
+
field?: string;
|
|
72
|
+
message: string;
|
|
73
|
+
}
|
|
74
|
+
type OkfValidationResult = {
|
|
75
|
+
readonly isValid: true;
|
|
76
|
+
readonly isIndexable: true;
|
|
77
|
+
readonly errors: readonly [];
|
|
78
|
+
} | {
|
|
79
|
+
readonly isValid: false;
|
|
80
|
+
readonly isIndexable: true;
|
|
81
|
+
readonly errors: readonly [OkfDiagnostic, ...OkfDiagnostic[]];
|
|
82
|
+
} | {
|
|
83
|
+
readonly isValid: false;
|
|
84
|
+
readonly isIndexable: false;
|
|
85
|
+
readonly errors: readonly [OkfDiagnostic, ...OkfDiagnostic[]];
|
|
86
|
+
};
|
|
87
|
+
interface OkfDegradedDocument {
|
|
88
|
+
readonly documentId: string;
|
|
89
|
+
readonly path: string;
|
|
90
|
+
readonly diagnostics: readonly [OkfDiagnostic, ...OkfDiagnostic[]];
|
|
91
|
+
}
|
|
92
|
+
type OkfConformance = "strict" | "degraded";
|
|
93
|
+
type OkfIngestResult = {
|
|
94
|
+
readonly conformance: "strict";
|
|
95
|
+
readonly document: OkfDocument;
|
|
96
|
+
} | ({
|
|
97
|
+
readonly conformance: "degraded";
|
|
98
|
+
} & OkfDegradedDocument);
|
|
99
|
+
type OkfSearchField = "resource" | "title" | "heading" | "description" | "tags" | "type" | "sources" | "body";
|
|
100
|
+
interface OkfSearchOptions {
|
|
101
|
+
limit?: number;
|
|
102
|
+
where?: {
|
|
103
|
+
types?: readonly string[];
|
|
104
|
+
tagsAny?: readonly string[];
|
|
105
|
+
statuses?: readonly OkfStatus[];
|
|
106
|
+
trustTiers?: readonly OkfTrustTier[];
|
|
107
|
+
stale?: boolean;
|
|
108
|
+
conformance?: readonly OkfConformance[];
|
|
109
|
+
};
|
|
110
|
+
asOf?: Date;
|
|
111
|
+
match?: "any" | "all";
|
|
112
|
+
fields?: readonly OkfSearchField[];
|
|
113
|
+
boost?: Readonly<Partial<Record<OkfSearchField, number>>>;
|
|
114
|
+
fuzzy?: boolean | number;
|
|
115
|
+
}
|
|
116
|
+
interface OkfSearchHit {
|
|
117
|
+
documentId: string;
|
|
118
|
+
title: string;
|
|
119
|
+
sectionId: string;
|
|
120
|
+
score: number;
|
|
121
|
+
conformance: OkfConformance;
|
|
122
|
+
matchedFields: OkfSearchField[];
|
|
123
|
+
headingPath: string;
|
|
124
|
+
path: string;
|
|
125
|
+
startLine: number;
|
|
126
|
+
endLine: number;
|
|
127
|
+
snippet: string;
|
|
128
|
+
}
|
|
129
|
+
interface OkfSearch {
|
|
130
|
+
ingest(input: OkfDocumentInput): OkfIngestResult;
|
|
131
|
+
listDegradedDocuments(): readonly OkfDegradedDocument[];
|
|
132
|
+
listTypes(): readonly string[];
|
|
133
|
+
remove(path: string): boolean;
|
|
134
|
+
search(query: string, options?: OkfSearchOptions): OkfSearchHit[];
|
|
135
|
+
autoSuggest(query: string, options?: OkfSearchOptions): never;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
declare function createOkfSearch(documents: readonly OkfDocumentInput[]): OkfSearch;
|
|
139
|
+
|
|
140
|
+
interface OkfErrorOptions {
|
|
141
|
+
readonly field?: string;
|
|
142
|
+
readonly cause?: unknown;
|
|
143
|
+
}
|
|
144
|
+
declare class OkfError extends Error {
|
|
145
|
+
readonly code: OkfErrorCode;
|
|
146
|
+
readonly path: string;
|
|
147
|
+
readonly field?: string;
|
|
148
|
+
constructor(code: OkfErrorCode, path: string, options?: OkfErrorOptions);
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
declare function openOkf(root: string): Promise<OkfSearch>;
|
|
152
|
+
|
|
153
|
+
declare function validateOkfDocument(input: OkfDocumentInput): OkfValidationResult;
|
|
154
|
+
|
|
155
|
+
export { OkfError, createOkfSearch, openOkf, validateOkfDocument };
|
|
156
|
+
export type { IsoDateTime, OkfAttester, OkfConformance, OkfDegradedDocument, OkfDiagnostic, OkfDiagnosticCode, OkfDocument, OkfDocumentInput, OkfErrorCode, OkfExecutor, OkfGeneration, OkfIngestResult, OkfParameter, OkfSearch, OkfSearchField, OkfSearchHit, OkfSearchOptions, OkfSource, OkfStatus, OkfTimeWindow, OkfTrustTier, OkfValidationResult, OkfVerification };
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
type IsoDateTime = string;
|
|
2
|
+
type OkfStatus = "draft" | "stable" | "deprecated";
|
|
3
|
+
type OkfTrustTier = "unverified" | "machine-confirmed" | "human-reviewed";
|
|
4
|
+
interface OkfTimeWindow {
|
|
5
|
+
from: IsoDateTime;
|
|
6
|
+
to: IsoDateTime;
|
|
7
|
+
}
|
|
8
|
+
interface OkfSource {
|
|
9
|
+
id?: string;
|
|
10
|
+
resource: string;
|
|
11
|
+
title?: string;
|
|
12
|
+
author?: string;
|
|
13
|
+
usageCount?: number;
|
|
14
|
+
lastModified?: IsoDateTime;
|
|
15
|
+
usageWindow?: OkfTimeWindow;
|
|
16
|
+
}
|
|
17
|
+
interface OkfGeneration {
|
|
18
|
+
by: string;
|
|
19
|
+
at?: IsoDateTime;
|
|
20
|
+
}
|
|
21
|
+
interface OkfVerification {
|
|
22
|
+
by: string;
|
|
23
|
+
at: IsoDateTime;
|
|
24
|
+
}
|
|
25
|
+
interface OkfParameter {
|
|
26
|
+
name: string;
|
|
27
|
+
type: string;
|
|
28
|
+
required: boolean;
|
|
29
|
+
}
|
|
30
|
+
interface OkfExecutor {
|
|
31
|
+
resource: string;
|
|
32
|
+
receipt: string[];
|
|
33
|
+
}
|
|
34
|
+
interface OkfAttester {
|
|
35
|
+
resource: string;
|
|
36
|
+
}
|
|
37
|
+
interface OkfDocument {
|
|
38
|
+
id: string;
|
|
39
|
+
type: string;
|
|
40
|
+
title: string;
|
|
41
|
+
description?: string;
|
|
42
|
+
resource?: string;
|
|
43
|
+
tags: string[];
|
|
44
|
+
sources: OkfSource[];
|
|
45
|
+
usageWindow?: OkfTimeWindow;
|
|
46
|
+
generated?: OkfGeneration;
|
|
47
|
+
verified: OkfVerification[];
|
|
48
|
+
status: OkfStatus;
|
|
49
|
+
staleAfter?: IsoDateTime;
|
|
50
|
+
runtime?: string;
|
|
51
|
+
parameters?: OkfParameter[];
|
|
52
|
+
computation?: string;
|
|
53
|
+
executor?: OkfExecutor;
|
|
54
|
+
attester?: OkfAttester;
|
|
55
|
+
body: string;
|
|
56
|
+
extensions: Record<string, unknown>;
|
|
57
|
+
}
|
|
58
|
+
interface OkfDocumentInput {
|
|
59
|
+
/**
|
|
60
|
+
* Relative POSIX identity. Empty and `.` segments normalize away;
|
|
61
|
+
* case and `\\` remain significant.
|
|
62
|
+
*/
|
|
63
|
+
path: string;
|
|
64
|
+
markdown: string;
|
|
65
|
+
}
|
|
66
|
+
type OkfDiagnosticCode = "ERR_OKF_PARSE" | "ERR_OKF_FIELD";
|
|
67
|
+
type OkfErrorCode = "ERR_OKF_READ" | "ERR_OKF_PARSE" | "ERR_OKF_FIELD" | "ERR_OKF_INDEX_UNUSABLE" | "ERR_OKF_UNSUPPORTED";
|
|
68
|
+
interface OkfDiagnostic {
|
|
69
|
+
code: OkfDiagnosticCode;
|
|
70
|
+
path: string;
|
|
71
|
+
field?: string;
|
|
72
|
+
message: string;
|
|
73
|
+
}
|
|
74
|
+
type OkfValidationResult = {
|
|
75
|
+
readonly isValid: true;
|
|
76
|
+
readonly isIndexable: true;
|
|
77
|
+
readonly errors: readonly [];
|
|
78
|
+
} | {
|
|
79
|
+
readonly isValid: false;
|
|
80
|
+
readonly isIndexable: true;
|
|
81
|
+
readonly errors: readonly [OkfDiagnostic, ...OkfDiagnostic[]];
|
|
82
|
+
} | {
|
|
83
|
+
readonly isValid: false;
|
|
84
|
+
readonly isIndexable: false;
|
|
85
|
+
readonly errors: readonly [OkfDiagnostic, ...OkfDiagnostic[]];
|
|
86
|
+
};
|
|
87
|
+
interface OkfDegradedDocument {
|
|
88
|
+
readonly documentId: string;
|
|
89
|
+
readonly path: string;
|
|
90
|
+
readonly diagnostics: readonly [OkfDiagnostic, ...OkfDiagnostic[]];
|
|
91
|
+
}
|
|
92
|
+
type OkfConformance = "strict" | "degraded";
|
|
93
|
+
type OkfIngestResult = {
|
|
94
|
+
readonly conformance: "strict";
|
|
95
|
+
readonly document: OkfDocument;
|
|
96
|
+
} | ({
|
|
97
|
+
readonly conformance: "degraded";
|
|
98
|
+
} & OkfDegradedDocument);
|
|
99
|
+
type OkfSearchField = "resource" | "title" | "heading" | "description" | "tags" | "type" | "sources" | "body";
|
|
100
|
+
interface OkfSearchOptions {
|
|
101
|
+
limit?: number;
|
|
102
|
+
where?: {
|
|
103
|
+
types?: readonly string[];
|
|
104
|
+
tagsAny?: readonly string[];
|
|
105
|
+
statuses?: readonly OkfStatus[];
|
|
106
|
+
trustTiers?: readonly OkfTrustTier[];
|
|
107
|
+
stale?: boolean;
|
|
108
|
+
conformance?: readonly OkfConformance[];
|
|
109
|
+
};
|
|
110
|
+
asOf?: Date;
|
|
111
|
+
match?: "any" | "all";
|
|
112
|
+
fields?: readonly OkfSearchField[];
|
|
113
|
+
boost?: Readonly<Partial<Record<OkfSearchField, number>>>;
|
|
114
|
+
fuzzy?: boolean | number;
|
|
115
|
+
}
|
|
116
|
+
interface OkfSearchHit {
|
|
117
|
+
documentId: string;
|
|
118
|
+
title: string;
|
|
119
|
+
sectionId: string;
|
|
120
|
+
score: number;
|
|
121
|
+
conformance: OkfConformance;
|
|
122
|
+
matchedFields: OkfSearchField[];
|
|
123
|
+
headingPath: string;
|
|
124
|
+
path: string;
|
|
125
|
+
startLine: number;
|
|
126
|
+
endLine: number;
|
|
127
|
+
snippet: string;
|
|
128
|
+
}
|
|
129
|
+
interface OkfSearch {
|
|
130
|
+
ingest(input: OkfDocumentInput): OkfIngestResult;
|
|
131
|
+
listDegradedDocuments(): readonly OkfDegradedDocument[];
|
|
132
|
+
listTypes(): readonly string[];
|
|
133
|
+
remove(path: string): boolean;
|
|
134
|
+
search(query: string, options?: OkfSearchOptions): OkfSearchHit[];
|
|
135
|
+
autoSuggest(query: string, options?: OkfSearchOptions): never;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
declare function createOkfSearch(documents: readonly OkfDocumentInput[]): OkfSearch;
|
|
139
|
+
|
|
140
|
+
interface OkfErrorOptions {
|
|
141
|
+
readonly field?: string;
|
|
142
|
+
readonly cause?: unknown;
|
|
143
|
+
}
|
|
144
|
+
declare class OkfError extends Error {
|
|
145
|
+
readonly code: OkfErrorCode;
|
|
146
|
+
readonly path: string;
|
|
147
|
+
readonly field?: string;
|
|
148
|
+
constructor(code: OkfErrorCode, path: string, options?: OkfErrorOptions);
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
declare function openOkf(root: string): Promise<OkfSearch>;
|
|
152
|
+
|
|
153
|
+
declare function validateOkfDocument(input: OkfDocumentInput): OkfValidationResult;
|
|
154
|
+
|
|
155
|
+
export { OkfError, createOkfSearch, openOkf, validateOkfDocument };
|
|
156
|
+
export type { IsoDateTime, OkfAttester, OkfConformance, OkfDegradedDocument, OkfDiagnostic, OkfDiagnosticCode, OkfDocument, OkfDocumentInput, OkfErrorCode, OkfExecutor, OkfGeneration, OkfIngestResult, OkfParameter, OkfSearch, OkfSearchField, OkfSearchHit, OkfSearchOptions, OkfSource, OkfStatus, OkfTimeWindow, OkfTrustTier, OkfValidationResult, OkfVerification };
|