remote-reload-utils 0.0.8 → 0.0.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,19 @@
1
+ import type { LoadRemoteOptions } from '../types';
2
+ export interface PreloadOptions extends LoadRemoteOptions {
3
+ priority?: 'idle' | 'high';
4
+ force?: boolean;
5
+ }
6
+ export declare function preloadRemote(options: PreloadOptions): Promise<{
7
+ scopeName: string;
8
+ mf: any;
9
+ } | null>;
10
+ export declare function preloadRemoteList(optionsList: PreloadOptions[], onProgress?: (loaded: number, total: number) => void): Promise<Array<{
11
+ scopeName: string;
12
+ mf: any;
13
+ } | null>>;
14
+ export declare function cancelPreload(pkg: string): void;
15
+ export declare function clearPreloadCache(): void;
16
+ export declare function getPreloadStatus(pkg: string): {
17
+ loaded: boolean;
18
+ timestamp: number;
19
+ } | null;
@@ -1,4 +1,5 @@
1
1
  import { ModuleFederationRuntimePlugin } from "@module-federation/enhanced/runtime";
2
+ export { type ModuleFederationRuntimePlugin };
2
3
  export interface LoadRemoteOptions {
3
4
  name: string;
4
5
  pkg: string;
@@ -17,3 +18,17 @@ export interface VersionCache {
17
18
  };
18
19
  };
19
20
  }
21
+ export interface PreloadOptions extends LoadRemoteOptions {
22
+ priority?: 'idle' | 'high';
23
+ force?: boolean;
24
+ }
25
+ export interface PreloadCacheItem {
26
+ version: string;
27
+ scopeName: string;
28
+ mf: any;
29
+ timestamp: number;
30
+ }
31
+ export interface PreloadStatus {
32
+ loaded: boolean;
33
+ timestamp: number;
34
+ }
@@ -0,0 +1,29 @@
1
+ interface RemoteInstance {
2
+ name: string;
3
+ scopeName: string;
4
+ pkg: string;
5
+ version: string;
6
+ mf: any;
7
+ loadedModules: Set<string>;
8
+ timestamp: number;
9
+ }
10
+ export interface UnloadOptions {
11
+ name: string;
12
+ pkg: string;
13
+ version?: string;
14
+ clearCache?: boolean;
15
+ }
16
+ export declare function unloadRemote(options: UnloadOptions): Promise<boolean>;
17
+ export declare function registerRemoteInstance(name: string, scopeName: string, pkg: string, version: string, mf: any): string;
18
+ export declare function registerLoadedModule(key: string, moduleId: string): void;
19
+ export declare function unloadAll(clearAllCache?: boolean): Promise<void>;
20
+ export declare function getLoadedRemotes(): Array<{
21
+ name: string;
22
+ pkg: string;
23
+ version: string;
24
+ loadedModules: number;
25
+ timestamp: number;
26
+ }>;
27
+ export declare function getRemoteInstance(key: string): RemoteInstance | undefined;
28
+ export declare function isRemoteLoaded(name: string, pkg: string, version?: string): boolean;
29
+ export {};
@@ -0,0 +1,34 @@
1
+ export interface VersionInfo {
2
+ major: number;
3
+ minor: number;
4
+ patch: number;
5
+ prerelease?: string;
6
+ build?: string;
7
+ raw: string;
8
+ }
9
+ export interface CompatibilityResult {
10
+ compatible: boolean;
11
+ currentVersion: string;
12
+ requiredVersion: string;
13
+ suggestion?: string;
14
+ severity: 'error' | 'warning' | 'info';
15
+ message: string;
16
+ }
17
+ export interface VersionRange {
18
+ min?: string;
19
+ max?: string;
20
+ exact?: string;
21
+ }
22
+ declare function parseVersion(version: string): VersionInfo;
23
+ declare function compareVersions(v1: string, v2: string): number;
24
+ export declare function satisfiesVersion(current: string, required: string): boolean;
25
+ export declare function checkVersionCompatibility(currentVersion: string, requiredVersion: string, packageName: string): CompatibilityResult;
26
+ export declare function findCompatibleVersion(availableVersions: string[], range: VersionRange): string | null;
27
+ export declare function getCompatibleReactVersions(hostVersion: string): string[];
28
+ export declare function fetchAvailableVersions(pkg: string): Promise<string[]>;
29
+ export declare function sortVersions(versions: string[], order?: 'asc' | 'desc'): string[];
30
+ export declare function getLatestVersion(versions: string[]): string | null;
31
+ export declare function getStableVersions(versions: string[]): string[];
32
+ export declare function extractMajorVersion(version: string): number;
33
+ export declare function isPrerelease(version: string): boolean;
34
+ export { parseVersion, compareVersions };