import type { CollectionDescription, CollectionProperties, CollectionStatus, CollectionType, DropCollectionOptions } from "arangojs/collections"; import * as collections from "arangojs/collections"; import type { Document, DocumentData, DocumentMetadata, DocumentOperationFailure, ObjectWithDocumentId, ObjectWithDocumentKey, Patch } from "arangojs/documents"; import * as documents from "arangojs/documents"; import type { EnsureIndexOptions, IndexDescription, ObjectWithIndexId, ObjectWithName } from "arangojs/indexes"; import { ArangoQueryStreamCursor } from "./arango-cursor.js"; import { ArangoDatabase } from "./arango-database.js"; export type { CollectionDescription, CollectionProperties, CollectionStatus, CollectionType, Document, DocumentData, DocumentMetadata, DocumentOperationFailure, DropCollectionOptions, EnsureIndexOptions, IndexDescription, ObjectWithDocumentId, ObjectWithDocumentKey, ObjectWithIndexId, ObjectWithName, Patch, }; type CommonFigures = { indexes: { count: number; size: number; }; documentsSize: number; }; type CacheFigures = { cacheInUse: false; cacheSize: number; cacheUsage: number; cacheLifeTimeHitRate?: undefined; cacheWindowedHitRate?: undefined; } | { cacheInUse: true; cacheSize: number; cacheUsage: number; cacheLifeTimeHitRate: number; cacheWindowedHitRate: number; }; type EngineFigures = { engine: { documents: number; indexes: { type: string; id: number; count: number; }[]; }; }; export type Figures = CommonFigures & CacheFigures & { engine?: undefined; }; export type DetailedFigures = CommonFigures & CacheFigures & EngineFigures; export type CreateCollectionOptions = Pick; export type CreateCollectionProperties = Omit; export type TruncateCollectionOptions = { compact?: boolean; waitForSync?: boolean; }; export type RemoveByExampleOptions = { waitForSync?: boolean; limit?: number; }; export type ReplaceByExampleOptions = RemoveByExampleOptions; export type UpdateByExampleOptions = { waitForSync?: boolean; mergeObjects?: boolean; keepNull?: boolean; limit?: number; }; export type ReadDocumentOptions = { allowDirtyReads?: boolean; }; export type InsertDocumentOptions = documents.InsertDocumentOptions & { overwrite?: boolean; }; export type RemoveDocumentOptions = Omit & { overwrite?: boolean; }; export type ReplaceDocumentOptions = Omit & { overwrite?: boolean; }; export type UpdateDocumentOptions = Omit & { overwrite?: boolean; }; export type DocumentOperationResult> = DocumentMetadata & { _oldRev?: string; new?: Document; old?: Document; }; export type DocumentRemovalResult> = DocumentMetadata & { _oldRev?: string; old?: Document; }; /** @internal */ export declare function collectionToString(collection: string | ArangoCollection): string; export declare function isValidDocumentKey(documentKey: string): boolean; export declare class ArangoCollectionReference { protected _name: string; constructor(_name: string); name(): string; } export declare class ArangoCollection = any> { static STATUS_CORRUPTED: number; static STATUS_LOADED: CollectionStatus; static STATUS_DELETED: CollectionStatus; static STATUS_NEW_BORN: CollectionStatus; static STATUS_UNLOADED: CollectionStatus; static STATUS_UNLOADING: CollectionStatus; static STATUS_LOADING: CollectionStatus; static TYPE_DOCUMENT: CollectionType; static TYPE_EDGE: CollectionType; static _reference(name: string): ArangoCollectionReference; protected _db: ArangoDatabase; protected _data: CollectionDescription; protected get _arangojs(): collections.DocumentCollection & collections.EdgeCollection; constructor(db: ArangoDatabase, data: CollectionDescription); constructor(collection: ArangoCollection); isArangoCollection: boolean; get _dbName(): string; status(): CollectionStatus; checksum(withRevisions?: boolean, withData?: boolean): Promise<{ checksum: string; revision: string; }>; compact(): Promise; drop(options?: DropCollectionOptions): Promise; drop(isSystem: boolean): Promise; figures(details?: false): Promise; figures(details: true): Promise; getResponsibleShard(document: ObjectWithDocumentKey | string): Promise; name(): string; properties(properties?: collections.CollectionPropertiesOptions): Promise; recalculateCount(): Promise; rename(name: string): Promise; revision(): Promise; shards(details?: false): Promise; shards(details: true): Promise>; truncate(options?: TruncateCollectionOptions): Promise; type(): CollectionType; ensureIndex(description: EnsureIndexOptions): Promise; indexes(withStats?: boolean, withHidden?: boolean): Promise; /** * @deprecated Use `indexes()` instead. */ getIndexes: ArangoCollection["indexes"]; index(id: string | ObjectWithIndexId | ObjectWithName | number): Promise; dropIndex(index: string | ObjectWithIndexId | ObjectWithName | number): Promise; loadIndexesIntoMemory(): Promise; all(): Promise>; any(): Promise | null>; byExample(example: Record): Promise>>; count(): Promise; document(object: string | ObjectWithDocumentKey, options?: ReadDocumentOptions): Promise>; document(objects: (string | ObjectWithDocumentKey)[], options?: ReadDocumentOptions): Promise[]>; documentId(documentKey: string): string; exists(object: string | ObjectWithDocumentKey, options?: ReadDocumentOptions): Promise; firstExample(example: Record): Promise | null>; save: ArangoCollection["insert"]; insert(fromId: string, toId: string, data: DocumentData, options?: InsertDocumentOptions): Promise>; insert(data: DocumentData, options?: InsertDocumentOptions): Promise>; insert(data: DocumentData[], options?: InsertDocumentOptions): Promise<(DocumentOperationResult | DocumentOperationFailure)[]>; remove(document: string | ObjectWithDocumentKey, overwrite?: boolean, waitForSync?: boolean): Promise>; remove(document: string | ObjectWithDocumentKey, options?: RemoveDocumentOptions): Promise>; remove(documents: (string | ObjectWithDocumentKey)[], overwrite?: boolean, waitForSync?: boolean): Promise<(DocumentRemovalResult | DocumentOperationFailure)[]>; remove(documents: (string | ObjectWithDocumentKey)[], options?: RemoveDocumentOptions): Promise<(DocumentRemovalResult | DocumentOperationFailure)[]>; removeByExample(example: Partial>, options?: RemoveByExampleOptions): Promise; removeByExample(example: Partial>, waitForSync?: boolean, limit?: number): Promise; replace(document: string | ObjectWithDocumentKey, data: DocumentData, options?: ReplaceDocumentOptions): Promise>; replace(document: string | ObjectWithDocumentKey, data: DocumentData, overwrite?: boolean, waitForSync?: boolean): Promise>; replace(documents: (string | ObjectWithDocumentKey)[], data: DocumentData[], options?: ReplaceDocumentOptions): Promise<(DocumentOperationResult | DocumentOperationFailure)[]>; replace(documents: (string | ObjectWithDocumentKey)[], data: DocumentData[], overwrite?: boolean, waitForSync?: boolean): Promise<(DocumentOperationResult | DocumentOperationFailure)[]>; replaceByExample(example: Partial>, newValue: T, options?: ReplaceByExampleOptions): Promise; replaceByExample(example: Partial>, newValue: T, waitForSync?: boolean, limit?: number): Promise; update(document: string | ObjectWithDocumentKey, data: Patch>, options?: UpdateDocumentOptions): Promise>; update(document: string | ObjectWithDocumentKey, data: Patch>, overwrite?: boolean, keepNull?: boolean, waitForSync?: boolean): Promise>; update(documents: (string | ObjectWithDocumentKey)[], data: Patch>[], options?: UpdateDocumentOptions): Promise<(DocumentOperationResult | DocumentOperationFailure)[]>; update(documents: (string | ObjectWithDocumentKey)[], data: Patch>[], overwrite?: boolean, keepNull?: boolean, waitForSync?: boolean): Promise<(DocumentOperationResult | DocumentOperationFailure)[]>; updateByExample(example: Partial>, newValue: T, options?: UpdateByExampleOptions): Promise; updateByExample(example: Partial>, newValue: T, keepNull?: boolean, waitForSync?: boolean, limit?: number): Promise; edges(vertex: string | ObjectWithDocumentId | (string | ObjectWithDocumentId)[]): Promise; inEdges(vertex: string | ObjectWithDocumentId | (string | ObjectWithDocumentId)[]): Promise; outEdges(vertex: string | ObjectWithDocumentId | (string | ObjectWithDocumentId)[]): Promise; } //# sourceMappingURL=arango-collection.d.ts.map