Function: getAddonModule()
ts
function getAddonModule<T>(addon): T;Defined in: packages/valaxy/client/addons/index.ts:24
Cast a module namespace import to a plain type, breaking Rollup's static binding analysis on import * as ns namespace objects.
The identity return is intentional — the cast alone is enough to suppress IMPORT_IS_UNDEFINED warnings when accessing addon-specific exports that don't exist in the empty addon fallback module.
Type Parameters
T
T = Record<string, any>
Parameters
addon
any
Returns
T
Example
ts
import * as addonArtalk from 'valaxy-addon-artalk'
const mod = getAddonModule<typeof import('valaxy-addon-artalk')>(addonArtalk)
mod.useArtalkWithOptions?.()