/** * Momentum API Implementation * * Provides direct database access for server-side operations. * This is the core of the Momentum API that both SSR and Express use. */ import type { MomentumConfig } from '@momentumcms/core'; import type { MomentumAPI } from './momentum-api.types'; /** * Initialize the Momentum API singleton. * Must be called once at server startup before using getMomentumAPI(). * * @param config - The Momentum configuration * @returns The initialized API instance * * @example * ```typescript * // In server.ts * import { initializeMomentumAPI } from '@momentumcms/server-core'; * import momentumConfig from './momentum.config'; * * initializeMomentumAPI(momentumConfig); * ``` */ export declare function initializeMomentumAPI(config: MomentumConfig): MomentumAPI; /** * Get the initialized Momentum API singleton. * Throws if not initialized. * * @returns The API instance * @throws Error if not initialized * * @example * ```typescript * const api = getMomentumAPI(); * const posts = await api.collection('posts').find(); * ``` */ export declare function getMomentumAPI(): MomentumAPI; /** * Check if the Momentum API has been initialized. */ export declare function isMomentumAPIInitialized(): boolean; /** * Reset the Momentum API singleton. * Primarily used for testing. */ export declare function resetMomentumAPI(): void; export type { MomentumAPI, MomentumAPIContext, CollectionOperations, GlobalOperations, FindOptions, FindResult, DeleteResult, WhereClause, FieldValidationError, VersionOperations, VersionFindOptions, } from './momentum-api.types'; export { CollectionNotFoundError, DocumentNotFoundError, DraftNotVisibleError, AccessDeniedError, GlobalNotFoundError, ValidationError, } from './momentum-api.types'; export { ReferentialIntegrityError } from '@momentumcms/core';