import { ComponentDependency, DependencyContext } from "./dependency-context"; import { JsonpGateway } from "./gateway/jsonp-gateway"; import { FetchGateway } from "./gateway/fetch-gateway"; export interface ComponentLoaderContext { dependencyContext: DependencyContext; jsonpGateway: JsonpGateway; fetchGateway: FetchGateway; } declare type ComponentRenderable = (element: HTMLElement, props: Props, state: State) => Promise; declare type RuntimeComponent = { hydrate: ComponentRenderable; render: ComponentRenderable; disconnect?: (element: HTMLElement) => void; }; export interface Component { dependencies?: ComponentDependency[]; props: Props; state: State; html?: string; client: string; styles?: string[]; resolverFunction: string; hydratePromise?: Promise; component?: RuntimeComponent; render: (element: HTMLElement) => Promise; disconnect?: (element: HTMLElement) => void; } export declare class ComponentLoader { readonly context: ComponentLoaderContext; constructor(context: ComponentLoaderContext); load>(componentUrl: string): Promise; private componentResponseFor; hydrationFactory, P, S>(componentResponse: T): Promise; runtimeComponent(externalFunction: any): Promise>; getRenderFunction(): ComponentRenderable | undefined; render(htmlElement: HTMLElement): Promise; }>; } export {};