Skip to content

create

create<T>(ApplicationClass, config?, domElement?, resizeToDOMElement?): Promise<T> | T

Utility function to create an instance of the Application class.

Type parameters

T extends Application<any> = Application<any>

Parameters

ApplicationClass: typeof Application

The class of the application.

config?: Partial<DillPixelApplicationOptions>

The configuration options for the application.

domElement?: string | HTMLElement

The DOM element for the application.

resizeToDOMElement?: boolean

Whether to resize to the DOM element.

Returns

Promise<T> | T

An instance of the Application class.

Example

const app = await create(MyApplication, {
useSpine: true,
resizeOptions: {
minSize: { width: 375, height: 700 },
},
});

Source

src/core/create.ts:21