import type { Alternate } from "../meta";
declare enum ScriptPosition {
    Leading = "leading",
    State = "state",
    Trailing = "trailing"
}
declare enum StylePosition {
    Leading = "leading",
    Trailing = "trailing"
}
type PositionInfo = {
    position: `${StylePosition}` | `${ScriptPosition}`;
};
type StyleInfo = PositionInfo & {
    value: string;
    inline: boolean;
    attrs: Hash<string | undefined>;
};
type ScriptInfo = PositionInfo & {
    value: string;
    inline: boolean;
    attrs: Hash<string | undefined>;
};
/**
 * Template builder for creating HTML pages programmatically.
 *
 * Supports flexible composition of HTML documents with metadata, styles, scripts,
 * CSP headers, and other elements. Uses builder pattern with method chaining.
 *
 * @example
 * ```typescript
 * const template = new Template('/docs/index.html', 'en');
 * template
 *     .setTitle('My Documentation')
 *     .addStyle('/assets/styles.css')
 *     .addBody('<div>Content</div>');
 * const html = template.dump();
 * ```
 */
export declare class Template {
    /** Whether the template's language is right-to-left (RTL) */
    get isRTL(): boolean;
    /** Normalized path of the page (used for calculating base href) */
    readonly path: NormalizedPath;
    /** Language code for the page (e.g., 'en', 'ru', 'ar') */
    readonly lang: string;
    private signs;
    private title;
    private csp;
    private cspDisabled;
    private meta;
    private styles;
    private scripts;
    private body;
    private bodyClass;
    private faviconSrc;
    private canonical;
    private alternates;
    /**
     * Creates a new Template instance.
     *
     * @param path - Relative path of the page (will be normalized)
     * @param lang - Language code for the page
     * @param signs - Optional array of symbols for template identification/classification
     */
    constructor(path: RelativePath, lang: string, signs?: symbol[]);
    /**
     * Checks if the template has a specific sign.
     *
     * @param sign - Symbol to check
     * @returns `true` if template has the sign
     */
    is(sign: symbol): boolean;
    /**
     * Escapes HTML entities in a string.
     *
     * @param string - String to escape
     * @returns Escaped string with HTML entities
     */
    escape(string: string): string;
    /**
     * Unescapes HTML entities in a string.
     *
     * IMPORTANT: This method should be serializable.
     *
     * @param string - String with HTML entities
     * @returns Unescaped string
     */
    unescape(string: string): string;
    /**
     * Sets the page title (overwrites previous value).
     *
     * @param title - Page title text
     * @returns Template instance for method chaining
     */
    setTitle(title: string): this;
    /**
     * Adds a meta tag (can be called multiple times).
     *
     * @param props - Hash of meta tag attributes (e.g., `{name: 'description', content: '...'}`)
     * @returns Template instance for method chaining
     */
    addMeta(props: Hash): this;
    /**
     * Adds a CSS style (can be called multiple times).
     *
     * @param style - CSS file path or inline CSS content
     * @param options - Style options (position, inline, attrs) or legacy number parameter
     * @param options.position - Position in HTML: 'leading' (in head) or 'trailing' (end of body). Default: 'leading'
     * @param options.inline - Whether style is inline. Default: false
     * @param options.attrs - Additional HTML attributes
     * @returns Template instance for method chaining
     */
    addStyle(style: string, options?: Partial<StyleInfo> | number): this;
    /**
     * Adds a JavaScript script (can be called multiple times).
     *
     * @param script - JS file path or inline JS content
     * @param options - Script options (position, inline, attrs) or legacy number parameter
     * @param options.position - Position in HTML: 'leading' (in head), 'state' (after body opening), or 'trailing' (end of body). Default: 'trailing'
     * @param options.inline - Whether script is inline. Default: false
     * @param options.attrs - Additional HTML attributes
     * @returns Template instance for method chaining
     */
    addScript(script: string, options?: Partial<ScriptInfo> | number): this;
    /**
     * Adds content to the body (can be called multiple times, content is concatenated).
     *
     * @param body - HTML body content
     * @returns Template instance for method chaining
     */
    addBody(body: string): this;
    /**
     * Adds CSS classes to the body tag (can be called multiple times).
     *
     * @param classes - CSS class names to add
     * @returns Template instance for method chaining
     */
    addBodyClass(...classes: string[]): this;
    /**
     * Disables CSP injection for this template.
     * When disabled, all addCsp() calls become no-ops.
     *
     * @param disabled - Whether to disable CSP
     * @returns Template instance for method chaining
     */
    setCspDisabled(disabled: boolean): this;
    /**
     * Merges CSP (Content Security Policy) directives (can be called multiple times).
     * No-op when setCspDisabled(true) has been called.
     *
     * @param rules - CSP directives hash (e.g., `{'script-src': ["'self'", "'nonce-abc'"]}`)
     * @returns Template instance for method chaining
     */
    addCsp(rules: Hash<string[]>): void;
    /**
     * Sets the favicon source URL (overwrites previous value).
     *
     * @param faviconSrc - Favicon file path or URL
     * @returns Template instance for method chaining
     */
    setFaviconSrc(faviconSrc: string): this;
    /**
     * Sets the canonical URL (overwrites previous value).
     *
     * @param canonical - Canonical link URL
     * @returns Template instance for method chaining
     */
    setCanonical(canonical: string): this;
    /**
     * Adds alternate language links (can be called multiple times, duplicates are removed).
     *
     * @param alternates - Array of alternate link objects with href and hreflang
     * @returns Template instance for method chaining
     */
    addAlternates(alternates: Alternate[]): this;
    /**
     * Generates the final HTML string from the template.
     *
     * Calculates base href, formats all metadata, styles, scripts, and body content
     * into a complete HTML document. Automatically handles RTL languages and CSP nonces.
     *
     * @returns Complete HTML document as string
     */
    dump(): string;
}
export {};
