UNPKG

@vercel/microfrontends

Version:

Defines configuration and utilities for microfrontends development

71 lines (68 loc) 2.22 kB
import { C as Config } from '../types-c9f15465.js'; import { O as OverridesConfig } from '../types-bee19651.js'; import { MicrofrontendConfigIsomorphic } from '../config.js'; import '../types-b970b583.js'; declare class MicrofrontendsServer { config: MicrofrontendConfigIsomorphic; constructor({ config, overrides, }: { config: Config; overrides?: OverridesConfig; }); /** * Writes the configuration to a file. */ writeConfig(opts?: { pretty?: boolean; }): void; /** * Generates a MicrofrontendsServer instance from an unknown object. */ static fromUnknown({ config, cookies, }: { config: unknown; cookies?: { name: string; value: string; }[]; }): MicrofrontendsServer; /** * Generates a MicrofrontendsServer instance from the environment. * Uses additional validation that is only available when in a node runtime */ static fromEnv({ cookies, }: { cookies: { name: string; value: string; }[]; }): MicrofrontendsServer; /** * Validates the configuration against the JSON schema */ static validate(config: string | Config): Config; /** * Looks up the configuration by inferring the package root and looking for a microfrontends config file. If a file is not found, * it will look for a package in the repository with a microfrontends file that contains the current application * and use that configuration. * * This can return either a Child or Main configuration. */ static infer({ directory, filePath, cookies, }?: { directory?: string; filePath?: string; cookies?: { name: string; value: string; }[]; }): MicrofrontendsServer; static fromFile({ filePath, cookies, }: { filePath: string; cookies?: { name: string; value: string; }[]; }): MicrofrontendsServer; static fromMainConfigFile({ filePath, overrides, }: { filePath: string; overrides?: OverridesConfig; }): MicrofrontendsServer; } export { MicrofrontendsServer };