/** * Base Consent Template * * Abstract class implementing the Template Method pattern. * Defines the overall page structure, subclasses implement auth-specific content. * * @module @kya-os/consent/templates/base/base-template */ import type { ResolvedConsentConfig } from "../../types/config.types.js"; import type { ExtendedConsentPageConfig } from "../../types/page.types.js"; import type { AuthMode } from "../../types/modes.types.js"; /** * Abstract base class for consent page templates. * * Implements the Template Method pattern: * - `render()` defines the overall structure * - Subclasses override `renderAuthContent()` for mode-specific UI * - Other methods can be overridden for customization */ export declare abstract class BaseConsentTemplate { protected config: ExtendedConsentPageConfig; protected resolved: ResolvedConsentConfig; constructor(config: ExtendedConsentPageConfig, resolved: ResolvedConsentConfig); /** * Get the auth mode identifier for this template. */ abstract get authMode(): AuthMode; /** * Render the auth-specific content section. * Must be implemented by subclasses. */ abstract renderAuthContent(): string; /** * Optional: Render mode-specific scripts. * Override in subclasses if needed. */ protected renderModeScript(): string; /** * Main render method - Template Method Pattern. * Defines the overall page structure. */ render(): string; /** * Render the section with meta tags, styles, and scripts. */ protected renderHead(): string; /** * Get the page title. */ protected getPageTitle(): string; /** * Render the page header with logo, company name, and title. */ protected renderPageHeader(): string; /** * Render the agent info section with description. * Uses config.toolDescription if provided, otherwise falls back to resolved copy. */ protected renderAgentSection(): string; /** * Render custom fields section. */ protected renderCustomFields(): string; /** * Render the terms acceptance section. */ protected renderTermsSection(): string; /** * Render the action buttons (cancel/submit). */ protected renderActionButtons(): string; /** * Render the hidden form with common fields. */ protected renderForm(): string; /** * Render the base JavaScript for form handling. */ protected renderBaseScript(): string; } //# sourceMappingURL=base-template.d.ts.map