studiocms
Version:
Astro Native CMS for AstroDB. Built from the ground up by the Astro community.
88 lines (87 loc) • 4.43 kB
TypeScript
import { Effect } from '../../../effect.js';
import { CacheContext } from '../utils.js';
declare const SDKCore_CLEAR_base: Effect.Service.Class<SDKCore_CLEAR, "studiocms/sdk/SDKCore/modules/clear", {
readonly dependencies: readonly [];
readonly effect: Effect.Effect<{
page: {
/**
* Clears a cached page by its ID.
* @param id - The ID of the page to clear from the cache.
* @returns An Effect that resolves when the operation is complete.
* @throws {UnknownException} If an error occurs during the clearing process.
*/
byId: (id: string) => Effect.Effect<void, import("../errors.js").SDKCoreError, never>;
/**
* Clears cached pages by their slug.
* @param slug - The slug of the page to clear from the cache.
* @returns An Effect that resolves when the operation is complete.
* @throws {UnknownException} If an error occurs during the clearing process.
*/
bySlug: (slug: string) => Effect.Effect<void, import("../errors.js").SDKCoreError, never>;
};
/**
* Clears all cached pages, folder trees, and folder lists.
* @remarks
* This method checks if the cache is enabled before clearing the pages, folder tree, and folder list.
* If the cache is not enabled, it simply returns without performing any action.
* @returns An Effect that resolves when the operation is complete.
* @throws {UnknownException} If an error occurs during the clearing process.
*/
pages: () => Effect.Effect<void, import("../errors.js").SDKCoreError, never>;
/**
* Clears the cached latest version information.
* @remarks
* This method checks if the cache is enabled before clearing the latest version.
* If the cache is not enabled, it simply returns without performing any action.
* @returns An Effect that resolves when the operation is complete.
* @throws {UnknownException} If an error occurs during the clearing process.
*/
latestVersion: () => Effect.Effect<void, import("../errors.js").SDKCoreError, never>;
/**
* Clears the cached folder tree and page folder tree.
* @remarks
* This method checks if the cache is enabled before clearing the folder tree and page folder tree.
* If the cache is not enabled, it simply returns without performing any action.
* @returns An Effect that resolves when the operation is complete.
* @throws {UnknownException} If an error occurs during the clearing process.
*/
folderTree: () => Effect.Effect<void, import("../errors.js").SDKCoreError, never>;
/**
* Clears the cached folder list.
* @remarks
* This method checks if the cache is enabled before clearing the folder list.
* If the cache is not enabled, it simply returns without performing any action.
* @returns An Effect that resolves when the operation is complete.
* @throws {UnknownException} If an error occurs during the clearing process.
*/
folderList: () => Effect.Effect<void, import("../errors.js").SDKCoreError, never>;
}, never, CacheContext>;
}>;
/**
* Provides cache clearing operations for various entities in the SDKCore module.
*
* @remarks
* This service exposes methods to clear cached data for pages, folders, folder trees, and version information.
* Each method checks if the cache is enabled before performing the clear operation.
* Errors are caught and handled using custom error handlers for unknown exceptions.
*
* @example
* ```typescript
* const clearService = new SDKCore_CLEAR();
* await clearService.page.byId('pageId');
* await clearService.pages();
* ```
*
* @class SDKCore_CLEAR
* @extends Effect.Service
*
* @method page.byId - Clears a cached page by its ID.
* @method page.bySlug - Clears cached pages by their slug.
* @method pages - Clears all cached pages, folder trees, and folder lists.
* @method latestVersion - Clears the cached latest version information.
* @method folderTree - Clears cached folder trees and page folder trees.
* @method folderList - Clears the cached folder list.
*/
export declare class SDKCore_CLEAR extends SDKCore_CLEAR_base {
}
export {};