import 'reflect-metadata';
import { BeforeInstance, LoggerInterface, Maybe } from '@worktif/utils';
import { S3Service } from '@worktif/purews';
import { EnvConfigRuntime } from '../../../../config/env.config.runtime';
import { ReactManifest } from '../../../../functions/runtime.manifest/lambda.runtime-web.manifest.types';
import { RuntimeThreads } from '../../../../../lib/runtime.types';
/**
 * Service class interacting with an AWS S3 bucket for managing static assets.
 * Extends the `S3Service` to provide additional functionalities for specific use cases related to static assets.
 * Implements the `LoggerInterface` to facilitate logging activities within the service.
 */
export declare class StaticS3Service extends S3Service implements LoggerInterface {
    protected envConfig: EnvConfigRuntime;
    /**
     * Represents an instance of a logger.
     * @typedef {Object} LoggerInstance
     * @property {string} serviceName - The name of the service using the logger.
     */
    loggerInstance: import("@aws-lambda-powertools/logger").Logger;
    /**
     * A constant variable representing the key used for caching purposes.
     * This key is utilized as an identifier to store or retrieve cached data.
     * It helps in avoiding repetitive data fetching or computation by providing
     * a consistent reference to the cached information.
     */
    cacheKey: string;
    /**
     * Represents the key used to identify the cached page in the storage.
     * This key is associated with the file path or identifier of the cached HTML page.
     */
    cachePageKey: string;
    /**
     * Cache Time-To-Live (TTL) in seconds. Defaults to 3600 seconds (1 hour).
     * Can be overridden via environment variable CACHE_TTL.
     */
    private cacheTTL;
    /**
     * Represents the runtime configuration for the system, which may or may not be defined.
     *
     * The `runtime` variable can hold an instance of `Maybe<RuntimeWebConfig>` or be undefined.
     * It is used to determine or store the current operational configuration, which may vary dynamically.
     *
     * @type {Maybe<RuntimeThreads>}
     */
    protected runtimeThreads: Maybe<RuntimeThreads>;
    /**
     * Constructor for the class.
     *
     * @param {EnvConfigRuntime} envConfig - The environment configuration object.
     */
    constructor(envConfig: EnvConfigRuntime);
    static formatResourceId(id: string): string;
    /**
     * Retrieves the content of the asset manifest file from the specified S3 bucket.
     * The asset manifest typically contains a mapping of asset files for a web application.
     *
     * @param {BeforeInstance} [beforeInstance] - Optional instance containing logging and additional contextual methods or properties.
     * @return {Promise<Maybe<string>>} A promise resolving to the content of the asset manifest if it exists, otherwise resolving to `null`.
     * @throws {CustomException} Throws an `UnprocessableEntity` exception if an issue occurs while retrieving the manifest.
     */
    getManifest(beforeInstance?: BeforeInstance): Promise<Maybe<ReactManifest>>;
    /**
     * Retrieves a cached page from an S3 bucket based on the provided URL.
     * Implements graceful error handling to prevent serverless rendering failures due to cache issues.
     *
     * @param {string} url - The URL corresponding to the cached page to retrieve.
     * @param beforeInstance
     * @return {Promise<string | null>} A promise that resolves to the cached page as a string if found, or null if not found or an error occurs.
     */
    getCachedPage(url: string, beforeInstance?: BeforeInstance): Promise<string | null>;
    /**
     * Caches the HTML content of a webpage into an S3 bucket with configurable TTL.
     * Implements graceful error handling to prevent serverless rendering failures due to cache write issues.
     *
     * @param {string} url - The URL of the webpage to cache.
     * @param {string} html - The HTML content to be cached.
     * @param beforeInstance
     * @return {Promise<void>} A promise that resolves when the caching operation is complete.
     */
    cachePage(url: string, html: string, beforeInstance?: BeforeInstance): Promise<void>;
    /**
     * Clears the S3 cache for the specified cache key within the assigned bucket.
     *
     * This method deletes the targeted cache directory in the S3 bucket to ensure that
     * cached data is no longer accessible.
     *
     * @return {Promise<void>} A promise that resolves when the cache is successfully cleared or rejects with an error if the operation fails.
     */
    clearCache(beforeInstance?: BeforeInstance): Promise<void>;
    /**
     * Represents the prefix path for the main JavaScript files in a static directory.
     * This is commonly used to define a base path for loading or referencing JavaScript files within the application.
     *
     * @type {string}
     */
    mainJsPrefix: string;
    /**
     * Retrieves the latest `main.<hash>.js` file from an S3 bucket located within the specified prefix.
     *
     * The method uses the AWS S3 ListObjectsV2 API operation to fetch the files from the bucket
     * and identifies the most recent file matching the `main.<hash>.js` pattern based on its
     * last modified date.
     *
     * @param bucketName
     * @param {BeforeInstance} [beforeInstance] - An optional before instance used to log activities and handle pre-processing.
     * @return {Promise<string>} A promise that resolves to the signed URL of the latest `main.<hash>.js` file.
     * @throws {CustomException.UnprocessableEntity} Throws this exception if an error occurs during the retrieval process
     * or if the matching files are not found in the S3 bucket.
     */
    getMainJs(beforeInstance?: BeforeInstance): Promise<string>;
    /**
     * A function that processes a given URL string and returns a substring.
     *
     * This function trims the leading character from the provided URL string,
     * removes any additional whitespace, and returns the resulting string.
     * If the operation results in a null or undefined value, it defaults to returning 'index'.
     *
     * @param {string} url - The URL string to be processed.
     * @returns {string} The processed URL substring or 'index' as default.
     */
    private urlIndex;
}
