@@ -87,11 +87,12 @@ type ShareArgs =
8787 | (SharedBaseArgs & { lib: () => Module });
8888
8989type SharedBaseArgs = {
90- version: string ;
90+ version? : string ;
9191 shareConfig? : SharedConfig ;
9292 scope? : string | Array <string >;
9393 deps? : Array <string >;
9494 strategy? : ' version-first' | ' loaded-first' ;
95+ loaded? : boolean ;
9596};
9697
9798type SharedGetter = (() => () => Module ) | (() => Promise <() => Module >);
@@ -112,22 +113,32 @@ interface RemotesWithEntry {
112113
113114type ShareInfos = {
114115 // The name of the dependency, basic information about the dependency, and sharing strategy
115- [pkgName : string ]: Share ;
116+ [pkgName : string ]: Shared [] ;
116117};
117118
118- type Share = {
119+ type Shared = {
119120 // The version of the shared dependency
120121 version: string ;
121122 // Which modules are currently consuming this dependency
122- useIn? : Array <string >;
123+ useIn: Array <string >;
123124 // From which module does the shared dependency come?
124- from? : string ;
125+ from: string ;
125126 // Factory function to get the shared dependency instance. When no other existing dependencies, it will load its own shared dependencies.
126- lib: () => Module ;
127+ lib? : () => Module ;
127128 // Sharing strategy, which strategy will be used to decide whether to reuse the dependency
128- shareConfig? : SharedConfig ;
129+ shareConfig: SharedConfig ;
129130 // The scope where the shared dependency is located, the default value is default
130- scope? : string | Array <string >;
131+ scope: Array <string >;
132+ // Function to retrieve the shared dependency instance.
133+ get: SharedGetter ;
134+ // List of dependencies that this shared module depends on
135+ deps: Array <string >;
136+ // Indicates whether the shared dependency has been loaded
137+ loaded? : boolean ;
138+ // Represents the loading state of the shared dependency
139+ loading? : null | Promise <any >;
140+ // Determines if the shared dependency should be loaded eagerly
141+ eager? : boolean ;
131142};
132143```
133144
0 commit comments