import { Database, DocumentCollection } from "arangojs"; import { LoadBalancingStrategy } from "arangojs/lib/async/connection"; import { AqlQuery } from "arangojs/lib/cjs/aql-query"; import { Graph } from "arangojs/lib/cjs/graph"; import { Application, Id, NullableId, Paginated, Params, Service } from "feathersjs__feathers"; import { AutoDatabse } from "./auto-database"; import { GraphVertexCollection } from "arangojs/lib/cjs/graph"; export declare type ArangoDbConfig = string | string[] | Partial<{ url: string | string[]; isAbsolute: boolean; arangoVersion: number; loadBalancingStrategy: LoadBalancingStrategy; maxRetries: false | number; agent: any; agentOptions: { [key: string]: any; }; headers: { [key: string]: string; }; }>; export declare enum AUTH_TYPES { BASIC_AUTH = "BASIC_AUTH", BEARER_AUTH = "BEARER_AUTH" } export declare interface Paginate { max?: number; default?: number; } export interface IConnectResponse { database: AutoDatabse | Database; collection: DocumentCollection | GraphVertexCollection; graph?: Graph; } export interface IGraphOptions { properties?: any; opts?: { waitForSync?: boolean; }; } export interface IOptions { id?: string; expandData?: boolean; collection: DocumentCollection | GraphVertexCollection | string | Promise; database: AutoDatabse | Database | string | Promise; graph?: Graph | IGraphOptions; authType?: AUTH_TYPES; username?: string; password?: string; token?: string; dbConfig?: ArangoDbConfig; events?: any[]; paginate?: Paginate; } export interface IArangoDbService extends Service { events: any[]; paginate: Paginate; readonly id: string; readonly database: Database; readonly collection: DocumentCollection | GraphVertexCollection; connect(): Promise; setup(): Promise; } export declare class DbService { events: any[]; readonly options: IOptions; private readonly _id; private _database; private _databasePromise; private _collection; private _collectionPromise; private _graph; private _graphPromise; private _paginate; constructor(options: IOptions); connect(): Promise; readonly id: string; readonly database: AutoDatabse | Database | undefined; readonly collection: DocumentCollection | GraphVertexCollection | undefined; paginate: Paginate; _injectPagination(params: Params): Params; fixKeySend(data: T | T[]): Partial | Array>; fixKeyReturn(item: any): any; _returnMap(database: AutoDatabse | Database, query: AqlQuery, errorMessage?: string, removeArray?: boolean, paging?: boolean): Promise; find(params: Params): Promise>; get(id: Id, params: Params): Promise; create(data: Partial | Array>, params: Params): Promise; _replaceOrPatch(fOpt: string | undefined, id: NullableId | NullableId[], data: Partial, params: Params): Promise; update(id: NullableId | NullableId[], data: Partial, params: Params): Promise; patch(id: NullableId | NullableId[], data: Partial, params: Params): Promise; remove(id: NullableId | NullableId[], params: Params): Promise; setup(app: Application, path: string): Promise; } export default function ArangoDbService(options: IOptions): DbService | any;