import { FieldIndexing, FieldStorage, FieldTermVector } from "./Enums.js"; import { MetadataObject } from "../Session/MetadataObject.js"; import { AttachmentName, IAttachmentObject } from "../Attachments/index.js"; import { CapitalizeType } from "../../Types/index.js"; import { FieldVectorOptions } from "../Queries/VectorSearch/VectorSearchOptions.js"; import { Stream } from "node:stream"; export type IndexingMapDefinition = (document: TInput) => TOutput | TOutput[]; export type IndexingReduceDefinition = (result: IndexingGroupResults) => IndexingMapReduceFormatter; type KeySelector = (document: TDocument) => TKey; export interface CreateFieldOptions { storage?: boolean; indexing?: FieldIndexing; termVector?: FieldTermVector; vector?: FieldVectorOptions; } export interface IndexingMapUtils { load(documentId: string, collection: string): T; cmpxchg(key: string): T; getMetadata(document: any): MetadataObject; id(document: any): string; createSpatialField(wkt: string): SpatialField; createSpatialField(lat: number, lng: number): SpatialField; createField(name: string, value: any, options: CreateFieldOptions): void; createVector(values: number[]): void; createVector(values: number[][]): void; createVector(value: Stream): void; createVector(values: Stream[]): void; createVector(values: string[]): void; createVector(values: string[][]): void; attachmentsFor(document: any): CapitalizeType[]; loadAttachment(document: any, attachmentName: string): IAttachmentObject; loadAttachments(document: any): IAttachmentObject[]; loadVector(path: string, embeddingsGenerationTaskIdentifier?: string): void; loadVector(path: string, embeddingsGenerationTaskIdentifier?: string, embeddingsSourceDocumentId?: string, embeddingsSourceDocumentCollectionName?: string): void; noTracking: NoTrackingUtils; } export interface NoTrackingUtils { load(documentId: string, collection: string): T; } export declare class StubMapUtils implements IndexingMapUtils { load: (documentId: string, collection: string) => T; cmpxchg: (key: string) => T; getMetadata: (document: any) => MetadataObject; id: (document: any) => string; createSpatialField: (wktOrLat: string | number, lng?: number) => void; createField: (name: string, value: any, options?: CreateFieldOptions) => void; createVector: (values: number[] | number[][] | Stream[] | string[] | string[][] | Stream) => void; attachmentsFor: (document: any) => CapitalizeType[]; loadAttachment: (document: any, attachmentName: string) => IAttachmentObject; loadAttachments: (document: any) => IAttachmentObject[]; loadVector: (path: string, embeddingsGenerationTaskIdentifier?: string, embeddingsSourceDocumentId?: string, embeddingsSourceDocumentCollectionName?: string) => void; noTracking: NoTrackingUtils; } interface Group { key: TKey; values: TDocument[]; } export declare class IndexingGroupResults { groupBy(selector: KeySelector): TKey extends void ? never : IndexingReduceResults; } export declare class IndexingReduceResults { private _group; constructor(selector: KeySelector); aggregate(reducer: IndexingMapDefinition, TDocument>): IndexingMapReduceFormatter; } export declare class IndexingMapReduceFormatter { private _groupBy; private _aggregate; constructor(groupBy: KeySelector, aggregate: IndexingMapDefinition, any>); format(): string; } export type CreatedFieldOptions = { storage?: FieldStorage | boolean; indexing?: FieldIndexing; termVector?: FieldTermVector; }; export type CreatedField = { $value: any; $name: string; $options: CreatedFieldOptions; }; export type SpatialField = void; export {}; //# sourceMappingURL=StronglyTyped.d.ts.map