Skip to main content

Abstract Class: Adapter

Defined in: modules/core/src/adapter/adapter.ts:11

Create and attach devices for a specific backend.

Constructors​

Constructor​

new Adapter(): Adapter

Returns​

Adapter

Properties​

type​

abstract type: string

Defined in: modules/core/src/adapter/adapter.ts:13

Accessors​

pageLoaded​

Get Signature​

get pageLoaded(): Promise<void>

Defined in: modules/core/src/adapter/adapter.ts:30

Page load promise Resolves when the DOM is loaded.

Note​

Since are be limitations on number of load event listeners, it is recommended avoid calling this accessor until actually needed. I.e. we don't call it unless you know that you will be looking up a string in the DOM.

Returns​

Promise<void>

Methods​

attach()​

abstract attach(handle, props): Promise<Device>

Defined in: modules/core/src/adapter/adapter.ts:21

Attach a Device to a valid handle for this backend (GPUDevice, WebGL2RenderingContext etc)

Parameters​

handle​

unknown

props​

DeviceProps

Returns​

Promise<Device>


create()​

abstract create(props): Promise<Device>

Defined in: modules/core/src/adapter/adapter.ts:19

Create a new device for this backend

Parameters​

props​

DeviceProps

Returns​

Promise<Device>


isDeviceHandle()​

abstract isDeviceHandle(handle): boolean

Defined in: modules/core/src/adapter/adapter.ts:17

Check if the given handle is a valid device handle for this backend

Parameters​

handle​

unknown

Returns​

boolean


isSupported()​

abstract isSupported(): boolean

Defined in: modules/core/src/adapter/adapter.ts:15

Check if this backend is supported

Returns​

boolean