24 lines
737 B
JavaScript
24 lines
737 B
JavaScript
/**
|
|
* Live binding filled by `bare-os-ctx-discord-packed.js` when that file is
|
|
* statically imported (standalone pack entry). Dynamic `import('./x.js')`
|
|
* does not resolve under `bare:/app.bundle/`.
|
|
*
|
|
* @type {{ module: Record<string, unknown> | null }}
|
|
*/
|
|
export const bareOsDiscordRegistry = { module: null }
|
|
|
|
/**
|
|
* @param {Record<string, unknown> | null | undefined} mod
|
|
* @returns {Record<string, unknown> | null}
|
|
*/
|
|
export function registerPackedDiscordJs(mod) {
|
|
bareOsDiscordRegistry.module =
|
|
mod && typeof mod.Client === 'function' ? mod : null
|
|
return bareOsDiscordRegistry.module
|
|
}
|
|
|
|
/** @returns {Record<string, unknown> | null} */
|
|
export function takePackedDiscordJs() {
|
|
return bareOsDiscordRegistry.module
|
|
}
|