@realsee/five
Version:
Realsee Renderer SDK
38 lines (37 loc) • 992 B
TypeScript
import { BasePlugin } from '@realsee/five/plugins';
export type PluginData = {};
export type ServerData = {};
/** 插件配置 */
export interface Config {
maxOpacity: number;
}
/** 插件初始化参数 */
export interface Params {
config?: Partial<Config>;
initialState?: Partial<State>;
}
/** 插件状态 */
export interface State extends BasePlugin.State {
/** 插件是否启用 */
enabled: boolean;
/** 插件整体是否可见 */
visible: boolean;
}
export interface ConfigChangeEvent {
/** 变更前的 config */
prevConfig: Config;
/** 变更后的 config */
config: Config;
/** 是否是用户操作 */
userAction: boolean;
}
/** 插件事件 */
export interface EventMap extends BasePlugin.EventMap<State, PluginData> {
drawingChange: (drawing: boolean) => void;
/** config 变更的回调 */
configChange: (event: {
prevConfig: Config;
config: Config;
userAction: boolean;
}) => void;
}