@netless/appliance-plugin 1.1.6-beta.0 → 1.1.7-beta.0

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.
@@ -3,7 +3,7 @@ import { MemberState, AppliancePluginLike, AppliancePluginOptions } from "./type
3
3
  import { Collector, ViewId } from "../collector";
4
4
  import { RoomMemberManager } from "../members";
5
5
  import { TextEditorManager } from "../component/textEditor";
6
- import type { Camera, Displayer, DisplayerCallbacks, Player, PriorityType, Rectangle, Room, RoomMember, _ArrayTrue } from "./types";
6
+ import type { Camera, Displayer, DisplayerCallbacks, IconifyInformation, Player, PriorityType, Rectangle, Room, RoomMember, _ArrayTrue } from "./types";
7
7
  import { CursorManager } from "../cursors";
8
8
  import { ViewContainerManager } from "./baseViewContainerManager";
9
9
  import { MasterControlForWorker } from "../core/mainEngine";
@@ -13,6 +13,7 @@ import { ICameraOpt } from "../core/types";
13
13
  import { HotkeyManager } from "../hotkey";
14
14
  import { RenderCotrolImple } from "../core/renderCotrol";
15
15
  import { MiniMapManagerImpl } from "../component/miniMap/manager";
16
+ import { PluginManager, Plugin } from "../core/plugin";
16
17
  export interface BaseApplianceManagerProps {
17
18
  displayer: Displayer<DisplayerCallbacks>;
18
19
  plugin?: AppliancePluginLike;
@@ -40,6 +41,7 @@ export declare abstract class BaseApplianceManager {
40
41
  abstract readonly viewContainerManager: ViewContainerManager;
41
42
  readonly renderControl: RenderCotrolImple;
42
43
  readonly miniMapManager: MiniMapManagerImpl;
44
+ readonly pluginManager: PluginManager;
43
45
  constructor(params: BaseApplianceManagerProps);
44
46
  setPriority(priority: PriorityType): void;
45
47
  hasOffscreenCanvas(): boolean;
@@ -100,4 +102,6 @@ export declare abstract class BaseApplianceManager {
100
102
  cancelFilterRender(viewId: ViewId, isSync?: boolean): void;
101
103
  createMiniMap(viewId: string, div: HTMLElement): Promise<void>;
102
104
  destroyMiniMap(viewId: string): Promise<void>;
105
+ insertIconify(viewId: string, iconifyInfo: IconifyInformation): void;
106
+ usePlugin(plugin: Plugin): void;
103
107
  }
@@ -9,6 +9,8 @@ import type { ApplianceSinglePlugin } from "./applianceSinglePlugin";
9
9
  import type { ApplianceMultiPlugin } from "./applianceMultiPlugin";
10
10
  import type { ECanvasContextType } from "../core/enum";
11
11
  import { AuthRenderScenesData } from "../core/renderCotrol";
12
+ import type { Plugin } from "../core/plugin";
13
+ export { Plugin } from "../core/plugin";
12
14
  export type { Room, ImageInformation, Point, Size, Rectangle, RoomMember, RoomState, Player, HotKeys, Camera, Displayer, DisplayerCallbacks, CameraState, View, Cursor, CursorAdapter, RenderEngine, _MemberState };
13
15
  export declare enum ApplianceNames {
14
16
  /**
@@ -127,7 +129,7 @@ export type ApplianceAdaptor = {
127
129
  logger?: Logger;
128
130
  cursorAdapter?: CursorAdapter;
129
131
  };
130
- export type canBindMethodType = keyof Omit<AppliancePluginInstance, 'displayer' | 'windowManager' | 'injectMethodToObject' | 'callbacksOn' | 'callbacksOnce' | 'callbacksOff' | '_injectTargetObject' | 'createMiniMap' | 'destroyMiniMap' | 'filterRenderByUid' | 'cancelFilterRender' | 'addListener' | 'removeListener'>;
132
+ export type canBindMethodType = keyof Omit<AppliancePluginInstance, 'displayer' | 'windowManager' | 'injectMethodToObject' | 'callbacksOn' | 'callbacksOnce' | 'callbacksOff' | '_injectTargetObject' | 'createMiniMap' | 'destroyMiniMap' | 'filterRenderByUid' | 'cancelFilterRender' | 'addListener' | 'removeListener' | 'usePligiun'>;
131
133
  export interface AppliancePluginInstance {
132
134
  readonly displayer: Displayer;
133
135
  readonly currentManager?: ApplianceManagerLike;
@@ -232,6 +234,11 @@ export interface AppliancePluginInstance {
232
234
  * 移除事件监听器
233
235
  */
234
236
  removeListener(event: PublicEvent, callback: PublicCallback<PublicEvent>): void;
237
+ /**
238
+ * 使用插件
239
+ * @param plugin 插件
240
+ */
241
+ usePligiun(plugin: Plugin): void;
235
242
  }
236
243
  export type Logger = {
237
244
  readonly info: (...messages: any[]) => void;
@@ -411,3 +418,41 @@ export type PublicListener = {
411
418
  };
412
419
  export type PublicEvent = keyof PublicListener;
413
420
  export type PublicCallback<T extends PublicEvent> = PublicListener[T];
421
+ export type IconifyInformation = {
422
+ /**
423
+ * inconify svg url
424
+ */
425
+ src: string;
426
+ /**
427
+ * 图片的唯一识别符
428
+ */
429
+ uuid: string;
430
+ /**
431
+ * 图片中点在世界坐标系中的 x 坐标
432
+ */
433
+ centerX: number;
434
+ /**
435
+ * 图片中点在世界坐标系中的 y 坐标
436
+ */
437
+ centerY: number;
438
+ /**
439
+ * 图片中点在世界坐标系中的宽
440
+ */
441
+ width: number;
442
+ /**
443
+ * 图片中点在世界坐标系中的高
444
+ */
445
+ height: number;
446
+ /**
447
+ * 图片是否被锁定
448
+ */
449
+ locked: boolean;
450
+ /**
451
+ * 图片是否禁止非等比放缩
452
+ */
453
+ uniformScale?: boolean;
454
+ /**
455
+ * 是否以跨域方式加载图片
456
+ */
457
+ crossOrigin?: boolean | string;
458
+ };