/** * Internal dependencies */ import type { History } from '../types'; /** * Class for the history persistence layer. * * @since 0.5.0 */ export default class HistoryPersistence { /** * Checks whether there is a history for a given feature and history slug. * * @since 0.5.0 * * @param feature - Unique identifier of the feature. Must only contain lowercase letters, numbers, hyphens. * @param slug - Unique identifier of the history within the feature. Must only contain lowercase letters, numbers, hyphens. * @returns True if there is a history, false otherwise. */ hasHistory(feature: string, slug: string): Promise; /** * Loads the history for a given feature and history slug. * * @since 0.5.0 * * @param feature - Unique identifier of the feature. Must only contain lowercase letters, numbers, hyphens. * @param slug - Unique identifier of the history within the feature. Must only contain lowercase letters, numbers, hyphens. * @returns The history, or null if there is no history. */ loadHistory(feature: string, slug: string): Promise; /** * Saves the history for a given feature and history slug. * * @since 0.5.0 * * @param history - The history to save. Must have a unique feature and history slug set. * @returns True on success, false on failure. */ saveHistory(history: History): Promise; /** * Clears the history for a given feature and history slug. * * @since 0.5.0 * * @param feature - Unique identifier of the feature. Must only contain lowercase letters, numbers, hyphens. * @param slug - Unique identifier of the history within the feature. Must only contain lowercase letters, numbers, hyphens. * @returns True on success, false on failure. */ clearHistory(feature: string, slug: string): Promise; /** * Loads all histories for a given feature. * * @since 0.5.0 * * @param feature - Unique identifier of the feature. Must only contain lowercase letters, numbers, hyphens. * @returns All histories for the feature. */ loadHistoriesForFeature(feature: string): Promise; } //# sourceMappingURL=history-persistence.d.ts.map