import type { CslItem } from "../core/csl-json/types.js"; import type { FindOptions, RemoveResult as ILibraryRemoveResult, RemoveOptions, UpdateOptions, UpdateResult } from "../core/library-interface.js"; import type { AddAttachmentOptions, AddAttachmentResult, AddReferencesResult, CheckOperationOptions, CheckOperationResult, CiteResult, DetachAttachmentOptions, DetachAttachmentResult, GetAttachmentOptions, GetAttachmentResult, ILibraryOperations, ImportOptions, ListAttachmentsOptions, ListAttachmentsResult, ListOptions, ListResult, OpenAttachmentOptions, OpenAttachmentResult, SearchOperationOptions, SearchResult, SyncAttachmentOptions, SyncAttachmentResult } from "../features/operations/index.js"; import type { IdentifierType } from "../core/library-interface.js"; /** * Options for cite method. */ export interface CiteOptions { identifiers: string[]; idType?: IdentifierType; inText?: boolean; style?: string; cslFile?: string; locale?: string; format?: "text" | "html"; } /** * Client for communicating with the reference-manager HTTP server. */ export declare class ServerClient implements ILibraryOperations { private baseUrl; constructor(baseUrl: string); /** * Get all references from the server. * @returns Array of CSL items */ getAll(): Promise; /** * Find reference by citation ID or UUID. * @param identifier - Citation ID or UUID * @param options - Find options (idType to specify identifier type) * @returns CSL item or undefined if not found */ find(identifier: string, options?: FindOptions): Promise; /** * Add new reference to the library. * @param item - CSL item to add * @returns The added CSL item (with generated ID and UUID) */ add(item: CslItem): Promise; /** * Update reference by citation ID or UUID. * @param identifier - Citation ID or UUID * @param updates - Partial CSL item with fields to update * @param options - Update options (idType to specify identifier type, onIdCollision for collision handling) * @returns Update result with updated item, success status, and any ID changes */ update(identifier: string, updates: Partial, options?: UpdateOptions): Promise; /** * Remove a reference by citation ID or UUID. * @param identifier - The citation ID or UUID of the reference to remove * @param options - Remove options (idType to specify identifier type) * @returns Remove result with removed status and removedItem */ remove(identifier: string, options?: RemoveOptions): Promise; /** * Save is a no-op for ServerClient (HTTP requests are already persisted). */ save(): Promise; /** * Import references from various input formats. * @param inputs - Array of inputs (file paths, PMIDs, DOIs) * @param options - Options for import operation * @returns Result containing added, failed, and skipped items */ import(inputs: string[], options?: ImportOptions): Promise; check(options: CheckOperationOptions): Promise; /** * Generate citations for references. * @param options - Cite options including identifiers and formatting * @returns Cite result with per-identifier results */ cite(options: CiteOptions): Promise; /** * List all references. * @param options - Pagination and sorting options * @returns List result with raw CslItem[] */ list(options?: ListOptions): Promise; /** * Search references with query. * @param options - Search options including query and pagination * @returns Search result with raw CslItem[] */ search(options: SearchOperationOptions): Promise; /** * Add attachment to a reference. * @param options - Add attachment options * @returns Result of the add operation */ attachAdd(options: AddAttachmentOptions): Promise; /** * List attachments for a reference. * @param options - List attachments options * @returns List of attachments */ attachList(options: ListAttachmentsOptions): Promise; /** * Get attachment file path or content. * @param options - Get attachment options * @returns Attachment file path or content */ attachGet(options: GetAttachmentOptions): Promise; /** * Detach attachment from a reference. * @param options - Detach attachment options * @returns Result of the detach operation */ attachDetach(options: DetachAttachmentOptions): Promise; /** * Sync attachments with files on disk. * @param options - Sync attachment options * @returns Sync result */ attachSync(options: SyncAttachmentOptions): Promise; /** * Open attachment directory or file. * @param options - Open attachment options * @returns Result of the open operation */ attachOpen(options: OpenAttachmentOptions): Promise; } //# sourceMappingURL=server-client.d.ts.map