// eslint-disable-next-line @typescript-eslint/triple-slash-reference
///
import type { moduleFederationPlugin } from '@module-federation/sdk';
import type { container, WebpackOptionsNormalized } from 'webpack';
export type ModuleFederationPluginOptions =
moduleFederationPlugin.ModuleFederationPluginOptions;
export type WebpackRequire = {
l: (
url: string | undefined,
cb: (event: any) => void,
id: string | number,
) => Record;
};
export type WebpackShareScopes = Record<
string,
Record<
string,
{ loaded?: 1; get: () => Promise; from: string; eager: boolean }
>
> & {
default?: string;
};
export type GlobalScopeType = {
[K: string]: any;
_config?: Record;
_medusa?: Record | undefined;
remoteLoading?: Record>;
};
export declare const __webpack_init_sharing__: (
parameter: string,
) => Promise;
export interface NextFederationPluginExtraOptions {
enableImageLoaderFix?: boolean;
enableUrlLoaderFix?: boolean;
exposePages?: boolean;
skipSharingNextInternals?: boolean;
automaticPageStitching?: boolean;
debug?: boolean;
}
export interface NextFederationPluginOptions
extends ModuleFederationPluginOptions {
extraOptions: NextFederationPluginExtraOptions;
}
export type Shared = ModuleFederationPluginOptions['shared'];
export type Remotes = ModuleFederationPluginOptions['remotes'];
export type SharedObject = Extract;
export type SharedConfig = Extract<
SharedObject[keyof SharedObject],
{ eager?: boolean }
>;
export type ExternalsType = Required<
ModuleFederationPluginOptions['remoteType']
>;
type ModulePath = string;
export type WebpackRemoteContainer = {
__initialized?: boolean;
get(modulePath: ModulePath): () => any;
init: (obj?: typeof __webpack_share_scopes__) => void;
};
export type AsyncContainer = Promise;
export type RemoteData = {
global: string;
url: string;
uniqueKey?: string;
};
export type RuntimeRemote = Partial & {
asyncContainer?: AsyncContainer;
global?: string;
url?: string;
};
export type RuntimeRemotesMap = Record;
type Module = WebpackOptionsNormalized['module'];
type Rules = Module['rules'];
export type RuleSetRuleUnion = Rules[0];
type RuleSetRule = Extract;
export type Loader = Extract;
// Types for MFClient
export type EventTypes = 'loadStart' | 'loadComplete' | 'loadError';
type NextRoute = string;
export type PageMap = Record;
export type GetModuleOptions = {
modulePath: string;
exportName?: string;
remoteContainer: string | RemoteData;
};
export type RemoteVars = Record<
string,
| Promise
| string
| (() => Promise)
>;