import { IAppRoot, IAppRootConfig } from './app-root'; import type { Constructable, IContainer, IDisposable } from '@aurelia/kernel'; export interface IAurelia extends Aurelia { } export declare const IAurelia: import("@aurelia/kernel").InterfaceSymbol; export declare class Aurelia implements IDisposable { readonly container: IContainer; get isRunning(): boolean; get isStarting(): boolean; get isStopping(): boolean; get root(): IAppRoot; private next; constructor(container?: IContainer); register(...params: unknown[]): this; app(config: ISinglePageAppConfig): Omit; /** * @param parentController - The owning controller of the view created by this enhance call */ enhance(config: IEnhancementConfig): IAppRoot | Promise>; /** * Hydrate a pre-rendered DOM tree with an Aurelia component. * * Unlike `enhance()`, which compiles the host element as a template, * `hydrate()` adopts existing DOM that was pre-rendered (e.g., by SSR) * and connects it to a component that has an AOT-compiled definition. * * The component's definition (with instructions) should already be attached * to the component class - either via decorator or static `$au` property. * This is what AOT compilation produces. * * @param config - Hydration configuration including host, component, and ssrScope * @returns The app root, or a promise that resolves to it * * @example * ```typescript * // Server renders HTML with markers and manifest * // Client receives pre-rendered HTML in #app and manifest in window.__SSR_MANIFEST__ * * await aurelia.hydrate({ * host: document.getElementById('app'), * component: MyApp, // Has AOT-compiled definition * ssrScope: window.__SSR_MANIFEST__, * }); * ``` */ hydrate(config: IHydrateConfig): IAppRoot | Promise>; start(root?: IAppRoot | undefined): void | Promise; stop(dispose?: boolean): void | Promise; dispose(): void; } export type ISinglePageAppConfig = Omit, 'strictBinding'> & { host: Element; }; export type IEnhancementConfig = IAppRootConfig & { host: Element; /** * The binding context of the enhancement. Will be instantiate by DI if a constructor is given */ component: T | Constructable; /** * A predefined container for the enhanced view. */ container?: IContainer; }; import type { ISSRScope } from './templating/ssr'; export interface IHydrateConfig { /** * The host element containing pre-rendered HTML with markers. * The server-rendered content should match what the template would produce. */ host: HTMLElement; /** * The root component class. For SSR hydration, this should have an * AOT-compiled definition (needsCompile: false, instructions pre-generated). */ component: Constructable; /** * Tree-shaped SSR manifest scope for the root custom element. * Built by recordManifest() after SSR render, mirrors the controller tree. */ ssrScope?: ISSRScope; /** * Optional container for the hydrated app. */ container?: IContainer; } //# sourceMappingURL=aurelia.d.ts.map