UNPKG

@studiometa/js-toolkit

Version:

A set of useful little bits of JavaScript to boost your project! 🚀

11 lines (10 loc) • 562 B
import type { Base, BaseConstructor, BaseProps } from '../Base/index.js'; import type { Features } from '../Base/features.js'; export type CreateAppOptions = Partial<Features> & { root?: HTMLElement; }; /** * Instantiate and mount the given component on the given root element when the page has been loaded * and return a function to use the app instance when it is ready. */ export declare function createApp<S extends BaseConstructor<Base>, T extends BaseProps = BaseProps>(App: S, options?: HTMLElement | CreateAppOptions): () => Promise<S & Base<T>>;