@delali/narsil 0.3.1-next.145 → 0.3.1-next.146
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/dist/adapters/filesystem.mjs +2 -2
- package/dist/adapters/gcs.mjs +2 -2
- package/dist/adapters/indexeddb.mjs +1 -1
- package/dist/adapters/s3.mjs +2 -2
- package/dist/analysis-change-ZCJNYBJM.mjs +39 -0
- package/dist/{analysis-change-entry-V4SQQSXQ.mjs → analysis-change-entry-YN3ELL6C.mjs} +1 -1
- package/dist/browser/{analysis-change-QTCQ5ETU.mjs → analysis-change-M65AZQQG.mjs} +8 -5
- package/dist/browser/{analysis-change-entry-KYEQSP3I.mjs → analysis-change-entry-H3YIOLXZ.mjs} +1 -1
- package/dist/browser/{chunk-GP4QLUQM.mjs → chunk-2JABMB4S.mjs} +10 -6
- package/dist/browser/{chunk-5WYWLTM5.mjs → chunk-4DYLCICG.mjs} +2 -2
- package/dist/browser/{chunk-75PMIFQA.mjs → chunk-4RD3AFSB.mjs} +1 -1
- package/dist/browser/{chunk-XWMEGKDC.mjs → chunk-5V74FFZE.mjs} +2 -2
- package/dist/browser/{chunk-PMBSBSCN.mjs → chunk-6OWX3OP2.mjs} +2 -2
- package/dist/browser/chunk-BRWY3JCN.mjs +678 -0
- package/dist/browser/{chunk-ZALEKEUH.mjs → chunk-BVX2MEHA.mjs} +306 -607
- package/dist/browser/{chunk-FXPMF65P.mjs → chunk-D6UFGBF5.mjs} +15 -45
- package/dist/browser/{chunk-QNDWMPV2.mjs → chunk-IAXZAVYL.mjs} +25 -66
- package/dist/browser/chunk-JNOAKDUM.mjs +31 -0
- package/dist/browser/{chunk-BTMRV5MY.mjs → chunk-KAEVGLYN.mjs} +2 -2
- package/dist/browser/{chunk-FHO5N7FD.mjs → chunk-LURXVCHG.mjs} +1 -1
- package/dist/browser/chunk-MPK76GVS.mjs +63 -0
- package/dist/browser/{chunk-6OFS7RUN.mjs → chunk-NVEJJP4R.mjs} +1 -1
- package/dist/browser/{chunk-U77XQJOY.mjs → chunk-ODQP7P3H.mjs} +455 -66
- package/dist/browser/{chunk-IFGTRRPU.mjs → chunk-PIS7ZAP7.mjs} +3 -25
- package/dist/browser/{chunk-XIHLIMFX.mjs → chunk-QMNZFFD3.mjs} +4 -3
- package/dist/browser/{chunk-AOKLYVTT.mjs → chunk-SRL47USS.mjs} +2 -2
- package/dist/browser/chunk-TY7L6OXO.mjs +69 -0
- package/dist/browser/{chunk-LGJ6XMH5.mjs → chunk-W643QV3L.mjs} +6 -5
- package/dist/browser/chunk-WXLBZJMT.mjs +25 -0
- package/dist/browser/{chunk-ZKVDQ5ZH.mjs → chunk-XILIT5MT.mjs} +8 -8
- package/dist/browser/{cold-module-Y2IJAP7S.mjs → cold-module-A5S6JFDN.mjs} +20 -20
- package/dist/browser/{durability-wiring-MLXZ5QQF.mjs → durability-wiring-W5AVV3RF.mjs} +53 -30
- package/dist/browser/gzip-5S7ROJFJ.mjs +1 -0
- package/dist/browser/import-PTT63AGK.mjs +12 -0
- package/dist/browser/{module-5LMDGXQH.mjs → module-CEKA7MQH.mjs} +13 -10
- package/dist/browser/module-X5PGOE47.mjs +4288 -0
- package/dist/browser/{phrase-module-KXNRTWCS.mjs → phrase-module-CNKMUY4U.mjs} +2 -1
- package/dist/browser/pool-DTYSPBMQ.mjs +296 -0
- package/dist/{restore-queue-UAVGBSJG.mjs → browser/restore-queue-DD4LWZK7.mjs} +2 -2
- package/dist/browser/{runtime-ZNEGK33G.mjs → runtime-D2ULZGCN.mjs} +3 -2
- package/dist/browser/{snapshot-2EGS2FYU.mjs → snapshot-DQ6A4PQP.mjs} +18 -14
- package/dist/browser/{write-WMZA6NSF.mjs → write-MAGRAIEH.mjs} +14 -11
- package/dist/{capabilities-CNnzGtqP.d.ts → capabilities-BT-HLDC8.d.ts} +2 -2
- package/dist/{chunk-FRJ5RGX7.mjs → chunk-2HJWQPR6.mjs} +2 -2
- package/dist/{chunk-DKMZ7JFW.mjs → chunk-3BVGJ4JR.mjs} +10 -4
- package/dist/{chunk-QYMAYU7M.mjs → chunk-3HV7M5OJ.mjs} +155 -149
- package/dist/chunk-3MXV3VHR.mjs +46 -0
- package/dist/{chunk-6FOJKNUR.mjs → chunk-3SBJVQLL.mjs} +2 -2
- package/dist/{chunk-PRID7CA6.mjs → chunk-3TVDTACC.mjs} +1 -1
- package/dist/{chunk-RTVAWNUL.mjs → chunk-5WB2A3XU.mjs} +9 -6
- package/dist/{chunk-LWFK3TC2.mjs → chunk-65WCV5JO.mjs} +1 -1
- package/dist/{chunk-G6Q5DEF5.mjs → chunk-6BWLDLS3.mjs} +3 -46
- package/dist/{chunk-W6M4RRAT.mjs → chunk-6C5EX2QR.mjs} +3 -3
- package/dist/{chunk-HOC5JP2H.mjs → chunk-6F6USYII.mjs} +119 -11
- package/dist/{chunk-7523VCM4.mjs → chunk-7HKWO4BJ.mjs} +7 -7
- package/dist/{chunk-ONDEEBTA.mjs → chunk-7N223GWV.mjs} +2 -2
- package/dist/{chunk-UGQULMSU.mjs → chunk-ADBS5XRI.mjs} +10 -10
- package/dist/{chunk-MJTEU2XK.mjs → chunk-AWNHDBKV.mjs} +429 -73
- package/dist/{chunk-2E2ZFOPT.mjs → chunk-B2FTZNNF.mjs} +2 -2
- package/dist/{chunk-NWTEJ2T7.mjs → chunk-B7XIOAMK.mjs} +3 -3
- package/dist/{chunk-W55X2BYN.mjs → chunk-BEZH7VEH.mjs} +1 -1
- package/dist/chunk-BTPGQC6Z.mjs +27 -0
- package/dist/{chunk-KG5N7LE6.mjs → chunk-CYYSZPVV.mjs} +11 -11
- package/dist/{chunk-HTMUGEFU.mjs → chunk-DOY6EG76.mjs} +6 -6
- package/dist/{chunk-UHVTEVF5.mjs → chunk-F22IOCR2.mjs} +10 -6
- package/dist/{chunk-FTQLF5JI.mjs → chunk-IRWP524D.mjs} +1 -1
- package/dist/{chunk-XLAI4OIO.mjs → chunk-IZT3G24Q.mjs} +2 -2
- package/dist/{chunk-SE7MKJVK.mjs → chunk-J7M73VY7.mjs} +1 -1
- package/dist/chunk-KAKQ74LS.mjs +53 -0
- package/dist/{chunk-GVPYMSLO.mjs → chunk-KYVRZAYP.mjs} +1 -1
- package/dist/{chunk-F442VZUL.mjs → chunk-KZ5GQE4Z.mjs} +5 -5
- package/dist/{chunk-WDEWU46C.mjs → chunk-KZQIVGW7.mjs} +2 -2
- package/dist/{chunk-7AJAW6NN.mjs → chunk-L7TIAYPX.mjs} +8 -8
- package/dist/{chunk-GRFXSEFF.mjs → chunk-LDGGR7YT.mjs} +4 -81
- package/dist/{chunk-WMIV7PJ7.mjs → chunk-LJ4ENXOD.mjs} +15 -14
- package/dist/chunk-LQG5G2LY.mjs +39 -0
- package/dist/{chunk-IQHZMCLX.mjs → chunk-MDF6PDIA.mjs} +2 -0
- package/dist/{chunk-QXH2CS4V.mjs → chunk-NVTFQFUL.mjs} +7 -26
- package/dist/{chunk-5K2JHKM3.mjs → chunk-NYSONUB7.mjs} +1 -1
- package/dist/{chunk-OH7SX5MY.mjs → chunk-O4KUNDVF.mjs} +12 -10
- package/dist/{chunk-EBIHRL7B.mjs → chunk-Q2UL2TPC.mjs} +1 -1
- package/dist/{chunk-RNUP6WZ6.mjs → chunk-QEYF2SQ6.mjs} +2 -2
- package/dist/{chunk-RVBUQITB.mjs → chunk-QN5WVV5K.mjs} +7 -7
- package/dist/{chunk-RIIUZJQ3.mjs → chunk-QYRNLLLI.mjs} +1 -1
- package/dist/{chunk-BTARFTEN.mjs → chunk-SOUZMPME.mjs} +4 -4
- package/dist/{chunk-ISUOSACK.mjs → chunk-T4CJDBBE.mjs} +1 -1
- package/dist/{chunk-DHEJAGVW.mjs → chunk-TTCKT2RT.mjs} +5 -5
- package/dist/{chunk-QU2XF7VI.mjs → chunk-U2726TL5.mjs} +5 -4
- package/dist/{chunk-LYKUJNAV.mjs → chunk-U46IZNCW.mjs} +2 -2
- package/dist/{chunk-SNB4DYL3.mjs → chunk-U6NE6RCV.mjs} +4 -4
- package/dist/{chunk-SA52N7G3.mjs → chunk-VP6XRMWR.mjs} +4 -4
- package/dist/{chunk-YUCGFPMS.mjs → chunk-VQDZVWN3.mjs} +449 -405
- package/dist/{chunk-IWVEG5CX.mjs → chunk-XIHUI4KB.mjs} +2 -2
- package/dist/{chunk-IV2XTSS2.mjs → chunk-XKPNKR3V.mjs} +16 -46
- package/dist/{chunk-UQS5PAS5.mjs → chunk-YGQOPB2Z.mjs} +1 -1
- package/dist/{chunk-SVO6NV4D.mjs → chunk-YKEHQUSZ.mjs} +4 -4
- package/dist/{chunk-6Z22L5RN.mjs → chunk-ZAYWOHVG.mjs} +1 -1
- package/dist/{chunk-QLDLQW36.mjs → chunk-ZEKDO7YX.mjs} +2 -2
- package/dist/chunk-ZXNNR73R.mjs +31 -0
- package/dist/{chunk-VJS4JFBQ.mjs → chunk-ZXX5GZEX.mjs} +3 -1
- package/dist/{chunk-X5SBWARI.mjs → chunk-ZYKUD5NX.mjs} +9 -7
- package/dist/{client-DoYPHcUn.d.ts → client-Cn3gNxUU.d.ts} +3 -3
- package/dist/client.d.ts +5 -5
- package/dist/client.mjs +2 -0
- package/dist/{cold-module-NUD332YD.mjs → cold-module-2WWGBFJC.mjs} +36 -33
- package/dist/{config-CuUfls_H.d.ts → config-CfhH1IWQ.d.ts} +1 -1
- package/dist/{config-Dzs46im6.d.ts → config-aIsy7mcL.d.ts} +52 -1
- package/dist/direct-executor-QLVHMELJ.mjs +24 -0
- package/dist/distribution/coordinator/etcd.mjs +1 -1
- package/dist/distribution/transport/grpc.mjs +1 -1
- package/dist/distribution.d.ts +4 -4
- package/dist/distribution.mjs +150 -255
- package/dist/{durability-wiring-K7RDXWL6.mjs → durability-wiring-GNWQSZI3.mjs} +67 -42
- package/dist/embeddings/openai.mjs +2 -2
- package/dist/{engine-C0ifUEcm.d.ts → engine-CJRUHXgf.d.ts} +1 -1
- package/dist/gzip-F4HMIEEQ.mjs +1 -0
- package/dist/import-DX55PN4G.mjs +41 -0
- package/dist/index.browser.mjs +7 -4
- package/dist/index.d.ts +539 -5
- package/dist/index.mjs +22 -16
- package/dist/index.react-native.mjs +19 -0
- package/dist/{long-query-thread-FKVHRCHF.mjs → long-query-thread-SCUE62TO.mjs} +20 -17
- package/dist/{module-GJUKW5VU.mjs → module-HW6IXUM6.mjs} +601 -108
- package/dist/{module-TMFIWOD2.mjs → module-V5K4ZP23.mjs} +29 -23
- package/dist/{paged-partition-archive-WNUEMYWM.mjs → paged-partition-archive-FDIIWZNR.mjs} +31 -25
- package/dist/partial-words.mjs +5 -5
- package/dist/pattern.mjs +3 -3
- package/dist/persistence/durability/checkpoint-worker.mjs +28 -22
- package/dist/{phrase-module-OMY3QQV7.mjs → phrase-module-OUQIRUQU.mjs} +1 -1
- package/dist/pool-UPV5PVPY.mjs +298 -0
- package/dist/react-native/chunks/analysis-change-HGW3L6NY.mjs +893 -0
- package/dist/react-native/chunks/analysis-change-entry-BNRU6STO.mjs +1 -0
- package/dist/react-native/chunks/chunk-2J2727V4.mjs +495 -0
- package/dist/react-native/chunks/chunk-3CTWSQRW.mjs +1251 -0
- package/dist/react-native/chunks/chunk-5FV4ZEVA.mjs +2619 -0
- package/dist/react-native/chunks/chunk-7VWQLEFV.mjs +642 -0
- package/dist/react-native/chunks/chunk-AAAETEJK.mjs +27 -0
- package/dist/react-native/chunks/chunk-AM7RSBPF.mjs +32 -0
- package/dist/react-native/chunks/chunk-B6OD63Z3.mjs +997 -0
- package/dist/react-native/chunks/chunk-BRNAVOKP.mjs +177 -0
- package/dist/react-native/chunks/chunk-DKJTZ625.mjs +207 -0
- package/dist/react-native/chunks/chunk-FKGG4UOF.mjs +177 -0
- package/dist/{browser/chunk-K7UFXEJS.mjs → react-native/chunks/chunk-GV5KFQ6M.mjs} +12 -6
- package/dist/react-native/chunks/chunk-HURV3ASY.mjs +4416 -0
- package/dist/react-native/chunks/chunk-IO2SMUQD.mjs +10 -0
- package/dist/react-native/chunks/chunk-JV6VQY2S.mjs +17 -0
- package/dist/react-native/chunks/chunk-KUJOBRKS.mjs +217 -0
- package/dist/react-native/chunks/chunk-KWRW5U65.mjs +226 -0
- package/dist/react-native/chunks/chunk-L4M7QJNP.mjs +110 -0
- package/dist/react-native/chunks/chunk-LQ6Q4L5B.mjs +360 -0
- package/dist/react-native/chunks/chunk-LQAKO5QV.mjs +523 -0
- package/dist/react-native/chunks/chunk-LRGWK367.mjs +11 -0
- package/dist/react-native/chunks/chunk-LVIKKAA6.mjs +93 -0
- package/dist/react-native/chunks/chunk-NFGBOI46.mjs +14 -0
- package/dist/react-native/chunks/chunk-NNE4VDMM.mjs +8 -0
- package/dist/react-native/chunks/chunk-PPEPTUVV.mjs +56 -0
- package/dist/react-native/chunks/chunk-PSWKQVVT.mjs +9 -0
- package/dist/react-native/chunks/chunk-PU55IOG4.mjs +910 -0
- package/dist/react-native/chunks/chunk-QC4ZRBSX.mjs +270 -0
- package/dist/react-native/chunks/chunk-R4EEMYM6.mjs +21 -0
- package/dist/react-native/chunks/chunk-R4OPUZQ5.mjs +86 -0
- package/dist/react-native/chunks/chunk-SLGIAD6B.mjs +2634 -0
- package/dist/react-native/chunks/chunk-TJMSKBEM.mjs +25 -0
- package/dist/react-native/chunks/chunk-TLYD7IJ2.mjs +23 -0
- package/dist/react-native/chunks/chunk-UFNCLEQM.mjs +73 -0
- package/dist/react-native/chunks/chunk-YH7W556M.mjs +179 -0
- package/dist/react-native/chunks/chunk-YJSMEKRE.mjs +22385 -0
- package/dist/react-native/chunks/chunk-ZCKNBPQ4.mjs +79 -0
- package/dist/react-native/chunks/cold-module-TSFWLYWC.mjs +755 -0
- package/dist/react-native/chunks/durability-wiring-PZR6KOQK.mjs +4509 -0
- package/dist/react-native/chunks/gzip.react-native-7JWCLVOB.mjs +3 -0
- package/dist/react-native/chunks/import-VTODLPLO.mjs +22 -0
- package/dist/{browser/module-Q6VFGLMG.mjs → react-native/chunks/module-JBBH6PZH.mjs} +609 -144
- package/dist/react-native/chunks/module-VEK2KCKU.mjs +25 -0
- package/dist/react-native/chunks/phrase-module-76UAPPSG.mjs +329 -0
- package/dist/react-native/chunks/pool-CD4ANYUI.mjs +296 -0
- package/dist/react-native/chunks/release-D7ZTIANM.mjs +33 -0
- package/dist/react-native/chunks/replace-IMZUVUOE.mjs +57 -0
- package/dist/{browser/restore-queue-SOAHKZSQ.mjs → react-native/chunks/restore-queue-OI5EH7R3.mjs} +2 -2
- package/dist/react-native/chunks/runtime-3MCDLJAF.mjs +559 -0
- package/dist/react-native/chunks/snapshot-AUZMEV36.mjs +1205 -0
- package/dist/react-native/chunks/write-DDC2QBRJ.mjs +197 -0
- package/dist/react-native/partial-words.mjs +733 -0
- package/dist/react-native/pattern.mjs +2442 -0
- package/dist/react-native/synonyms.mjs +460 -0
- package/dist/react.d.ts +7 -7
- package/dist/react.mjs +2 -0
- package/dist/{rerank-ZZ5CHKLW.mjs → rerank-3W54N6P2.mjs} +4 -4
- package/dist/rerankers/http.mjs +2 -2
- package/dist/restore-queue-BQWWNNQI.mjs +41 -0
- package/dist/{runtime-RAOCKSYA.mjs → runtime-L2DZYY6N.mjs} +5 -5
- package/dist/server.d.ts +8 -8
- package/dist/server.mjs +32 -28
- package/dist/{snapshot-DB5ZVCDN.mjs → snapshot-EHXTOTW5.mjs} +39 -33
- package/dist/synonyms.mjs +3 -3
- package/dist/{tasks-ChWp0wrF.d.ts → tasks-C4ElXr4P.d.ts} +2 -2
- package/dist/thread-I7DVHHW7.mjs +31 -0
- package/dist/vector/search-worker.mjs +7 -5
- package/dist/workers/entry.mjs +9 -9
- package/dist/{write-KZVTLGCI.mjs → write-SDJXXQ2G.mjs} +29 -23
- package/package.json +88 -7
- package/dist/analysis-change-D5APH4Z3.mjs +0 -34
- package/dist/browser/import-FTMLTPGQ.mjs +0 -9
- package/dist/direct-executor-FDQYQEJQ.mjs +0 -22
- package/dist/import-6KXFY6XI.mjs +0 -35
- package/dist/thread-OV6T555H.mjs +0 -28
- /package/dist/{chunk-22YPZVMG.mjs → chunk-ZXNQEW43.mjs} +0 -0
package/dist/index.d.ts
CHANGED
|
@@ -6,10 +6,10 @@ import { S as SynonymSearch } from './synonyms-CpOAHPa-.js';
|
|
|
6
6
|
export { O as OneWaySynonymRule, a as SynonymRule, T as TwoWaySynonymRule } from './synonyms-CpOAHPa-.js';
|
|
7
7
|
import { L as LanguageModule } from './language-DB8KG1z5.js';
|
|
8
8
|
export { T as TokenizerConfig } from './language-DB8KG1z5.js';
|
|
9
|
-
import { e as NarsilConfig } from './config-
|
|
10
|
-
export { A as AnalysisConfig, o as ArrayFilter, B as BatchResult, C as ClientErrorCode, a as ClientErrorCodes, p as ComparisonFilter, D as DocumentImportResult, q as DocumentProjection, r as DurabilityConfig, E as ErrorCode, b as ErrorCodes, F as FacetConfig, s as FacetResult, t as FieldFilter, u as FilterExpression, v as GeoFilter, w as GeoPolygonFilter, x as GeoRadiusFilter, n as GroupConfig, y as GroupReducer, G as GroupResult, H as HeldCheckpointReport, z as HighlightConfig, J as HighlightMatch, K as Hit, O as HybridConfig, R as IndexContext, I as IndexInfo, T as IndexLifecycleConfig, k as IndexStats, U as InsertContext, L as ListParams, f as ListResult, W as ListedDocument, X as MainCopyQueries, M as MemoryStats, N as NarsilError, c as NarsilErrorCode,
|
|
11
|
-
import { N as Narsil } from './engine-
|
|
12
|
-
export { a as AdapterRegistrationOperations, A as AnalysisChange, b as AnalysisOperations, B as BM25Operations, c as ByteSource, D as DocumentWriteOperations, I as IndexLifecycleOperations, S as SynonymOperations } from './engine-
|
|
9
|
+
import { e as NarsilConfig } from './config-aIsy7mcL.js';
|
|
10
|
+
export { A as AnalysisConfig, o as ArrayFilter, B as BatchResult, C as ClientErrorCode, a as ClientErrorCodes, p as ComparisonFilter, D as DocumentImportResult, q as DocumentProjection, r as DurabilityConfig, E as ErrorCode, b as ErrorCodes, F as FacetConfig, s as FacetResult, t as FieldFilter, u as FilterExpression, v as GeoFilter, w as GeoPolygonFilter, x as GeoRadiusFilter, n as GroupConfig, y as GroupReducer, G as GroupResult, H as HeldCheckpointReport, z as HighlightConfig, J as HighlightMatch, K as Hit, O as HybridConfig, R as IndexContext, I as IndexInfo, T as IndexLifecycleConfig, k as IndexStats, U as InsertContext, L as ListParams, f as ListResult, W as ListedDocument, X as MainCopyQueries, Y as MemoryConfig, M as MemoryStats, N as NarsilError, c as NarsilErrorCode, Z as NarsilEventHandlers, l as NarsilEventMap, _ as NarsilPlugin, $ as PartitionContext, P as PartitionStatsResult, j as PreflightResult, a0 as PresenceFilter, a1 as ProcessMemoryReport, a2 as QueryCoverage, Q as QueryParams, m as QueryResult, a3 as RemoveContext, a4 as RerankConfig, a5 as ScoreComponents, a6 as SearchContext, a7 as SearchMode, S as ServerErrorCode, d as ServerErrorCodes, a8 as SortField, a9 as SortSpec, aa as StaleAnalysis, ab as StringFilter, g as SuggestParams, h as SuggestResult, ac as TermMatchPolicy, ad as UpdateContext, V as VectorMaintenanceResult, ae as VectorQueryConfig, af as WorkerConfig, ag as WorkerContext, ah as WorkerCopyReport, i as isNarsilError } from './config-aIsy7mcL.js';
|
|
11
|
+
import { N as Narsil } from './engine-CJRUHXgf.js';
|
|
12
|
+
export { a as AdapterRegistrationOperations, A as AnalysisChange, b as AnalysisOperations, B as BM25Operations, c as ByteSource, D as DocumentWriteOperations, I as IndexLifecycleOperations, S as SynonymOperations } from './engine-CJRUHXgf.js';
|
|
13
13
|
export { E as EmbeddingAdapter, I as InvalidationAdapter, a as InvalidationEvent, b as PartitionStatistics, P as PersistenceAdapter, R as RerankAdapter } from './adapters-pljAqmrC.js';
|
|
14
14
|
|
|
15
15
|
/**
|
|
@@ -221,6 +221,540 @@ declare function registerLanguage(module: LanguageModule): void;
|
|
|
221
221
|
*/
|
|
222
222
|
declare function getLanguage(name: string): LanguageModule;
|
|
223
223
|
|
|
224
|
+
/**
|
|
225
|
+
* The regions of one HNSW graph that the native search core reads and writes.
|
|
226
|
+
*
|
|
227
|
+
* @internal
|
|
228
|
+
*/
|
|
229
|
+
interface NativeGraphMemory {
|
|
230
|
+
/** The graph's header words, which hold the entry point, the top layer, the link limits, the counts, and the graph lock. */
|
|
231
|
+
graphHeader: Int32Array;
|
|
232
|
+
/** The top layer of each node, one byte for each ordinal. */
|
|
233
|
+
nodeLevels: Uint8Array;
|
|
234
|
+
/** The neighbour lists on layer 0, a fixed number of words for each ordinal. */
|
|
235
|
+
level0: Int32Array;
|
|
236
|
+
/** The position in {@link NativeGraphMemory.upper} where each node's upper-layer lists start, one word for each ordinal. */
|
|
237
|
+
upperBase: Int32Array;
|
|
238
|
+
/** The neighbour lists on every layer above layer 0. */
|
|
239
|
+
upper: Int32Array;
|
|
240
|
+
/** One lock word for each node, which a writer takes before it changes that node's lists. */
|
|
241
|
+
locks: Int32Array;
|
|
242
|
+
/** One byte for each ordinal, which the core sets once it removes that node. */
|
|
243
|
+
tombstones: Uint8Array;
|
|
244
|
+
/** The number of neighbour lists that hold each node, one word for each ordinal. */
|
|
245
|
+
incoming: Int32Array;
|
|
246
|
+
/** One byte for each ordinal, which the core sets when that node's links have to be checked again. */
|
|
247
|
+
nearestLinkDue: Uint8Array;
|
|
248
|
+
/** The locks that each thread slot holds, 32 words for each slot. */
|
|
249
|
+
heldLocks: Int32Array;
|
|
250
|
+
}
|
|
251
|
+
/**
|
|
252
|
+
* The regions and layout of one vector store that the native search core reads.
|
|
253
|
+
*
|
|
254
|
+
* @internal
|
|
255
|
+
*/
|
|
256
|
+
interface NativeStoreMemory {
|
|
257
|
+
/** The store's header words, which hold the slot count, the live count, and the calibration state. */
|
|
258
|
+
storeHeader: Int32Array;
|
|
259
|
+
/** The number of values in each vector. */
|
|
260
|
+
dimension: number;
|
|
261
|
+
/** The number of bits for each value in a quantised code, or 0 when the store keeps no codes. */
|
|
262
|
+
bits: number;
|
|
263
|
+
/** The number of quantised records that each code block holds. */
|
|
264
|
+
recordsPerBlock: number;
|
|
265
|
+
/** The number of full-precision vectors that each vector block holds. */
|
|
266
|
+
vectorsPerBlock: number;
|
|
267
|
+
/** The number of bytes from the start of one vector to the start of the next in a vector block. */
|
|
268
|
+
vectorStrideBytes: number;
|
|
269
|
+
/** One byte for each ordinal, set when that ordinal has a quantised code. */
|
|
270
|
+
codePresent: Uint8Array;
|
|
271
|
+
/** The mean vector that the quantised codes are measured from. */
|
|
272
|
+
centroid: Float32Array;
|
|
273
|
+
/** The length of each full-precision vector, one value for each ordinal. */
|
|
274
|
+
magnitudes: Float64Array;
|
|
275
|
+
/** One byte for each ordinal, set when that ordinal holds a vector. */
|
|
276
|
+
present: Uint8Array;
|
|
277
|
+
/** For each ordinal, the position in {@link NativeStoreMemory.vectorFiles} of the file that holds its vector, or -1 when the vector is in a block. */
|
|
278
|
+
vectorFile: Int32Array;
|
|
279
|
+
/** For each ordinal whose vector is in a file, the vector's offset within that file. */
|
|
280
|
+
vectorOffset: Uint32Array;
|
|
281
|
+
/** The paths of the files that hold full-precision vectors. */
|
|
282
|
+
vectorFiles: string[];
|
|
283
|
+
/** The blocks of quantised codes, in ordinal order. */
|
|
284
|
+
codeBlocks: Uint8Array[];
|
|
285
|
+
/** The blocks of full-precision vectors, in ordinal order, with `null` in place of a block that the store holds no memory for. */
|
|
286
|
+
vectorBlocks: Array<Uint8Array | null>;
|
|
287
|
+
}
|
|
288
|
+
/**
|
|
289
|
+
* A graph that the native search core has attached.
|
|
290
|
+
*
|
|
291
|
+
* @internal
|
|
292
|
+
*/
|
|
293
|
+
type NativeGraphHandle = object;
|
|
294
|
+
/**
|
|
295
|
+
* A vector store that the native search core has attached.
|
|
296
|
+
*
|
|
297
|
+
* @internal
|
|
298
|
+
*/
|
|
299
|
+
type NativeStoreHandle = object;
|
|
300
|
+
/**
|
|
301
|
+
* The candidates that a search on a native thread found.
|
|
302
|
+
*
|
|
303
|
+
* @internal
|
|
304
|
+
*/
|
|
305
|
+
interface NativeSearchResult {
|
|
306
|
+
/** The number of candidates found, or a negative status code when the search failed. */
|
|
307
|
+
count: number;
|
|
308
|
+
/** The ordinal of each candidate, of which the first `count` entries hold results. */
|
|
309
|
+
ordinals: Int32Array;
|
|
310
|
+
/** The distance of each candidate, in the same order as {@link NativeSearchResult.ordinals}. */
|
|
311
|
+
distances: Float64Array;
|
|
312
|
+
}
|
|
313
|
+
/**
|
|
314
|
+
* The distances that a scoring call on a native thread measured.
|
|
315
|
+
*
|
|
316
|
+
* @internal
|
|
317
|
+
*/
|
|
318
|
+
interface NativeScoreResult {
|
|
319
|
+
/** A status code from the core's header. */
|
|
320
|
+
status: number;
|
|
321
|
+
/** One distance for each ordinal that the call measured. */
|
|
322
|
+
distances: Float64Array;
|
|
323
|
+
}
|
|
324
|
+
/**
|
|
325
|
+
* The outcome of a connecting pass that ran on a native thread.
|
|
326
|
+
*
|
|
327
|
+
* @internal
|
|
328
|
+
*/
|
|
329
|
+
interface NativeConnectResult {
|
|
330
|
+
/** A status code from the core's header. */
|
|
331
|
+
status: number;
|
|
332
|
+
/** The count of waiting writers to wake in its first word, followed by their ordinals. */
|
|
333
|
+
wakes: Int32Array;
|
|
334
|
+
}
|
|
335
|
+
/**
|
|
336
|
+
* The operations of the native search core, which each return a status code from the core's header, or, for a
|
|
337
|
+
* search, the number of candidates found.
|
|
338
|
+
*
|
|
339
|
+
* @internal
|
|
340
|
+
*/
|
|
341
|
+
interface NativeCore {
|
|
342
|
+
/** Returns the version of the core's binary interface, which the engine compares with the version that it was built for. */
|
|
343
|
+
abiVersion(): number;
|
|
344
|
+
/** Returns the number of bytes that the core's working memory holds. */
|
|
345
|
+
workspaceBytes(): number;
|
|
346
|
+
/**
|
|
347
|
+
* Attaches the memory of one graph to the core.
|
|
348
|
+
*
|
|
349
|
+
* @param memory - The graph's regions.
|
|
350
|
+
* @returns The handle that every later call on this graph takes.
|
|
351
|
+
*/
|
|
352
|
+
attachGraph(memory: NativeGraphMemory): NativeGraphHandle;
|
|
353
|
+
/**
|
|
354
|
+
* Attaches the memory of one vector store to the core.
|
|
355
|
+
*
|
|
356
|
+
* @param memory - The store's regions and layout.
|
|
357
|
+
* @returns The handle that every later call on this store takes.
|
|
358
|
+
*/
|
|
359
|
+
attachStore(memory: NativeStoreMemory): NativeStoreHandle;
|
|
360
|
+
/**
|
|
361
|
+
* Releases a store that {@link NativeCore.attachStore} returned.
|
|
362
|
+
*
|
|
363
|
+
* @param store - The store to release.
|
|
364
|
+
* @returns A status code.
|
|
365
|
+
*/
|
|
366
|
+
detachStore(store: NativeStoreHandle): number;
|
|
367
|
+
/**
|
|
368
|
+
* Finds the nodes nearest to a query by walking the graph.
|
|
369
|
+
*
|
|
370
|
+
* @param graph - The graph to walk.
|
|
371
|
+
* @param store - The store that holds the graph's vectors.
|
|
372
|
+
* @param query - The query vector.
|
|
373
|
+
* @param metric - The distance metric, where 0 is cosine, 1 is dot product, and 2 is Euclidean.
|
|
374
|
+
* @param candidateCount - The number of candidates to keep.
|
|
375
|
+
* @param threadSlot - The slot of the calling thread.
|
|
376
|
+
* @param ordinals - Receives the ordinal of each candidate.
|
|
377
|
+
* @param distances - Receives the distance of each candidate.
|
|
378
|
+
* @param accepted - A bit set of the ordinals that a search may return, or `null` to accept every ordinal.
|
|
379
|
+
* @returns The number of candidates found.
|
|
380
|
+
*/
|
|
381
|
+
search(graph: NativeGraphHandle, store: NativeStoreHandle, query: Float32Array, metric: number, candidateCount: number, threadSlot: number, ordinals: Int32Array, distances: Float64Array, accepted: Uint8Array | null): number;
|
|
382
|
+
/**
|
|
383
|
+
* Measures the distance from a query to each of the given ordinals.
|
|
384
|
+
*
|
|
385
|
+
* @param store - The store that holds the vectors.
|
|
386
|
+
* @param query - The query vector.
|
|
387
|
+
* @param metric - The distance metric, where 0 is cosine, 1 is dot product, and 2 is Euclidean.
|
|
388
|
+
* @param ordinals - The ordinals to measure.
|
|
389
|
+
* @param count - The number of ordinals to read from `ordinals`.
|
|
390
|
+
* @param distances - Receives one distance for each ordinal.
|
|
391
|
+
* @returns A status code.
|
|
392
|
+
*/
|
|
393
|
+
score(store: NativeStoreHandle, query: Float32Array, metric: number, ordinals: Int32Array, count: number, distances: Float64Array): number;
|
|
394
|
+
/**
|
|
395
|
+
* Finds the nodes nearest to a query on a native thread, so the calling thread stays free while the core walks
|
|
396
|
+
* the graph. A core without its own threads leaves this out.
|
|
397
|
+
*
|
|
398
|
+
* @param graph - The graph to walk.
|
|
399
|
+
* @param store - The store that holds the graph's vectors.
|
|
400
|
+
* @param query - The query vector, which the core copies before the promise settles.
|
|
401
|
+
* @param metric - The distance metric, where 0 is cosine, 1 is dot product, and 2 is Euclidean.
|
|
402
|
+
* @param candidateCount - The number of candidates to keep.
|
|
403
|
+
* @param threadSlot - A slot that no other thread uses until the promise settles.
|
|
404
|
+
* @param accepted - A bit set of the ordinals that a search may return, or `null` to accept every ordinal.
|
|
405
|
+
* @returns The candidates found.
|
|
406
|
+
*/
|
|
407
|
+
searchAsync?(graph: NativeGraphHandle, store: NativeStoreHandle, query: Float32Array, metric: number, candidateCount: number, threadSlot: number, accepted: Uint8Array | null): Promise<NativeSearchResult>;
|
|
408
|
+
/**
|
|
409
|
+
* Measures the distance from a query to each of the given ordinals on a native thread. A core without its own
|
|
410
|
+
* threads leaves this out.
|
|
411
|
+
*
|
|
412
|
+
* @param store - The store that holds the vectors.
|
|
413
|
+
* @param query - The query vector, which the core copies before the promise settles.
|
|
414
|
+
* @param metric - The distance metric, where 0 is cosine, 1 is dot product, and 2 is Euclidean.
|
|
415
|
+
* @param ordinals - The ordinals to measure, which the core copies before the promise settles.
|
|
416
|
+
* @param count - The number of ordinals to read from `ordinals`.
|
|
417
|
+
* @param threadSlot - A slot that no other thread uses until the promise settles.
|
|
418
|
+
* @returns The status and one distance for each ordinal.
|
|
419
|
+
*/
|
|
420
|
+
scoreAsync?(store: NativeStoreHandle, query: Float32Array, metric: number, ordinals: Int32Array, count: number, threadSlot: number): Promise<NativeScoreResult>;
|
|
421
|
+
/**
|
|
422
|
+
* Links a new node into the graph.
|
|
423
|
+
*
|
|
424
|
+
* @param graph - The graph to change.
|
|
425
|
+
* @param store - The store that holds the node's vector.
|
|
426
|
+
* @param metric - The distance metric, where 0 is cosine, 1 is dot product, and 2 is Euclidean.
|
|
427
|
+
* @param ordinal - The node to link.
|
|
428
|
+
* @param topLayer - The highest layer that the node joins.
|
|
429
|
+
* @param graphHeldAlone - 1 when the caller holds the graph alone, and 0 otherwise.
|
|
430
|
+
* @param threadSlot - The slot of the calling thread.
|
|
431
|
+
* @param wakes - Receives the count of waiting writers to wake in its first word, followed by their ordinals.
|
|
432
|
+
* @returns A status code.
|
|
433
|
+
*/
|
|
434
|
+
place(graph: NativeGraphHandle, store: NativeStoreHandle, metric: number, ordinal: number, topLayer: number, graphHeldAlone: number, threadSlot: number, wakes: Int32Array): number;
|
|
435
|
+
/**
|
|
436
|
+
* Marks a node as removed and unlinks it from its neighbours.
|
|
437
|
+
*
|
|
438
|
+
* @param graph - The graph to change.
|
|
439
|
+
* @param ordinal - The node to remove.
|
|
440
|
+
* @param threadSlot - The slot of the calling thread.
|
|
441
|
+
* @param wakes - Receives the count of waiting writers to wake in its first word, followed by their ordinals.
|
|
442
|
+
* @returns A status code.
|
|
443
|
+
*/
|
|
444
|
+
remove(graph: NativeGraphHandle, ordinal: number, threadSlot: number, wakes: Int32Array): number;
|
|
445
|
+
/**
|
|
446
|
+
* Repairs the links of the nodes that pointed at removed nodes.
|
|
447
|
+
*
|
|
448
|
+
* @param graph - The graph to change.
|
|
449
|
+
* @param store - The store that holds the graph's vectors.
|
|
450
|
+
* @param metric - The distance metric, where 0 is cosine, 1 is dot product, and 2 is Euclidean.
|
|
451
|
+
* @param threadSlot - The slot of the calling thread.
|
|
452
|
+
* @param wakes - Receives the count of waiting writers to wake in its first word, followed by their ordinals.
|
|
453
|
+
* @returns A status code.
|
|
454
|
+
*/
|
|
455
|
+
compact(graph: NativeGraphHandle, store: NativeStoreHandle, metric: number, threadSlot: number, wakes: Int32Array): number;
|
|
456
|
+
/**
|
|
457
|
+
* Links the nodes that no other node points at to nearby nodes.
|
|
458
|
+
*
|
|
459
|
+
* @param graph - The graph to change.
|
|
460
|
+
* @param store - The store that holds the graph's vectors.
|
|
461
|
+
* @param metric - The distance metric, where 0 is cosine, 1 is dot product, and 2 is Euclidean.
|
|
462
|
+
* @param nearby - The nodes that the core may link the unreached nodes to.
|
|
463
|
+
* @param threadSlot - The slot of the calling thread.
|
|
464
|
+
* @param wakes - Receives the count of waiting writers to wake in its first word, followed by their ordinals.
|
|
465
|
+
* @returns A status code.
|
|
466
|
+
*/
|
|
467
|
+
connectUnreached(graph: NativeGraphHandle, store: NativeStoreHandle, metric: number, nearby: Int32Array, threadSlot: number, wakes: Int32Array): number;
|
|
468
|
+
/**
|
|
469
|
+
* Links the nodes that no other node points at to nearby nodes on a native thread, so the calling thread stays free
|
|
470
|
+
* while the core walks the graph. The call takes the graph lock alone before it returns, and the native thread
|
|
471
|
+
* releases it once the pass ends. Where another thread holds the lock, the call runs no pass and settles with the
|
|
472
|
+
* status that reports the graph as held elsewhere. A core without its own threads leaves this out.
|
|
473
|
+
*
|
|
474
|
+
* @param graph - The graph to change.
|
|
475
|
+
* @param store - The store that holds the graph's vectors.
|
|
476
|
+
* @param metric - The distance metric, where 0 is cosine, 1 is dot product, and 2 is Euclidean.
|
|
477
|
+
* @param nearby - The nodes that the core may link the unreached nodes to, which the core copies before the promise settles.
|
|
478
|
+
* @param threadSlot - A slot that no other thread uses until the promise settles.
|
|
479
|
+
* @returns The status, and the waiting writers to wake.
|
|
480
|
+
*/
|
|
481
|
+
connectUnreachedAsync?(graph: NativeGraphHandle, store: NativeStoreHandle, metric: number, nearby: Int32Array, threadSlot: number): Promise<NativeConnectResult>;
|
|
482
|
+
/**
|
|
483
|
+
* Adds the given vectors to running totals, which the engine uses to calibrate quantisation.
|
|
484
|
+
*
|
|
485
|
+
* @param store - The store that holds the vectors.
|
|
486
|
+
* @param metric - The distance metric, where 0 is cosine, 1 is dot product, and 2 is Euclidean.
|
|
487
|
+
* @param ordinals - The ordinals to add.
|
|
488
|
+
* @param count - The number of ordinals to read from `ordinals`.
|
|
489
|
+
* @param totals - The sum of each axis, then the sum of squared lengths, then the number of vectors.
|
|
490
|
+
* @returns A status code.
|
|
491
|
+
*/
|
|
492
|
+
measure(store: NativeStoreHandle, metric: number, ordinals: Int32Array, count: number, totals: Float64Array): number;
|
|
493
|
+
/**
|
|
494
|
+
* Writes a quantised code for each of the given ordinals.
|
|
495
|
+
*
|
|
496
|
+
* @param store - The store that holds the vectors.
|
|
497
|
+
* @param metric - The distance metric, where 0 is cosine, 1 is dot product, and 2 is Euclidean.
|
|
498
|
+
* @param ordinals - The ordinals to quantise.
|
|
499
|
+
* @param count - The number of ordinals to read from `ordinals`.
|
|
500
|
+
* @returns A status code.
|
|
501
|
+
*/
|
|
502
|
+
quantise(store: NativeStoreHandle, metric: number, ordinals: Int32Array, count: number): number;
|
|
503
|
+
}
|
|
504
|
+
|
|
505
|
+
/**
|
|
506
|
+
* The status of one file or directory in an app's private storage.
|
|
507
|
+
*
|
|
508
|
+
* @internal
|
|
509
|
+
*/
|
|
510
|
+
interface ReactNativeFileStatus {
|
|
511
|
+
/** The size of the file in bytes. */
|
|
512
|
+
size: number;
|
|
513
|
+
/** Whether the path is a directory. */
|
|
514
|
+
isDirectory: boolean;
|
|
515
|
+
/** Whether the path is a regular file. */
|
|
516
|
+
isFile: boolean;
|
|
517
|
+
/** The device that holds the file, as a decimal string. */
|
|
518
|
+
device: string;
|
|
519
|
+
/** The file's inode number, as a decimal string. */
|
|
520
|
+
inode: string;
|
|
521
|
+
/** The time of the file's last change, in milliseconds since the Unix epoch. */
|
|
522
|
+
modifiedMs: number;
|
|
523
|
+
}
|
|
524
|
+
/**
|
|
525
|
+
* One entry of a directory in an app's private storage.
|
|
526
|
+
*
|
|
527
|
+
* @internal
|
|
528
|
+
*/
|
|
529
|
+
interface ReactNativeDirectoryEntry {
|
|
530
|
+
/** The entry's name within its directory. */
|
|
531
|
+
name: string;
|
|
532
|
+
/** Whether the entry is a directory. */
|
|
533
|
+
isDirectory: boolean;
|
|
534
|
+
/** Whether the entry is a regular file. */
|
|
535
|
+
isFile: boolean;
|
|
536
|
+
}
|
|
537
|
+
/**
|
|
538
|
+
* Synchronous file calls that the phone's native module answers. Each call
|
|
539
|
+
* throws an `Error` whose `code` holds the POSIX error name, such as `ENOENT`.
|
|
540
|
+
*
|
|
541
|
+
* @internal
|
|
542
|
+
*/
|
|
543
|
+
interface ReactNativeFiles {
|
|
544
|
+
/**
|
|
545
|
+
* Opens a file.
|
|
546
|
+
*
|
|
547
|
+
* @param path - The file's path.
|
|
548
|
+
* @param flags - The open mode, as Node.js writes it, such as `r` or `w+`.
|
|
549
|
+
* @returns The file descriptor.
|
|
550
|
+
*/
|
|
551
|
+
open(path: string, flags: string): number;
|
|
552
|
+
/**
|
|
553
|
+
* Closes a file descriptor once every call in progress on it has finished.
|
|
554
|
+
*
|
|
555
|
+
* @param descriptor - The descriptor to close.
|
|
556
|
+
*/
|
|
557
|
+
close(descriptor: number): void;
|
|
558
|
+
/**
|
|
559
|
+
* Reads bytes from a file into a buffer.
|
|
560
|
+
*
|
|
561
|
+
* @param descriptor - The file to read.
|
|
562
|
+
* @param target - Receives the bytes.
|
|
563
|
+
* @param position - The offset in the file to read from.
|
|
564
|
+
* @returns The number of bytes read.
|
|
565
|
+
*/
|
|
566
|
+
read(descriptor: number, target: Uint8Array, position: number): number;
|
|
567
|
+
/**
|
|
568
|
+
* Writes bytes from a buffer to a file.
|
|
569
|
+
*
|
|
570
|
+
* @param descriptor - The file to write.
|
|
571
|
+
* @param source - The bytes to write.
|
|
572
|
+
* @param position - The offset in the file to write at.
|
|
573
|
+
* @returns The number of bytes written.
|
|
574
|
+
*/
|
|
575
|
+
write(descriptor: number, source: Uint8Array, position: number): number;
|
|
576
|
+
/**
|
|
577
|
+
* Flushes a file to storage, with `F_FULLFSYNC` on iOS.
|
|
578
|
+
*
|
|
579
|
+
* @param descriptor - The file to flush.
|
|
580
|
+
*/
|
|
581
|
+
sync(descriptor: number): void;
|
|
582
|
+
/**
|
|
583
|
+
* Reads bytes from a file into a buffer on a native thread. Calls on one
|
|
584
|
+
* descriptor finish in the order that the engine makes them.
|
|
585
|
+
*
|
|
586
|
+
* @param descriptor - The file to read.
|
|
587
|
+
* @param target - Receives the bytes.
|
|
588
|
+
* @param position - The offset in the file to read from, or -1 for the current offset.
|
|
589
|
+
* @returns The number of bytes read.
|
|
590
|
+
*/
|
|
591
|
+
readAsync(descriptor: number, target: Uint8Array, position: number): Promise<number>;
|
|
592
|
+
/**
|
|
593
|
+
* Writes bytes from a buffer to a file on a native thread. The call copies
|
|
594
|
+
* the bytes before it returns, so the caller can reuse the buffer at once.
|
|
595
|
+
* Calls on one descriptor finish in the order that the engine makes them.
|
|
596
|
+
*
|
|
597
|
+
* @param descriptor - The file to write.
|
|
598
|
+
* @param source - The bytes to write.
|
|
599
|
+
* @param position - The offset in the file to write at, or -1 for the current offset.
|
|
600
|
+
* @returns The number of bytes written.
|
|
601
|
+
*/
|
|
602
|
+
writeAsync(descriptor: number, source: Uint8Array, position: number): Promise<number>;
|
|
603
|
+
/**
|
|
604
|
+
* Flushes a file to storage on a native thread, with `F_FULLFSYNC` on iOS,
|
|
605
|
+
* once every earlier call on the descriptor has finished.
|
|
606
|
+
*
|
|
607
|
+
* @param descriptor - The file to flush.
|
|
608
|
+
*/
|
|
609
|
+
syncAsync(descriptor: number): Promise<void>;
|
|
610
|
+
/**
|
|
611
|
+
* Sets the length of a file.
|
|
612
|
+
*
|
|
613
|
+
* @param descriptor - The file to change.
|
|
614
|
+
* @param byteLength - The new length in bytes.
|
|
615
|
+
*/
|
|
616
|
+
truncate(descriptor: number, byteLength: number): void;
|
|
617
|
+
/**
|
|
618
|
+
* Returns the status of an open file.
|
|
619
|
+
*
|
|
620
|
+
* @param descriptor - The file to describe.
|
|
621
|
+
*/
|
|
622
|
+
descriptorStatus(descriptor: number): ReactNativeFileStatus;
|
|
623
|
+
/**
|
|
624
|
+
* Returns the status of a path.
|
|
625
|
+
*
|
|
626
|
+
* @param path - The path to describe.
|
|
627
|
+
*/
|
|
628
|
+
pathStatus(path: string): ReactNativeFileStatus;
|
|
629
|
+
/**
|
|
630
|
+
* Creates a directory.
|
|
631
|
+
*
|
|
632
|
+
* @param path - The directory to create.
|
|
633
|
+
*/
|
|
634
|
+
makeDirectory(path: string): void;
|
|
635
|
+
/**
|
|
636
|
+
* Lists the entries of a directory.
|
|
637
|
+
*
|
|
638
|
+
* @param path - The directory to list.
|
|
639
|
+
*/
|
|
640
|
+
readDirectory(path: string): ReactNativeDirectoryEntry[];
|
|
641
|
+
/**
|
|
642
|
+
* Renames a file or directory, replacing any file at the new path.
|
|
643
|
+
*
|
|
644
|
+
* @param from - The current path.
|
|
645
|
+
* @param to - The new path.
|
|
646
|
+
*/
|
|
647
|
+
rename(from: string, to: string): void;
|
|
648
|
+
/**
|
|
649
|
+
* Deletes a file.
|
|
650
|
+
*
|
|
651
|
+
* @param path - The file to delete.
|
|
652
|
+
*/
|
|
653
|
+
unlink(path: string): void;
|
|
654
|
+
/**
|
|
655
|
+
* Deletes an empty directory.
|
|
656
|
+
*
|
|
657
|
+
* @param path - The directory to delete.
|
|
658
|
+
*/
|
|
659
|
+
removeDirectory(path: string): void;
|
|
660
|
+
/**
|
|
661
|
+
* Creates a hard link to a file.
|
|
662
|
+
*
|
|
663
|
+
* @param existingPath - The file to link to.
|
|
664
|
+
* @param newPath - The path of the new link.
|
|
665
|
+
*/
|
|
666
|
+
link(existingPath: string, newPath: string): void;
|
|
667
|
+
}
|
|
668
|
+
/**
|
|
669
|
+
* What `@delali/narsil-react-native` installs on the engine's runtime, so that
|
|
670
|
+
* the engine can reach memory, files, compression, and the search core that
|
|
671
|
+
* Hermes lacks.
|
|
672
|
+
*
|
|
673
|
+
* @internal
|
|
674
|
+
*/
|
|
675
|
+
interface ReactNativeHost {
|
|
676
|
+
/**
|
|
677
|
+
* Reserves address space that the system backs with memory only as each page is first written.
|
|
678
|
+
*
|
|
679
|
+
* @param bytes - The number of bytes to reserve.
|
|
680
|
+
* @returns A buffer over the reserved space, which reads as zeros until written.
|
|
681
|
+
*/
|
|
682
|
+
reserveMemory(bytes: number): ArrayBuffer;
|
|
683
|
+
/**
|
|
684
|
+
* Allocates zeroed memory that the native module owns.
|
|
685
|
+
*
|
|
686
|
+
* @param bytes - The number of bytes to allocate.
|
|
687
|
+
* @returns A buffer over the allocated memory.
|
|
688
|
+
*/
|
|
689
|
+
allocateMemory(bytes: number): ArrayBuffer;
|
|
690
|
+
/**
|
|
691
|
+
* Reports whether the native module allocated a buffer, which the search core requires of every region it reads.
|
|
692
|
+
*
|
|
693
|
+
* @param buffer - The buffer to check.
|
|
694
|
+
*/
|
|
695
|
+
ownsMemory(buffer: ArrayBufferLike): boolean;
|
|
696
|
+
/**
|
|
697
|
+
* Fills a buffer with random bytes from the system's secure random source.
|
|
698
|
+
*
|
|
699
|
+
* @param target - The buffer to fill.
|
|
700
|
+
*/
|
|
701
|
+
fillRandom(target: Uint8Array): void;
|
|
702
|
+
/** Returns the app's process identifier. */
|
|
703
|
+
processId(): number;
|
|
704
|
+
/** Returns the time at which the native module loaded, in milliseconds since the Unix epoch. */
|
|
705
|
+
processStartedAtMs(): number;
|
|
706
|
+
/**
|
|
707
|
+
* Reports whether a process with the given identifier is running.
|
|
708
|
+
*
|
|
709
|
+
* @param processId - The process to look for.
|
|
710
|
+
*/
|
|
711
|
+
processIsAlive(processId: number): boolean;
|
|
712
|
+
/** Returns the app's resident memory and the memory that the system still allows it, both in bytes. */
|
|
713
|
+
processMemory(): {
|
|
714
|
+
residentBytes: number;
|
|
715
|
+
availableBytes: number;
|
|
716
|
+
};
|
|
717
|
+
/**
|
|
718
|
+
* Runs a full garbage collection on the engine's runtime, so that the memory of dropped indexes returns to the
|
|
719
|
+
* system before the engine measures it again.
|
|
720
|
+
*
|
|
721
|
+
* @returns Whether a collection ran.
|
|
722
|
+
*/
|
|
723
|
+
collectGarbage(): boolean;
|
|
724
|
+
/** Returns the absolute path of the app's private storage directory. */
|
|
725
|
+
appStorageDirectory(): string;
|
|
726
|
+
/**
|
|
727
|
+
* Compresses bytes with raw deflate.
|
|
728
|
+
*
|
|
729
|
+
* @param raw - The bytes to compress.
|
|
730
|
+
*/
|
|
731
|
+
deflateRaw(raw: Uint8Array): Uint8Array;
|
|
732
|
+
/**
|
|
733
|
+
* Inflates raw deflate bytes of a known length.
|
|
734
|
+
*
|
|
735
|
+
* @param compressed - The compressed bytes.
|
|
736
|
+
* @param rawByteLength - The length of the inflated bytes.
|
|
737
|
+
*/
|
|
738
|
+
inflateRaw(compressed: Uint8Array, rawByteLength: number): Uint8Array;
|
|
739
|
+
/**
|
|
740
|
+
* Compresses bytes into the gzip format.
|
|
741
|
+
*
|
|
742
|
+
* @param data - The bytes to compress.
|
|
743
|
+
*/
|
|
744
|
+
gzip(data: Uint8Array): Uint8Array;
|
|
745
|
+
/**
|
|
746
|
+
* Inflates gzip bytes, and throws an error whose `code` is `EFBIG` once the output passes the limit.
|
|
747
|
+
*
|
|
748
|
+
* @param compressed - The gzip bytes.
|
|
749
|
+
* @param maxByteLength - The largest inflated length to accept.
|
|
750
|
+
*/
|
|
751
|
+
gunzip(compressed: Uint8Array, maxByteLength: number): Uint8Array;
|
|
752
|
+
/** The file calls that the native module answers. */
|
|
753
|
+
readonly files: ReactNativeFiles;
|
|
754
|
+
/** The native search core. */
|
|
755
|
+
readonly core: NativeCore;
|
|
756
|
+
}
|
|
757
|
+
|
|
224
758
|
/**
|
|
225
759
|
* Reports whether the runtime can run the SIMD module that speeds up vector
|
|
226
760
|
* distance work.
|
|
@@ -248,4 +782,4 @@ declare function isSimdAvailable(): boolean;
|
|
|
248
782
|
*/
|
|
249
783
|
declare const VERSION = "0.1.0";
|
|
250
784
|
|
|
251
|
-
export { CustomTokenizer, LanguageModule, Narsil, NarsilConfig, PartialWordSearch, PatternSearch, StopWordOverride, SynonymSearch, VERSION, clearNormalizationCache, configureNormalizationCache, createNarsil, getLanguage, getNormalizationCacheSize, getStopWords, getTokenizer, hasStopWords, hasTokenizer, isSimdAvailable, registerLanguage, registerPartialWordSearch, registerPatternSearch, registerStopWords, registerSynonyms, registerTokenizer, resetNormalizationCache };
|
|
785
|
+
export { CustomTokenizer, LanguageModule, Narsil, NarsilConfig, type NativeConnectResult, type NativeCore, type NativeGraphHandle, type NativeGraphMemory, type NativeScoreResult, type NativeSearchResult, type NativeStoreHandle, type NativeStoreMemory, PartialWordSearch, PatternSearch, type ReactNativeDirectoryEntry, type ReactNativeFileStatus, type ReactNativeFiles, type ReactNativeHost, StopWordOverride, SynonymSearch, VERSION, clearNormalizationCache, configureNormalizationCache, createNarsil, getLanguage, getNormalizationCacheSize, getStopWords, getTokenizer, hasStopWords, hasTokenizer, isSimdAvailable, registerLanguage, registerPartialWordSearch, registerPatternSearch, registerStopWords, registerSynonyms, registerTokenizer, resetNormalizationCache };
|
package/dist/index.mjs
CHANGED
|
@@ -1,31 +1,37 @@
|
|
|
1
|
-
export { VERSION, createNarsil } from './chunk-
|
|
2
|
-
import './chunk-
|
|
1
|
+
export { VERSION, createNarsil } from './chunk-VQDZVWN3.mjs';
|
|
2
|
+
import './chunk-6F6USYII.mjs';
|
|
3
|
+
export { registerSynonyms } from './chunk-O4KUNDVF.mjs';
|
|
4
|
+
export { registerPartialWordSearch, registerPatternSearch } from './chunk-3HV7M5OJ.mjs';
|
|
5
|
+
import './chunk-KAKQ74LS.mjs';
|
|
3
6
|
import './chunk-HJSN7UYG.mjs';
|
|
4
|
-
import './chunk-
|
|
7
|
+
import './chunk-6BWLDLS3.mjs';
|
|
8
|
+
import './chunk-XIHUI4KB.mjs';
|
|
9
|
+
import './chunk-Q2UL2TPC.mjs';
|
|
10
|
+
import './chunk-3MXV3VHR.mjs';
|
|
5
11
|
import './chunk-EEBCDP36.mjs';
|
|
6
|
-
export {
|
|
7
|
-
export { registerPartialWordSearch, registerPatternSearch } from './chunk-QYMAYU7M.mjs';
|
|
8
|
-
import './chunk-EBIHRL7B.mjs';
|
|
9
|
-
export { getLanguage, getStopWords, getTokenizer, hasStopWords, hasTokenizer, registerLanguage, registerStopWords, registerTokenizer } from './chunk-FRJ5RGX7.mjs';
|
|
12
|
+
export { getLanguage, getStopWords, getTokenizer, hasStopWords, hasTokenizer, registerLanguage, registerStopWords, registerTokenizer } from './chunk-2HJWQPR6.mjs';
|
|
10
13
|
import './chunk-X5CV2E2B.mjs';
|
|
11
14
|
import './chunk-TGP5M5R7.mjs';
|
|
12
15
|
import './chunk-U2BKYEC7.mjs';
|
|
16
|
+
import './chunk-ZAYWOHVG.mjs';
|
|
13
17
|
import './chunk-QHPYS427.mjs';
|
|
14
|
-
import './chunk-
|
|
15
|
-
import './chunk-
|
|
18
|
+
import './chunk-QYRNLLLI.mjs';
|
|
19
|
+
import './chunk-ZXNQEW43.mjs';
|
|
16
20
|
export { isSimdAvailable } from './chunk-KOKM4PQN.mjs';
|
|
17
|
-
import './chunk-
|
|
21
|
+
import './chunk-NVTFQFUL.mjs';
|
|
22
|
+
import './chunk-LQG5G2LY.mjs';
|
|
23
|
+
import './chunk-BTPGQC6Z.mjs';
|
|
18
24
|
import './chunk-RFBLQLLZ.mjs';
|
|
19
|
-
import './chunk-
|
|
25
|
+
import './chunk-U46IZNCW.mjs';
|
|
20
26
|
import './chunk-JUKYYXSP.mjs';
|
|
21
|
-
import './chunk-
|
|
27
|
+
import './chunk-SOUZMPME.mjs';
|
|
22
28
|
import './chunk-FQBFZAWG.mjs';
|
|
23
|
-
export { clearNormalizationCache, configureNormalizationCache, getNormalizationCacheSize, resetNormalizationCache } from './chunk-
|
|
29
|
+
export { clearNormalizationCache, configureNormalizationCache, getNormalizationCacheSize, resetNormalizationCache } from './chunk-65WCV5JO.mjs';
|
|
24
30
|
import './chunk-4UMZ7KQL.mjs';
|
|
25
|
-
import './chunk-
|
|
26
|
-
import './chunk-
|
|
31
|
+
import './chunk-ZXX5GZEX.mjs';
|
|
32
|
+
import './chunk-KYVRZAYP.mjs';
|
|
27
33
|
import './chunk-L5ORED7V.mjs';
|
|
28
34
|
import './chunk-U476IXKQ.mjs';
|
|
29
|
-
export { ClientErrorCodes, ErrorCodes, NarsilError, ServerErrorCodes, isNarsilError } from './chunk-
|
|
35
|
+
export { ClientErrorCodes, ErrorCodes, NarsilError, ServerErrorCodes, isNarsilError } from './chunk-MDF6PDIA.mjs';
|
|
30
36
|
import './chunk-R6A773WK.mjs';
|
|
31
37
|
import './chunk-YTJCGKM4.mjs';
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export { VERSION, createNarsil, registerPartialWordSearch, registerPatternSearch, registerSynonyms } from './react-native/chunks/chunk-YJSMEKRE.mjs';
|
|
2
|
+
export { isSimdAvailable } from './react-native/chunks/chunk-LQAKO5QV.mjs';
|
|
3
|
+
import './react-native/chunks/chunk-NNE4VDMM.mjs';
|
|
4
|
+
import './react-native/chunks/chunk-L4M7QJNP.mjs';
|
|
5
|
+
import './react-native/chunks/chunk-IO2SMUQD.mjs';
|
|
6
|
+
import './react-native/chunks/chunk-AM7RSBPF.mjs';
|
|
7
|
+
import './react-native/chunks/chunk-ZCKNBPQ4.mjs';
|
|
8
|
+
import './react-native/chunks/chunk-PU55IOG4.mjs';
|
|
9
|
+
import './react-native/chunks/chunk-TJMSKBEM.mjs';
|
|
10
|
+
import './react-native/chunks/chunk-DKJTZ625.mjs';
|
|
11
|
+
export { getLanguage, getStopWords, getTokenizer, hasStopWords, hasTokenizer, registerLanguage, registerStopWords, registerTokenizer } from './react-native/chunks/chunk-3CTWSQRW.mjs';
|
|
12
|
+
export { clearNormalizationCache, configureNormalizationCache, getNormalizationCacheSize, resetNormalizationCache } from './react-native/chunks/chunk-2J2727V4.mjs';
|
|
13
|
+
import './react-native/chunks/chunk-KWRW5U65.mjs';
|
|
14
|
+
import './react-native/chunks/chunk-PPEPTUVV.mjs';
|
|
15
|
+
import './react-native/chunks/chunk-LVIKKAA6.mjs';
|
|
16
|
+
import './react-native/chunks/chunk-AAAETEJK.mjs';
|
|
17
|
+
import './react-native/chunks/chunk-JV6VQY2S.mjs';
|
|
18
|
+
import './react-native/chunks/chunk-NFGBOI46.mjs';
|
|
19
|
+
export { ClientErrorCodes, ErrorCodes, NarsilError, ServerErrorCodes, isNarsilError } from './react-native/chunks/chunk-YH7W556M.mjs';
|