@knyt/luthier
Version:
A library for building standardized, type-safe native web components with full SSR and hydration support.
22 lines • 940 B
TypeScript
import { type AnyProps, type AttributeDictionary, type HTMLElementTagName } from "@knyt/weaver";
import type { ElementDefinition } from "./types";
import type { KnytElement } from "./KnytElement";
/**
* @public
*/
export type LazyElementDefinition<T extends KnytElement.Constructor.Unknown, U extends string, P extends AnyProps = InstanceType<T>, A extends AttributeDictionary = KnytElement.ToAttributes<T>> = ElementDefinition.Fn<P> & Omit<ElementDefinition.Static<T, U, A>, "Element"> & {
/**
* @returns A promise that resolves to the constructor of the custom element.
*/
readonly Element: () => Promise<T>;
};
/**
*
* @param tagName
* @param importer
* @returns
*/
export declare function lazy<T extends KnytElement.Constructor.Unknown, U extends HTMLElementTagName>(tagName: U, importer: () => Promise<{
default: ElementDefinition<T, U>;
}>): LazyElementDefinition<T, U>;
//# sourceMappingURL=lazy.d.ts.map