import { type BuiltinPlugin, BuiltinPluginName, type RawProvideOptions } from '@rspack/binding'; import { RspackBuiltinPlugin } from '../builtin-plugin/base.js'; import type { Compiler } from '../Compiler.js'; import type { ShareScope } from './SharePlugin.js'; export type ProvideSharedPluginOptions = { provides: Provides; shareScope?: ShareScope; enhanced?: Enhanced; }; export type Provides = (ProvidesItem | ProvidesObject)[] | ProvidesObject; export type ProvidesItem = string; export type ProvidesObject = { [k: string]: ProvidesConfig | ProvidesItem; }; export type ProvidesConfig = Enhanced extends true ? ProvidesEnhancedConfig : ProvidesV1Config; type ProvidesV1Config = { eager?: boolean; shareKey: string; shareScope?: ShareScope; version?: false | string; }; type ProvidesEnhancedConfig = ProvidesV1Config & ProvidesEnhancedExtraConfig; type ProvidesEnhancedExtraConfig = { singleton?: boolean; strictVersion?: boolean; requiredVersion?: false | string; /** * Tree shaking strategy for the shared module. */ treeShakingMode?: 'server-calc' | 'runtime-infer'; }; export declare function normalizeProvideShareOptions(options: Provides, shareScope?: ShareScope, enhanced?: boolean): [string, { shareKey: string; version: string | false | undefined; shareScope: ShareScope; eager: boolean; } | { shareKey: string; version: string | false | undefined; shareScope: ShareScope; eager: boolean; singleton: boolean | undefined; requiredVersion: string | false | undefined; strictVersion: boolean | undefined; treeShakingMode: "runtime-infer" | "server-calc" | undefined; }][]; export declare class ProvideSharedPlugin extends RspackBuiltinPlugin { name: BuiltinPluginName; _provides: [string, Omit][]; _enhanced?: Enhanced; constructor(options: ProvideSharedPluginOptions); raw(compiler: Compiler): BuiltinPlugin; } export {};