UNPKG

@studiometa/js-toolkit

Version:

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

12 lines (11 loc) • 631 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. * @link https://js-toolkit.studiometa.dev/api/helpers/createApp.html */ export declare function createApp<S extends BaseConstructor<Base>, T extends BaseProps = BaseProps>(App: S, options?: HTMLElement | CreateAppOptions): () => Promise<S & Base<T>>;