@module-federation/bridge-react 0.0.0-next-20240918063302 → 0.0.0-next-20240918073359

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.
package/dist/index.d.ts CHANGED
@@ -2,16 +2,14 @@ import { ComponentType } from 'react';
2
2
  import { default as default_2 } from 'react';
3
3
  import { default as default_3 } from 'react-dom/client';
4
4
  import { ErrorInfo } from 'react';
5
- import { PluginSystem } from '@module-federation/runtime/dist/src/utils/hooks';
6
5
  import { PropsWithChildren } from 'react';
7
6
  import * as React_2 from 'react';
8
- import { SyncHook } from '@module-federation/runtime/dist/src/utils/hooks';
9
-
10
- export declare type BridgeRuntimePlugin = typeof pluginSystem;
11
7
 
12
8
  export declare function createBridgeComponent<T>(bridgeInfo: ProviderFnParams<T>): () => {
13
- render(info: RenderParams): Promise<void>;
14
- destroy(info: DestroyParams): Promise<void>;
9
+ render(info: RenderFnParams & any): Promise<void>;
10
+ destroy(info: {
11
+ dom: HTMLElement;
12
+ }): Promise<void>;
15
13
  rawComponent: React_2.ComponentType<T>;
16
14
  __BRIDGE_FN__: (_args: T) => void;
17
15
  };
@@ -23,10 +21,6 @@ export declare function createRemoteComponent<T, E extends keyof T>(info: {
23
21
  export?: E;
24
22
  }): default_2.ForwardRefExoticComponent<default_2.PropsWithoutRef<ProviderParams & ("__BRIDGE_FN__" extends keyof (T[E] extends (...args: any) => any ? ReturnType<T[E]> : never) ? (T[E] extends (...args: any) => any ? ReturnType<T[E]> : never)["__BRIDGE_FN__"] extends (...args: any) => any ? Parameters<(T[E] extends (...args: any) => any ? ReturnType<T[E]> : never)["__BRIDGE_FN__"]>[0] : {} : {})> & default_2.RefAttributes<HTMLDivElement>>;
25
23
 
26
- declare type DestroyParams = {
27
- dom: HTMLElement;
28
- };
29
-
30
24
  declare type ErrorBoundaryPropsWithComponent = ErrorBoundarySharedProps & {
31
25
  fallback?: never;
32
26
  FallbackComponent: ComponentType<FallbackProps>;
@@ -51,18 +45,9 @@ declare type FallbackProps = {
51
45
  resetErrorBoundary: (...args: any[]) => void;
52
46
  };
53
47
 
54
- declare const pluginSystem: PluginSystem< {
55
- beforeBridgeRender: SyncHook<[Record<string, any>], void>;
56
- beforeBridgeDestroy: SyncHook<[Record<string, any>], void>;
57
- }>;
58
-
59
48
  declare type ProviderFnParams<T> = {
60
49
  rootComponent: React_2.ComponentType<T>;
61
50
  render?: (App: React_2.ReactElement, id?: HTMLElement | string) => RootType | Promise<RootType>;
62
- hooks?: {
63
- beforeBridgeRender?: (params: RenderFnParams) => void;
64
- beforeBridgeDestroy?: (params: DestroyParams) => void;
65
- };
66
51
  };
67
52
 
68
53
  export declare interface ProviderParams {
@@ -79,8 +64,6 @@ export declare interface RenderFnParams extends ProviderParams {
79
64
  dom: HTMLElement;
80
65
  }
81
66
 
82
- declare type RenderParams = RenderFnParams & any;
83
-
84
67
  declare type RootType = HTMLElement | default_3.Root;
85
68
 
86
69
  export { }