/** * @packageDocumentation * * An Rsbuild plugin that integrates Vanilla Lynx applications with Rspeedy. */ import type { LynxTemplatePlugin as LynxTemplatePlugin_2 } from '@lynx-js/template-webpack-plugin'; import type { RsbuildPlugin } from '@rsbuild/core'; import type { TemplateHooks } from '@lynx-js/template-webpack-plugin'; /** * Rspack layers used by Vanilla Lynx entries. * * @public */ export declare const LAYERS: Readonly<{ BACKGROUND: 'vanilla:background'; MAIN_THREAD: 'vanilla:main-thread'; }>; export declare interface LynxTemplatePlugin { getLynxTemplatePluginHooks: typeof LynxTemplatePlugin_2.getLynxTemplatePluginHooks; } /** * Create the Vanilla Lynx DSL integration for Rsbuild or Rspeedy. * * A logical entry can explicitly declare its main-thread and background-thread * sources. As a shorthand, an Rsbuild entry is treated as the main-thread * source and optional sibling `background.ts` and `style.css` files are * discovered by convention. * * @public */ export declare function pluginVanillaLynx(options?: PluginVanillaLynxOptions): RsbuildPlugin; /** * Options for {@link pluginVanillaLynx}. * * @public */ export declare interface PluginVanillaLynxOptions { /** * Explicit two-thread entries. * * @remarks * When omitted, every Rsbuild `source.entry` is treated as a main-thread * entry and optional sibling `background.ts` and `style.css` files are * discovered by convention. */ entries?: Record | undefined; /** * Override the final `.bundle` filename. * * @remarks * When omitted, `pluginLynx`'s `output.filename.bundle` is used (default * `'[name].[platform].bundle'`). */ bundleFilename?: VanillaBundleFilename | undefined; /** * The minimum Lynx Engine version required by the emitted bundle. * * @defaultValue `'3.5'` */ engineVersion?: string | undefined; /** * Alias of {@link PluginVanillaLynxOptions.engineVersion}. * * @deprecated Use `engineVersion` instead. */ targetSdkVersion?: string | undefined; } export { TemplateHooks } /** * The final Vanilla Lynx bundle filename. * * @public */ export declare type VanillaBundleFilename = string | ((context: VanillaBundleFilenameContext) => string); /** * Context passed to a Vanilla Lynx bundle filename function. * * @public */ export declare interface VanillaBundleFilenameContext { /** The logical Rsbuild entry name. */ entryName: string; /** Vanilla Lynx currently emits only the main card bundle. */ lazyBundle: false; /** The Rsbuild environment name. */ platform: string; } /** * The two thread source files of a logical Vanilla Lynx entry. * * @public */ export declare interface VanillaLynxEntry { /** * Module request executed on the Lynx main thread with Element PAPI globals. * * @remarks * The request is resolved by Rspeedy or Rsbuild. When it names an existing * local file, optional sibling `background.ts` and `style.css` files are * discovered by convention. */ mainThread: string; /** * Source executed in the background JavaScript thread. * * @remarks * When omitted, a sibling `background.ts` is used when it exists. Set this * to `false` to explicitly create a main-thread-only bundle. */ background?: string | false | undefined; /** * CSS source encoded into the Lynx template. * * @remarks * When omitted, a sibling `style.css` is used when it exists. Set this to * `false` to disable the convention. */ css?: string | false | undefined; } export { }