/** * Settings Service for FlowDrop * * Provides API operations for user preferences/settings using the * configurable endpoint system. Integrates with settingsStore for * hybrid localStorage + API persistence. * * @module services/settingsService */ import type { FlowDropSettings, PartialSettings } from '../types/settings.js'; import type { EndpointConfig } from '../config/endpoints.js'; /** * Set the endpoint configuration for settings API calls * * @param config - Endpoint configuration */ export declare function setSettingsEndpointConfig(config: EndpointConfig): void; /** * Get the current endpoint configuration * * @returns Current endpoint configuration or null */ export declare function getSettingsEndpointConfig(): EndpointConfig | null; /** * Settings API namespace */ export declare const settingsApi: { /** * Get user preferences from the backend * * @returns User's saved preferences */ getPreferences(): Promise; /** * Save user preferences to the backend * * @param settings - Complete settings to save */ savePreferences(settings: FlowDropSettings): Promise; /** * Partially update user preferences * * @param partial - Partial settings to merge */ patchPreferences(partial: PartialSettings): Promise; }; /** * Settings service class for integration with settingsStore * * @example * ```typescript * import { SettingsService } from "@flowdrop/flowdrop"; * import { setSettingsService } from "@flowdrop/flowdrop"; * * const service = new SettingsService(endpointConfig); * setSettingsService(service); * ``` */ export declare class SettingsService { private config; /** * Create a new settings service instance * * @param config - Endpoint configuration */ constructor(config: EndpointConfig); /** * Get user preferences from the backend * * @returns User's saved preferences */ getPreferences(): Promise; /** * Save user preferences to the backend * * @param settings - Complete settings to save */ savePreferences(settings: FlowDropSettings): Promise; /** * Partially update user preferences * * @param partial - Partial settings to merge */ patchPreferences(partial: PartialSettings): Promise; } /** * Create a settings service instance * * @param config - Endpoint configuration * @returns SettingsService instance */ export declare function createSettingsService(config: EndpointConfig): SettingsService;