import type { RenderResult } from "@knyt/weaver"; import { KnytElement, type KnytElementOptions } from "../KnytElement.ts"; import type { KnytElementComposed } from "../KnytElementComposed.ts"; import type { ElementDefinition, PropertiesDefinition } from "../types.ts"; import { type DefineElementDefinitionOptions } from "./defineElementDefinition.ts"; type RendererFn> = ( /** * @deprecated The host should be retrieved from the lifecycle function. * * ### As this API was only available in an alpha version, this WILL be removed without a major release. */ this: KnytElement.FromPropertiesDefinition, /** * @deprecated The host should be retrieved from the lifecycle function. * * ### As this API was only available in an alpha version, this WILL be removed without a major release. */ host: KnytElement.FromPropertiesDefinition) => RenderResult; /** * @internal scope: package */ type LifecycleFn> = (this: KnytElement.FromPropertiesDefinition, host: KnytElement.FromPropertiesDefinition) => RendererFn | void; /** * @internal scope: package */ export type DefineElementOptions = { tagName: TN; /** * Defines the static style sheet for the element. */ styleSheet?: KnytElement.StaticStyleSheet | null; properties?: PropertiesDefinition; /** * Defines the lifecycle of the element. * * @param _host TODO: Remove this parameter. * @returns Returns a function that renders the element. */ lifecycle: LifecycleFn>; options?: KnytElementOptions & Omit; }; /** * @internal scope: package */ export declare function defineKnytElement(params: DefineElementOptions): ElementDefinition.FromPropertiesDefinition>; /** * Sets the renderer function for a `KnytElementComposed` instance based * on the provided lifecycle function. * * @internal scope: workspace */ export declare function setComposedRenderer(element: KnytElementComposed, lifecycle: LifecycleFn): void; export {}; //# sourceMappingURL=defineKnytElement.d.ts.map