Skip to main content

Interface: PreloadDomainFactoryOptions<T>

Defined in: electron/preload/utils/preloadDomainFactory.ts:17

Options for safely constructing a preload domain API.

Remarks

The preload layer should be resilient during bootstrap: a single failing domain should not crash the entire preload script if we can expose a safe fallback surface instead.

This helper exists primarily to satisfy ex/no-unhandled by ensuring any synchronous exceptions thrown during domain construction are caught and converted into a deterministic fallback API.

Type Parameters

T

T

Properties

create()

readonly create: () => T

Defined in: electron/preload/utils/preloadDomainFactory.ts:19

Creates the real, fully-featured domain API.

Returns

T


createFallback()

readonly createFallback: (unavailableError: Error) => T

Defined in: electron/preload/utils/preloadDomainFactory.ts:27

Creates a fallback domain API used when PreloadDomainFactoryOptions.create throws.

Parameters

unavailableError

Error

A sanitized error explaining that the preload domain is unavailable.

Returns

T


domain

readonly domain: string

Defined in: electron/preload/utils/preloadDomainFactory.ts:29

Friendly label for diagnostics/logging.