UNPKG

@visactor/vrender

Version:

```typescript import { xxx } from '@visactor/vrender'; ```

18 lines (17 loc) 970 B
import type { IApp } from '@visactor/vrender-core'; export type TVRenderSharedAppKey = string | symbol; export type TVRenderSharedAppHandle<TEnv extends string = string> = { readonly app: IApp; readonly env: TEnv; readonly key: TVRenderSharedAppKey; release: () => void; }; export declare const DEFAULT_SHARED_APP_KEY = "default"; export declare function acquireSharedApp<TRegistryEnv extends string, THandleEnv extends string = TRegistryEnv, TOptions extends { key?: TVRenderSharedAppKey; } = { key?: TVRenderSharedAppKey; }>(registryEnv: TRegistryEnv, options: TOptions, createApp: (options: TOptions) => IApp, handleEnv?: THandleEnv): TVRenderSharedAppHandle<THandleEnv>; export declare function getSharedApp<TEnv extends string>(env: TEnv, key?: TVRenderSharedAppKey): IApp | null; export declare function getAllSharedApps(): IApp[]; export declare function releaseSharedApp<TEnv extends string>(env: TEnv, key?: TVRenderSharedAppKey): void;