F

definePlatform

Selects the Platform handler for the host platform, so an addon branches on the platform in one place.

function definePlatform<Handler>(handlers: PlatformHandlers<Handler>): Handler

Parameters

NameTypeDescription
handlersPlatformHandlers<Handler>

The handler for each platform the addon runs on.

Returns

Handler

The host platform's handler.