UNPKG

next-flow-interface

Version:

Interface package for NEXT FlOW. You can use this package to build your own plugin that can control anything.

1,712 lines (1,560 loc) 106 kB
import { SwitchProps, EmptyProps, InputNumberProps, SelectProps } from 'antd'; import { ColorPickerProps, Color } from 'antd/es/color-picker'; import React$1, { ReactNode, MouseEventHandler, DetailedHTMLProps, HTMLAttributes, FunctionComponent, MouseEvent as MouseEvent$1, Attributes } from 'react'; import { DefaultOptionType } from 'antd/es/select'; import { RvPath, RhineVarMap, StoredRhineVar, RecursiveObject, RecursiveMap, RecursiveArray, RhineVarArray } from 'rhine-var'; import { Node, NodeMaterialBlockConnectionPointTypes, BaseTexture, PBRMaterial, NodeMaterial, Animation, Color3, Color4, Scene, Material, NodeMaterialBlock, ShadowGenerator, AnimationGroup as AnimationGroup$1, TransformNode, Vector3, ArcRotateCamera, Light, CubeTexture, AbstractMesh, Mesh, Texture, DynamicTexture, Engine, WebGPUEngine, WebXRDefaultExperience, Quaternion } from '@babylonjs/core'; import { AnimationGroup } from '@babylonjs/core/Animations/animationGroup'; import { TransformNode as TransformNode$1 } from '@babylonjs/core/Meshes/transformNode'; import { Root } from 'react-dom/client'; import { AnyWebByteStream } from 'strtok3'; interface AntCheckboxProps extends SwitchProps { value: boolean; onChange: (value: boolean) => void; className?: string | undefined; label?: string; } interface AntColorProps extends ColorPickerProps { value: Color | string | null; onColorChange: (value: string) => void; className?: string; classNameInner?: string; theme?: string; } interface AntEmptyProps extends EmptyProps { className?: string; classNameInner?: string; image?: ReactNode; description?: ReactNode; children?: ReactNode; } interface AntNumberProps extends Omit<InputNumberProps, 'onChange'> { value: number | null; onChange: (value: number | null) => void; placeholder?: string; className?: string; classNameInner?: string; theme?: string; } interface AntSelectProps<ValueType> extends SelectProps<ValueType> { value?: ValueType; onChange?: (value: ValueType, option?: DefaultOptionType | DefaultOptionType[]) => void; showSearch?: boolean; onClick?: MouseEventHandler<HTMLDivElement>; className?: string; classNameInner?: string; placeholder?: string; optionFilterProp?: string; size?: 'small' | 'middle' | 'large' | undefined; options?: DefaultOptionType[]; } interface AntSwitchProps extends SwitchProps { value: boolean; onChange: (value: boolean) => void; className?: string | undefined; } declare enum ThemeBackground { DEFAULT = "DEFAULT", BACKGROUND = "BACKGROUND", LIGHT = "LIGHT", DARK = "DARK" } declare enum ThemeColor { GREEN = "GREEN", PURPLE = "PURPLE", BLUE = "BLUE", PINK = "PINK" } interface ThemeProviderProps { children?: React.ReactNode; color?: ThemeColor; background?: ThemeBackground; } interface FlexGrowProps { value?: number; } interface InternationalizationProviderProps { children?: ReactNode; } interface MainPortalProps { children: ReactNode; } type DivProps = DetailedHTMLProps<HTMLAttributes<HTMLDivElement>, HTMLDivElement>; type SpanProps = DetailedHTMLProps<HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>; type DivPropsSimple = Omit<DivProps, 'onChange' | 'defaultValue'>; type SpanPropsSimple = Omit<SpanProps, 'onChange' | 'defaultValue'>; interface AnchorProps extends DivProps { list: string[]; value: number; onSelectChange: (value: number) => void; middle?: boolean; } interface ContextMenuController { contextMenu: ContextMenu; show(): void; destroy(): void; } declare enum MenuLineType { BUTTON = "BUTTON",// 单个点击用按钮 DIVIDER = "DIVIDER",// 分割线 CHECKBOX = "CHECKBOX",// 单个可选中复选框 SUB = "SUB",// 二级菜单 VIEW = "VIEW" } interface MenuLineCreateOptions { id?: string; type?: MenuLineType; text?: string; tip?: string; icon?: FunctionComponent; view?: FunctionComponent; color?: string; disabled?: boolean; shortcut?: string; onClick?: (e: MouseEvent$1) => void; onMouseOver?: (e: MouseEvent$1) => void; onMouseOut?: (e: MouseEvent$1) => void; closeAllOnClick?: boolean; checkboxDefaultValue?: boolean; onCheckboxChange?: (value: boolean) => void; sub?: ContextMenuCreateOptions; } interface ContextMenuCreateOptions { id?: string; lines?: MenuLineCreateOptions[]; showIcon?: boolean; x?: number; y?: number; closeOnOutsideClick?: boolean; theme?: ThemeColor; onClose?: () => void; } declare class MenuLine { options: MenuLineCreateOptions; id: string; type: MenuLineType; text: string; tip: string; icon: FunctionComponent | undefined; view: FunctionComponent | undefined; color: string; disabled: boolean; shortcut: string; onClick: (e: MouseEvent$1) => void; onMouseOver: (e: MouseEvent$1) => void; onMouseOut: (e: MouseEvent$1) => void; closeAllOnClick: boolean; checkboxDefaultValue: boolean; onCheckboxChange: (value: boolean) => void; sub: ContextMenuCreateOptions | undefined; createTime: Date; constructor(options: MenuLineCreateOptions, id: string, type?: MenuLineType, text?: string, tip?: string, icon?: FunctionComponent | undefined, view?: FunctionComponent | undefined, color?: string, disabled?: boolean, shortcut?: string, onClick?: (e: MouseEvent$1) => void, onMouseOver?: (e: MouseEvent$1) => void, onMouseOut?: (e: MouseEvent$1) => void, closeAllOnClick?: boolean, checkboxDefaultValue?: boolean, onCheckboxChange?: (value: boolean) => void, sub?: ContextMenuCreateOptions | undefined, // 子菜单项 createTime?: Date); static fromOptions(id: string, options: MenuLineCreateOptions): MenuLine; } declare class ContextMenu { options: ContextMenuCreateOptions; id: string; lines: MenuLine[]; showIcon: boolean; x: number; y: number; closeOnOutsideClick: boolean; theme?: ThemeColor | undefined; controller: ContextMenuController | null; createTime: Date; constructor(options: ContextMenuCreateOptions, id: string, lines?: MenuLine[], showIcon?: boolean, x?: number, y?: number, closeOnOutsideClick?: boolean, theme?: ThemeColor | undefined, controller?: ContextMenuController | null, createTime?: Date); static fromOptions(id: string, options: ContextMenuCreateOptions, menuLines?: MenuLine[]): ContextMenu; } interface ContextMenuProps extends DivProps { contextMenus: ContextMenu; } interface DialogCreateOptions { id?: string; title?: string; titleIcon?: FunctionComponent | string; content?: string; contentAlign?: DialogContentAlign; contentView?: FunctionComponent | string; icon?: FunctionComponent | string; view?: FunctionComponent | string; theme?: ThemeColor; leftMode?: boolean; className?: string; style?: object; confirmText?: string; cancelText?: string; enableCloseButton?: boolean; enableInput?: boolean; defaultValue?: string; inputPlaceholder?: string; autoFocus?: boolean; allowEmpty?: boolean; onChange?: (value: string) => void; onCheck?: (value: string) => boolean; onConfirm?: (value: string) => void; onCancel?: () => void; onClose?: () => void; onConfirmButtonClick?: () => void; onCancelButtonClick?: () => void; onOutsideClick?: () => void; onCloseButtonClick?: () => void; onRender?: () => void; onEffect?: () => () => void; closeOnConfirm?: boolean; closeOnCancel?: boolean; closeOnOutsideClick?: boolean; closeOnCloseButtonClick?: boolean; alignButton?: boolean; } declare enum DialogContentAlign { LEFT = "LEFT", CENTER = "CENTER", RIGHT = "RIGHT" } declare class Dialog { options: DialogCreateOptions; id: string; title: string; titleIcon: FunctionComponent | string | undefined; content: string; contentAlign: DialogContentAlign; contentView: FunctionComponent | string | undefined; icon: FunctionComponent | string | undefined; view: FunctionComponent | string | undefined; theme: ThemeColor; leftMode: boolean; className: string; style: object; confirmText: string; cancelText: string; enableInput: boolean; defaultValue: string; inputPlaceholder: string; autoFocus: boolean; allowEmpty: boolean; onChange: (value: string) => void; onCheck: (value: string) => boolean; enableCloseButton: boolean; onConfirm: (value: string) => void; onCancel: () => void; onClose: () => void; onConfirmButtonClick: () => void; onCancelButtonClick: () => void; onOutsideClick: () => void; onCloseButtonClick: () => void; onRender: () => void; onEffect: () => () => void; closeOnConfirm: boolean; closeOnCancel: boolean; closeOnOutsideClick: boolean; closeOnCloseButtonClick: boolean; alignButton: boolean; inputValue: string; createTime: Date; focusInput: () => void; elements: Map<string, HTMLElement>; constructor(options: DialogCreateOptions, id: string, title?: string, titleIcon?: FunctionComponent | string | undefined, content?: string, contentAlign?: DialogContentAlign, contentView?: FunctionComponent | string | undefined, icon?: FunctionComponent | string | undefined, view?: FunctionComponent | string | undefined, theme?: ThemeColor, leftMode?: boolean, className?: string, style?: object, confirmText?: string, cancelText?: string, enableInput?: boolean, defaultValue?: string, inputPlaceholder?: string, autoFocus?: boolean, allowEmpty?: boolean, onChange?: (value: string) => void, onCheck?: (value: string) => boolean, enableCloseButton?: boolean, onConfirm?: (value: string) => void, onCancel?: () => void, onClose?: () => void, onConfirmButtonClick?: () => void, onCancelButtonClick?: () => void, onOutsideClick?: () => void, onCloseButtonClick?: () => void, onRender?: () => void, onEffect?: () => () => void, closeOnConfirm?: boolean, closeOnCancel?: boolean, closeOnOutsideClick?: boolean, closeOnCloseButtonClick?: boolean, alignButton?: boolean, inputValue?: string, createTime?: Date, focusInput?: () => void, elements?: Map<string, HTMLElement>); static fromOptions(id: string, options: DialogCreateOptions): Dialog; setHide: (value: boolean) => void; } interface DialogProps extends DivProps { dialog: Dialog; } interface FileProgressBarProps extends DivProps { size: string; value: number; className?: string; theme?: string; } interface MaterialSymbolProps extends SpanProps { size?: string; color?: string; className?: string; fill?: boolean; } interface ProgressBarProps extends React$1.HTMLAttributes<HTMLDivElement> { value?: number; indeterminate?: boolean; slowTransition?: boolean; innerClassName?: string; } interface ResourcePreviewProps extends DivProps { className?: string; mime?: string; preview?: string; } interface ScrollBarProps extends Omit<HTMLAttributes<HTMLDivElement>, 'children'> { children: ReactNode | undefined; className?: string; innerClassName?: string; barPaddingStart?: string; barPaddingEnd?: string; } interface UploadButtonAndListProps { uploadText: string; accept: string[]; modelMode?: boolean; } interface RsdButtonProps extends DivProps { onClick: MouseEventHandler<HTMLDivElement>; dashed?: boolean; text: string; tip?: string; icon?: string; iconSize?: number; single?: boolean; } interface RsdCheckableButtonProps extends DivPropsSimple { value: boolean; onChange: (value: boolean) => void; label: string; className?: string; theme?: string; children?: ReactNode; } interface RsdCheckboxProps extends DivPropsSimple { value: boolean; onChange: (value: boolean) => void; label: string; className?: string; theme?: string; } interface RsdColorProps extends DivPropsSimple { value: string; onChange: (value: string) => void; label: string; disableAlpha?: boolean; className?: string; theme?: string; } interface RsdFileSelectProps extends DivPropsSimple { label: string; value: string; onChange: (value: string) => void; accept: string[]; tip?: string; className?: string; theme?: ThemeColor; } interface RsdInputProps extends DivPropsSimple { value: string; onChange: (value: string) => void; type?: 'text' | 'number' | 'password'; placeholder?: string; className?: string; theme?: string; rows?: number; maxLength?: number; } interface RsdMentionsProps extends DivPropsSimple { value: string; onChange: (value: string) => void; type?: 'text' | 'number' | 'password'; placeholder?: string; className?: string; theme?: string; rows?: number; } interface RsdNoneProps extends DivProps { label: string; className?: string; theme?: string; } interface RsdNumberListProps extends DivProps { style?: React.CSSProperties; value: number[]; keys: string[]; onChangeIndex: (index: number, value: number | null) => void; min?: number; className?: string; theme?: string; shrink?: boolean; } interface RsdNumberProps extends DivPropsSimple { value: number | null; onChange: (value: number | null) => void; label: string; placeholder?: string; className?: string; theme?: string; unit?: string; min?: number; max?: number; step?: number; } interface RsdSelectProps<ValueType = string> extends DivPropsSimple { value: ValueType; defaultValue?: ValueType; options: { value: ValueType; label: string; }[]; onChange: (value: ValueType) => void; label: string; className?: string; theme?: string; smallWidth?: boolean; } interface RsdSwitchProps extends DivPropsSimple { value: boolean; onChange: (value: boolean) => void; label: string; className?: string; theme?: string; } interface RsdTitleProps extends DivProps { title: string; className?: string; tip?: string; detail?: string; mt?: boolean; } declare class NotFoundError extends Error { constructor(message: string); } declare class DomNotFoundError extends NotFoundError { constructor(message: string); } declare class StaticClassInstantiationError extends Error { constructor(className: string); } type UseBase = <T = unknown>(path?: string) => { state: T; set: (key: string | RvPath, value: unknown) => void; check: (key: string | RvPath) => void; }; type StepOptions = { label: string; value: string; }[]; type UseStepOptions = () => StepOptions; type UseTAttributes = <T = unknown>(path?: string) => { sid: string; nid: string; state: T | null; set: (key: string | RvPath, value: unknown) => void; check: (key: string | RvPath) => void; }; type UseTStep = <T = unknown>(path?: string) => { sid: string; state: T; set: (key: string | RvPath, value: unknown) => void; check: (key: string | RvPath) => void; }; type UseTranslations = (namespace: string) => (key: string) => string; interface V2 { x: number; y: number; } interface V3 { x: number; y: number; z: number; } interface V4 { x: number; y: number; z: number; w: number; } interface RvLoop { rotationSpeed: V3; rotationPivot: V3; slideSpeed: V3; slideDistance: V3; } interface RvLoopAttributeApi { key: string; defaultValue: RvLoop; generate(): RvLoop; ensure(nid: string): boolean; } interface RvNative { enableAnimation: boolean; playTime: number; startFrame: number; endFrame: number; enableLoop: boolean; speedRatio: number; } interface RvNativeAttributeApi { key: string; defaultValue: RvNative; generate(nid: string): RvNative; ensure(nid: string): boolean; } interface RvCode { jumpTargetOnClick: string; } interface RvCodeAttributeApi { key: string; defaultValue: RvCode; generate(): RvCode; ensure(nid: string): boolean; } interface RvLabel { enable: boolean; text: string; alwaysShow: boolean; } interface RvLabelAttributeApi { key: string; defaultValue: RvLabel; generate(): RvLabel; ensure(nid: string): boolean; get(sid: string, nid: string): RvLabel | undefined; } interface RvLocation { position: V3; rotation?: V3; nearMode: boolean; scale: V3; rotationQuaternion?: V4; } interface RvLocationAttributeApi { key: string; defaultValue: RvLocation; generate(node: Node | undefined | null): RvLocation; ensure(nid: string): boolean; } declare enum RvMaterialType { NONE = "NONE", PBR = "PBR", STANDARD = "STANDARD", NODE = "NODE", OTHER = "OTHER", TERRAIN = "TERRAIN", FUR = "FUR", WATER = "WATER", LAVA = "LAVA", SKY = "SKY", BACKGROUND = "BACKGROUND", MULTI = "MULTI", SHADER = "SHADER" } interface RvMaterialGeneral { type: RvMaterialType; isPickable: boolean; visibility: number; receiveShadows: boolean; isExtracted: boolean; } interface RvMaterialNode { fid: string; inputs: RvMaterialNodeInput[]; } interface RvMaterialNodeInput { type: NodeMaterialBlockConnectionPointTypes; key: string; value: string | number; range?: [number, number]; } interface RvMaterialPBR { basic: { albedoColor: string; metallic: number; roughness: number; emissiveColor: string; alpha: number; }; advance: { reflectivityColor: string; ambientColor: string; indexOfRefraction: number; metallicF0Factor: number; reflectionColor: string; }; coat: { enable: boolean; intensity: number; roughness: number; indexOfRefraction: number; useRoughnessFromMainTexture: boolean; clearCoatTexture: string; roughnessTexture: string; bumpTexture: string; enableTint: boolean; tintColor: string; atDistance: number; tintThickness: number; }; } interface RvMaterialTexture { basic: { albedoTexture: string; metallicRoughnessTexture: string; bumpTexture: string; emissiveTexture: string; opacityTexture: string; ambientTexture: string; reflectionTexture: string; metallicReflectanceTexture: string; refractionTexture: string; reflectivityTexture: string; microSurfaceTexture: string; lightMapTexture: string; detailMapTexture: string; reflectanceTexture: string; tintTexture: string; }; extra: { texture1: string; texture2: string; texture3: string; texture4: string; }; } declare enum RvPresetType { NONE = "NONE", METAL = "METAL", PLASTIC = "PLASTIC", GLASS = "GLASS", WOOD = "WOOD", MIRROR = "MIRROR", CRYSTAL = "CRYSTAL", PAINT = "PAINT", CLOTH = "CLOTH" } interface RvMaterial { general: RvMaterialGeneral; preset: RvPresetType; pbr?: RvMaterialPBR; node?: RvMaterialNode; texture: RvMaterialTexture; } interface RvMaterialAttributeApi { key: string; defaultPBRValue: RvMaterialPBR; defaultNodeValue: RvMaterialNode; defaultTextureValue: RvMaterialTexture; defaultValue: RvMaterial; generateTexture(textureMap?: Map<string, BaseTexture>, material?: PBRMaterial | NodeMaterial): RvMaterialTexture; generatePBR(material?: PBRMaterial): RvMaterialPBR; generateNode(material?: NodeMaterial): RvMaterialNode; generate(nid: string): RvMaterial; ensure(nid: string): boolean; } interface CameraConfigurationAnimationApi { play(data: { distanceMin?: number; distanceMax?: number; fov?: number; }, duration?: number, quickMode?: boolean): void; distanceMin(value: number, duration?: number, quickMode?: boolean): void; distanceMax(value: number, duration?: number, quickMode?: boolean): void; fov(value: number, duration?: number, quickMode?: boolean): void; } interface RvCameraLocation { alpha: number; beta: number; radius: number; target: V3; } interface CameraLocationAnimationApi { cameraAnimation: AnimationGroup | null; play(data: RvCameraLocation, duration?: number, enableNear?: boolean): void; playEasy(data: RvCameraLocation, duration?: number): void; makeCameraAnimationsEase(data: RvCameraLocation, duration?: number): Animation[]; } interface RvCamera { enable: boolean; location: RvCameraLocation; config: { easy: boolean; distanceMin: number; distanceMax: number; fov: number; }; } interface RvEnvironment { skybox: { background: string; }; light: { intensity: number; diffuseColor: string; specularColor: string; }; ground: { opacityRate: number; baseColor: string; enableOnViewerMode: boolean; enableOnEditorMode: boolean; }; shadow: { enable: boolean; darkness: number; blurOffset: number; blurScale: number; onlyOnGround: boolean; normalBias: number; }; camera: RvCamera; fog: { enable: boolean; density: number; color: string; }; } interface FogAnimationApi { play(data: RvEnvironment['fog'], duration?: number, quickMode?: boolean): void; enableAndDensity(enable: boolean, value: number, duration?: number, quickMode?: boolean): void; color(color: Color3 | string, duration?: number, quickMode?: boolean): void; } interface GroundAnimationApi { play(data: RvEnvironment['ground'], duration?: number, quickMode?: boolean): void; opacityRate(value: number, duration?: number, quickMode?: boolean): void; baseColor(color: Color3 | string, duration?: number, quickMode?: boolean): void; enableOnViewerMode(value: boolean, duration: number, quickMode: boolean): void; enableOnEditorMode(value: boolean, duration: number, quickMode: boolean): void; } interface LightAnimationApi { play(data: { intensity?: number; diffuseColor?: string; specularColor?: string; }, duration?: number, quickMode?: boolean): void; intensity(value: number, duration?: number, quickMode?: boolean): void; diffuseColor(color: Color3 | string, duration?: number, quickMode?: boolean): void; specularColor(color: Color3 | string, duration?: number, quickMode?: boolean): void; } interface ShadowAnimationApi { play(data: { enable?: boolean; darkness?: number; blurOffset?: number; blurScale?: number; onlyOnGround?: boolean; normalBias?: number; }, duration?: number, quickMode?: boolean): void; enable(value: boolean, duration?: number, quickMode?: boolean): void; darkness(value: number, duration?: number, quickMode?: boolean): void; blurOffset(value: number, duration?: number, quickMode?: boolean): void; blurScale(value: number, duration?: number, quickMode?: boolean): void; onlyOnGround(value: boolean, duration?: number, quickMode?: boolean): void; normalBias(value: number, duration?: number, quickMode?: boolean): void; } interface SkyboxAnimationApi { play(data: { background?: string; }, duration?: number, quickMode?: boolean): void; background(color: Color4 | Color3 | string, duration?: number, quickMode?: boolean): void; } type SupportAnimationTarget = Node | Scene | Material | NodeMaterialBlock | ShadowGenerator; interface EasyPropertyAnimationApi { animationMap: Map<string, { animationGroup?: AnimationGroup$1; timeout?: ReturnType<typeof setTimeout>; }>; play(id: string, type: number, node: SupportAnimationTarget, keys: string[], to: unknown, duration?: number, quickMode?: boolean, from?: unknown, ease?: boolean): void; playSplit(id: string, callback: () => void, duration?: number): void; stop(id: string): void; } interface RsLoopAnimationManagerApi { state: { enableInEditorMode: boolean; }; restartAnimation(nid: string, resetLocation: boolean): void; startAllLoopAnimations(): void; startAnimationLoop(nid: string, node: TransformNode, data: RvLoop, locationData: RvLocation): void; stopAllLoopAnimations(resetLocation: boolean): void; stopAnimation(nid: string): void; makeTripAnimation(dis: number, speed: number, start: number, name: string, axis: string, fr: number): void; makeSpinAnimation(value: number, start: number, name: string, axis: string, fr: number): void; makeQuaternionAnimation(value: number, start: Vector3, name: string, axis: 'x' | 'y' | 'z', fr: number): void; } interface RvAudio { autoPlay: boolean; fid: string; loop: boolean; speed: number; volume: number; } interface RvConfiguration { description: { collapseDefault: boolean; enable: boolean; text: string; }; interval: { enable: boolean; enter: number; exit: number; }; jump: { delay: number; onlyOnce: boolean; target: string; }; ui: { theme: ThemeBackground; enableStepChangeButton: boolean; enableTopbar: boolean; hideStep: boolean; importantStep: boolean; }; audio: RvAudio; secondAudio: RvAudio; } interface RvStep { name: string; sid: string; attributes: RhineVarMap; configuration: RvConfiguration; environment: RvEnvironment; } interface RsAudioServiceApi { processStepAudioMap(step: StoredRhineVar<RvStep>): void; fadeOutAndPauseAllAudio(): void; processAudioMap(audioMap: RvAudio | undefined, idKey: string): void; } declare enum RvBasicType { TEXT = "TEXT", CUBE = "CUBE", SPHERE = "SPHERE", CONE = "CONE", PRISM = "PRISM", POLYHEDRON = "POLYHEDRON", TORUS = "TORUS", CYLINDER = "CYLINDER", ICO_SPHERE = "ICO_SPHERE", CAPSULE = "CAPSULE", PLANE = "PLANE" } interface RvBasicConfig { type: RvBasicType; args?: Record<string, number>; text?: string; } declare enum RvModelOrigin { BASIC = "BASIC", PROVIDE = "PROVIDE", UPLOAD = "UPLOAD" } interface RvModel { mid: string; name: string; origin: RvModelOrigin; fid?: string; config?: RvBasicConfig | Record<string, unknown>; node?: string; } interface RsSelectionNodeInfo { nid: string; nodeName: string; babylonNode: Node; uniqueId: number; mid: string; modelLoadName: string; rvModel: RvModel; isTransformNode: boolean; isAbstractMesh: boolean; isMesh: boolean; isCoordinateFlip: boolean; isCoordinateRotation: boolean; hasGeometry: boolean; isRoot: boolean; childrenNumber: number; supportQuaternion: boolean; animationNumber: number; skeletonNumber: number; hasMaterial: boolean; isSupportMaterial: boolean; supportEditMaterial: boolean; } interface RsSelectionApi { set(nid: string): void; add(nid: string): void; remove(nid: string): void; clear(): void; has(nid: string): boolean; get(nid: string): RsSelectionNodeInfo | null; } interface HighLightInfo { uid: number; color: string; } interface RsSelectionState { highlight: HighLightInfo[]; selected: RsSelectionNodeInfo[]; last: RsSelectionNodeInfo | null; branchMode: boolean; materialInfo: RsSelectionMaterialInfo; } interface RsSelectionMaterialInfo { allNumber: number; supportEditMaterialNumber: number; hasGeometryNumber: number; hasOtherMaterialNumber: number; hasChildrenNumber: number; isAbstractMeshNumber: number; } type LastSubscriber = (value: RsSelectionNodeInfo | null) => void; type SelectedSubscriber = (value: RsSelectionNodeInfo[]) => void; interface RsSelectionServiceApi { state: RsSelectionState; changeBranchMode(value?: boolean, message?: boolean): void; click: (nid?: string, ctrl?: boolean) => void; set: (nid: string) => void; add: (nid: string) => void; remove: (nid: string) => void; clear: () => void; subscribe(subscriber: SelectedSubscriber): () => void; unsubscribe(subscriber: SelectedSubscriber): void; subscribeLast(subscriber: LastSubscriber): () => void; unsubscribeLast(subscriber: LastSubscriber): void; } interface RsClickApi { simplifyDoneList(delay: number): void; show(position: V3, color: string, timestamp: number, duration?: number, id?: string): void; } interface RsEnvironmentApi { mainCamera: ArcRotateCamera; rightCamera: ArcRotateCamera; backCamera: ArcRotateCamera; leftCamera: ArcRotateCamera; lights: Light[]; shadow: ShadowGenerator; environmentTexture: CubeTexture; STANDARD_MODE: boolean; adjustCamera(models: AbstractMesh[] | AbstractMesh): void; getCameraInfo(): { target: { x: number; y: number; z: number; }; alpha: number; beta: number; radius: number; }; addShadows(meshes: AbstractMesh[] | AbstractMesh): void; initLight(): void; initFourCamera(camerasNode: TransformNode): void; setActiveCamera(isFour: boolean): void; normalizeCameraAngle(): void; setCameraDistance(distance: number): void; setBackgroundColor(color: Color3): void; getPositionToCameraDistance(p: V3 | Vector3): number; } interface RsEnvironmentServiceApi { updateEnvironment(path: RvPath, step: StoredRhineVar<RvStep>): void; getCurrentCameraLocation(): RvCameraLocation; } interface RsTransformGroundApi { m1: PBRMaterial; m10: PBRMaterial; g1: Mesh | undefined; g10: Mesh | undefined; state: { opacityRate: number; enableOnViewerMode: boolean; enableOnEditorMode: boolean; }; initMaterial(): void; createGround(): void; hideGround(): void; showGround(): void; freshGround(): void; } declare enum LabelTheme { Default = "Default" } declare class LabelInfo { nid: string; node: TransformNode$1 | null; text: string; theme: LabelTheme; x: number; y: number; parentElement: HTMLDivElement | null; pointElement: HTMLDivElement | null; lineElement: HTMLDivElement | null; blockElement: HTMLDivElement | null; textElement: HTMLDivElement | null; validate: boolean; always: boolean; show: boolean; lastClickTime: number; lastSp: Vector3 | null; constructor(nid: string, node?: TransformNode$1 | null, text?: string, theme?: LabelTheme, x?: number, y?: number); } interface RsLabelServiceApi { labels: LabelInfo[]; updateClick(nid: string | null | undefined): void; getLabel(nid: string): LabelInfo | null; ensureLabel(nid: string, node: TransformNode$1 | null): LabelInfo; removeLabel(nid: string): void; updateLabelWithNid(nid: string, rvLabel: RvLabel): void; } interface NodeMaterialInfo { nid: string; fid: string; material: NodeMaterial; } interface RsNodeMaterialManagerApi { materials: NodeMaterialInfo[]; has(nid: string): boolean; add(nid: string, fid: string, material: NodeMaterial): void; get(nid: string): NodeMaterialInfo | null; set(nid: string, fid: string, material: NodeMaterial): void; remove(nid: string): void; waitFid(nid: string, fid: string): Promise<void>; updateNodeMaterialTemplate(nid: string, fid: string, syncStateWhenCreate: boolean): Promise<boolean>; uploadNodeMaterialTemplate(nid: string, fid: string, material: NodeMaterial): void; nodeMaterialToFile(material: NodeMaterial): File; } interface RsMaterialServiceApi { updateMaterial(nid: string, mesh: AbstractMesh, path: string[] | RvPath, value: unknown, rvMaterial: RvMaterial): void; updateGeneralMaterialSingle(mesh: AbstractMesh, path: RvPath, value: unknown): void; updatePBRMaterialSingle(mesh: AbstractMesh, material: PBRMaterial, path: RvPath, value: unknown): void; updateNodeMaterialSingle(material: NodeMaterial, path: RvPath, value: unknown, inputs: RvMaterialNodeInput[]): void; } interface RsSeparateServiceApi { get(nid: string, node?: Node): Promise<Material | null>; getWithEnsureType(nid: string, rvMaterial: RvMaterial, node?: Node): Promise<Material | null>; } interface TextureInfo { fid: string; localUrl: string; texture: Texture; } interface RsTextureServiceApi { get(fid: string): TextureInfo | null; getWhiteTexture(): DynamicTexture; getBlackTexture(): DynamicTexture; add(fid: string): Promise<TextureInfo | null>; getTexture(fid: string, without: number): Promise<Texture | null>; pushTexture(fid: string, texture: Texture, url: string): TextureInfo; remove(fid: string): void; } declare enum RsModelStatus { WAITING = "WAITING", LOADING = "LOADING", LOADED = "LOADED", ERROR = "ERROR", CANCELED = "CANCELED" } interface RsModel { mid: string; progress: number; status: RsModelStatus; node?: Node; } declare enum FirstLoadModelServiceStatus { WAITING = "WAITING", LOADING = "LOADING", LOADED = "LOADED", ERROR = "ERROR", CANCELED = "CANCELED" } type FirstLoadModelServiceSubscriber = (type: FirstLoadModelServiceEventType) => void; declare enum FirstLoadModelServiceEventType { START = "START", PROGRESS = "PROGRESS", LOADED = "LOADED", ERROR = "ERROR", CANCELED = "CANCELED" } interface FirstLoadModelServiceApi { status: FirstLoadModelServiceStatus; rsModelList: RsModel[]; loadingNumber: number; loadedNumber: number; errorNumber: number; canceledNumber: number; totalSize: number; loadedSize: number; startTime: number; start(): void; subscribe(subscriber: FirstLoadModelServiceSubscriber): () => void; unsubscribe(subscriber: FirstLoadModelServiceSubscriber): void; } type RsModelServiceSubscriber = (type: RsModelServiceEventType, rsModel: RsModel) => void; declare enum RsModelServiceEventType { ADD = "ADD", REMOVE = "REMOVE", START = "START", PROGRESS = "PROGRESS", PAUSE = "PAUSE", RESUME = "RESUME", LOADED = "LOADED", ERROR = "ERROR", CANCELED = "CANCELED" } interface RsModelServiceApi { models: Map<string, RsModel>; get(mid: string): RsModel | undefined; has(mid: string): boolean; remove(mid: string): boolean; add(rsModel: RsModel): boolean; load(mid: string): Promise<void>; pause(mid: string): boolean; resume(mid: string): boolean; cancel(mid: string): boolean; subscribe(subscriber: RsModelServiceSubscriber): () => void; unsubscribe(subscriber: RsModelServiceSubscriber): void; subscribeSingle(mid: string, subscriber: RsModelServiceSubscriber): () => void; unsubscribeSingle(mid: string, subscriber: RsModelServiceSubscriber): void; publish(mid: string, type: RsModelServiceEventType, rsModel: RsModel): void; afterLoaded(mid: string, subscriber: (rsModel: RsModel) => void): void; waitLoaded(mid: string): Promise<RsModel>; /** * 是否已经载入完成 * * @param mid 模型 mid * * @returns 返回模型是否载入完成 模型不存在则返回 undefined */ isLoaded(mid: string): boolean | undefined; } interface RsServiceApi { canvas: HTMLCanvasElement | undefined; scene: Scene | undefined; engine: Engine | WebGPUEngine | undefined; experience: WebXRDefaultExperience | null; state: { rendering: boolean; }; isSupportWebXR(): boolean; isWebXRInitialized(): boolean; enterVR(onInitialize: () => void): Promise<void>; } interface ContextMenuServiceApi { /** * 当前所有右键菜单 */ contextMenus: ContextMenu[]; /** * 创建右键菜单 * * @param options 创建右键菜单的选项对象 具体选项见 ContextMenuCreateOptions * * @returns 返回所创建的右键菜单的控制器 */ create(options: ContextMenuCreateOptions): ContextMenuController; /** * 获取右键菜单 * * @param id 右键菜单的 id * * @returns 返回对应 id 的右键菜单 如果没有则返回 undefined */ get(id: string): ContextMenu | undefined; /** * 关闭右键菜单 * * @param contextMenu 右键菜单控制器 */ close(contextMenu: string | ContextMenu): Promise<boolean>; /** * 关闭所有右键菜单 */ closeAll(): Promise<number>; } interface DialogServiceApi { /** * 创建对话框 最全面的对话框创建方法 * * @param options 创建对话框的选项对象 具体选项见 DialogCreateOptions * @param show 是否直接展示弹窗 * * @returns 返回所创建的对话框的控制器 */ create(options: DialogCreateOptions, show?: boolean): Promise<Dialog>; /** * 弹出提示信息或询问是或否的对话框 * * @param options 创建对话框的选项对象 具体选项如下 * @param show 是否直接展示弹窗 * * @returns 关闭后返回用户是否点击了确认按钮 */ confirm(options: { title: string; titleIcon: FunctionComponent; content?: string; contentView?: FunctionComponent; icon?: FunctionComponent; confirmText?: string; cancelText?: string; theme?: ThemeColor; background?: ThemeBackground; leftMode?: boolean; className?: string; style?: object; onConfirm?: () => void; onCancel?: () => void; onClose?: () => void; closeOnOutsideClick?: boolean; }, show?: boolean): Promise<boolean>; /** * 弹出获取用户文本输入的对话框 * * @param options 创建对话框的选项对象 具体选项如下 * @param show 是否直接展示弹窗 * * @returns 关闭后返回用户输入的文本 如果用户不是点击确认按钮关闭的对话框 则返回 undefined */ input(options: { title: string; titleIcon: FunctionComponent; content?: string; contentView?: FunctionComponent; icon?: FunctionComponent; theme?: ThemeColor; leftMode?: boolean; className?: string; style?: object; confirmText?: string; cancelText?: string; defaultValue?: string; inputPlaceholder?: string; autoFocus?: boolean; allowEmpty?: boolean; onChange?: (value: string) => void; onCheck?: (value: string) => boolean; onConfirm?: (value: string) => void; onCancel?: () => void; onClose?: () => void; closeOnOutsideClick?: boolean; }, show?: boolean): Promise<string | undefined>; /** * 获取对话框 * * @param id 对话框的 id * * @returns 返回对应 id 的对话框 如果没有则返回 undefined */ get(id: string): Dialog | undefined; /** * 打开对话框 * * @param dialog 对话框实例或对话框ID */ show(dialog: string | Dialog): Promise<boolean>; /** * 关闭对话框 * * @param dialog 对话框实例或对话框ID */ close(dialog: string | Dialog): Promise<boolean>; /** * 关闭所有对话框 */ closeAll(): Promise<number>; } declare enum FirstLoadServiceStatus { WAITING = "WAITING", LOADING = "LOADING", LOADED = "LOADED", ERROR = "ERROR", CANCELED = "CANCELED" } type FirstLoadServiceSubscriber = (type: FirstLoadServiceEventType) => void; declare enum FirstLoadServiceEventType { START = "START", PROGRESS = "PROGRESS", LOADED = "LOADED", ERROR = "ERROR", CANCELED = "CANCELED" } declare enum LocalDataStatus { WAITING = "WAITING", LOADING = "LOADING", PAUSED = "PAUSED", LOADED = "LOADED", FAILED = "FAILED", CANCELED = "CANCELED" } declare enum LocalDataType { BLOB = "BLOB", OBJECT = "OBJECT" } interface LocalData { fid: string; type: LocalDataType; mime: string; status: LocalDataStatus; progress: number; url?: string; blob?: Blob; text?: string; json?: unknown; texture?: BaseTexture; material?: Material; uv?: unknown; object?: unknown; } interface FirstLoadServiceApi { status: FirstLoadServiceStatus; localDataList: LocalData[]; loadingNumber: number; loadedNumber: number; errorNumber: number; canceledNumber: number; totalSize: number; loadedSize: number; startTime: number; start(): void; subscribe(subscriber: FirstLoadServiceSubscriber): () => void; unsubscribe(subscriber: FirstLoadServiceSubscriber): void; } declare enum OssUploadInstanceStatus { WAITING = "WAITING", UPLOADING = "UPLOADING", PAUSED = "PAUSED", COMPLETED = "COMPLETED", FAILED = "FAILED", CANCELED = "CANCELED" } interface OssUploadInstance { fid: string; file: File; status: OssUploadInstanceStatus; progress: number; data?: unknown; } type OssUploadServiceSubscriber = (type: OssUploadServiceEventType, ossUploadInstance: OssUploadInstance) => void; declare enum OssUploadServiceEventType { START = "START", PROGRESS = "PROGRESS", PAUSE = "PAUSE", RESUME = "RESUME", UPLOADED = "UPLOADED", FAILED = "FAILED", CANCELED = "CANCELED" } interface OssUploadServiceApi { instances: Map<string, OssUploadInstance>; upload(file: File, fid?: string, mime?: string, hash?: string): Promise<void>; pause(fid: string): boolean; resume(fid: string): boolean; cancel(fid: string): boolean; get(fid: string): OssUploadInstance | undefined; has(fid: string): boolean; hasFile(file: File): boolean; subscribe(subscriber: OssUploadServiceSubscriber): () => void; unsubscribe(subscriber: OssUploadServiceSubscriber): void; subscribeSingle(fid: string, subscriber: OssUploadServiceSubscriber): () => void; unsubscribeSingle(fid: string, subscriber: OssUploadServiceSubscriber): void; } type MessageType = 'info' | 'warning' | 'error' | 'success'; declare class Message { text: string; type: MessageType; duration: number; id: number; show: boolean; height: number; opacity: number; constructor(text: string, type: MessageType, duration: number, id: number); } interface MessageServiceApi { messages: Message[]; info: (text: string, translateNamespace?: string, duration?: number) => void; success: (text: string, translateNamespace?: string, duration?: number) => void; warning: (text: string, translateNamespace?: string, duration?: number) => void; error: (text: string, translateNamespace?: string, duration?: number) => void; showWithTranslate: (text: string, type: MessageType, translateNamespace: string, duration: number) => void; show: (text: string, type: MessageType, duration?: number) => void; } type NativeMouseEventSubscriber = (e: MouseEvent) => void; type NativeDragEventSubscriber = (e: DragEvent) => void; type NativeWheelEventSubscriber = (e: WheelEvent) => void; type NativePointerEventSubscriber = (e: PointerEvent) => void; type NativeKeyboardEventSubscriber = (e: KeyboardEvent) => void; type NativeFocusEventSubscriber = (e: FocusEvent) => void; type NativeUIEventSubscriber = (e: UIEvent) => void; type NativeAnyEventSubscriber = (e: Event | null) => void; interface NativeEventServiceApi { subscribeClick(subscriber: NativeMouseEventSubscriber): () => void; unsubscribeClick(subscriber: NativeMouseEventSubscriber): void; subscribeContextMenu(subscriber: NativeMouseEventSubscriber): () => void; unsubscribeContextMenu(subscriber: NativeMouseEventSubscriber): void; subscribeDoubleClick(subscriber: NativeMouseEventSubscriber): () => void; unsubscribeDoubleClick(subscriber: NativeMouseEventSubscriber): void; subscribeDrag(subscriber: NativeDragEventSubscriber): () => void; unsubscribeDrag(subscriber: NativeDragEventSubscriber): void; subscribeDrop(subscriber: NativeDragEventSubscriber): () => void; unsubscribeDrop(subscriber: NativeDragEventSubscriber): void; subscribeWheel(subscriber: NativeWheelEventSubscriber): () => void; unsubscribeWheel(subscriber: NativeWheelEventSubscriber): void; subscribePointerDown(subscriber: NativePointerEventSubscriber): () => void; unsubscribePointerDown(subscriber: NativePointerEventSubscriber): void; subscribePointerMove(subscriber: NativePointerEventSubscriber): () => void; unsubscribePointerMove(subscriber: NativePointerEventSubscriber): void; subscribePointerUp(subscriber: NativePointerEventSubscriber): () => void; unsubscribePointerUp(subscriber: NativePointerEventSubscriber): void; subscribePointerCancel(subscriber: NativePointerEventSubscriber): () => void; unsubscribePointerCancel(subscriber: NativePointerEventSubscriber): void; subscribePointerEnter(subscriber: NativePointerEventSubscriber): () => void; unsubscribePointerEnter(subscriber: NativePointerEventSubscriber): void; subscribePointerLeave(subscriber: NativePointerEventSubscriber): () => void; unsubscribePointerLeave(subscriber: NativePointerEventSubscriber): void; subscribeKeyDown(subscriber: NativeKeyboardEventSubscriber): () => void; unsubscribeKeyDown(subscriber: NativeKeyboardEventSubscriber): void; subscribeKeyUp(subscriber: NativeKeyboardEventSubscriber): () => void; unsubscribeKeyUp(subscriber: NativeKeyboardEventSubscriber): void; subscribeKeyDownExceptInput(subscriber: NativeKeyboardEventSubscriber): () => void; unsubscribeKeyDownExceptInput(subscriber: NativeKeyboardEventSubscriber): void; subscribeKeyUpExceptInput(subscriber: NativeKeyboardEventSubscriber): () => void; unsubscribeKeyUpExceptInput(subscriber: NativeKeyboardEventSubscriber): void; subscribeFocus(subscriber: NativeFocusEventSubscriber): () => void; unsubscribeFocus(subscriber: NativeFocusEventSubscriber): void; subscribeBlur(subscriber: NativeFocusEventSubscriber): () => void; unsubscribeBlur(subscriber: NativeFocusEventSubscriber): void; subscribeScroll(subscriber: NativeUIEventSubscriber): () => void; unsubscribeScroll(subscriber: NativeUIEventSubscriber): void; subscribeResize(subscriber: NativeAnyEventSubscriber): () => void; unsubscribeResize(subscriber: NativeAnyEventSubscriber): void; } declare enum Locale { ZH = "ZH", EN = "EN" } declare enum PluginType { BUTTON = "BUTTON", SWITCH = "SWITCH", DRAWER = "DRAWER", DIALOG = "DIALOG", CONTENT = "CONTENT", WINDOW = "WINDOW", SERVICE = "SERVICE" } interface BasePlugin { id: string; name: string; version: string; description: string; type: PluginType; theme: ThemeColor; loadApi?: () => void; data?: Record<string, unknown>; messages?: Record<Locale, Record<string, any>> | string; onInstall?: () => Promise<void>; onEnable?: () => Promise<void>; onDisable?: () => Promise<void>; onUninstall?: () => Promise<void>; } declare enum IconPluginPosition { TOP = 0, RIGHT = 1, BOTTOM = 2, LEFT = 3, TOP_LEFT = 4, BOTTOM_LEFT = 5, TOP_RIGHT = 6, BOTTOM_RIGHT = 7, UNKNOWN = 8 } interface IconViewProps extends DivProps { plugin: IconPlugin; } type MixView<T extends Attributes | null = null> = string | FunctionComponent<T>; interface IconPlugin extends BasePlugin { position: IconPluginPosition; group: string; label: string; color: ThemeColor; open: boolean; icon: MixView<IconViewProps>; onEnabledChange?: (value: boolean, e: MouseEvent) => void; onIconClick?: (e: MouseEvent) => void; onIconClickRouter?: (e: MouseEvent) => string; onIconContextMenu?: (e: MouseEvent) => void; } interface PluginInformation { plugin: BasePlugin; root?: Root; iconButton?: HTMLSpanElement; } interface PluginContainerServiceApi { plugins: Map<string, PluginInformation>; addPlugin(plugin: BasePlugin): void; removePlugin(plugin: BasePlugin): void; openPlugin(plugin: IconPlugin): Promise<boolean>; closePlugin(plugin: IconPlugin): Promise<boolean>; closeDrawerPluginByPosition(position: IconPluginPosition): Promise<boolean>; } interface FileData { fid: string; status: LocalDataStatus; name: string; progress: number; mime: string; filename?: string; extension?: string; description?: string; size?: string; preview?: string; } interface ResourceServiceApi { PREVIEW_IMAGE_WIDTH: number; PREVIEW_IMAGE_HEIGHT: number; dragState: { fid: string; data: FileData | null; x: number; y: number; offsetX: number; offsetY: number; }; upload(file: File, fid?: string): void; uploadMulti(fileList: FileList | File[] | File | null | undefined, check?: boolean, fidList?: string[]): void; generateDescribeAndPreview(file: File): Promise<[string, File | null]>; generatePreviewFile(img: HTMLImageElement | HTMLVideoElement, name: string): Promise<File>; generateId(): string; } declare enum ThemeShape { GENERAL = "GENERAL", RHINE = "RHINE" } interface ThemeState { background: ThemeBackground; color: ThemeColor; shape: ThemeShape; } interface ThemeServiceApi { state: ThemeState; isDarkTheme(): boolean; updateBackground(): void; updateBackgroundByColor(color: string): void; } interface RvAwarenessUser { name: string; color: string; avatar: string; uuid: string; } interface RvAwarenessDevice { platform: string; } interface RvAwarenessClick { position: V3; timestamp: number; } interface RvAwarenessWindow { innerWidth: number; innerHeight: number; } interface RvAwareness { clientId: number; user: RvAwarenessUser; device: RvAwarenessDevice; sid: string; meetingId: string; selected: string[]; camera: RvCameraLocation; clicks: RvAwarenessClick[]; window: RvAwarenessWindow; cursor: V3; openedDrawers: string[]; } interface AwarenessChanges { added: number[]; updated: number[]; removed: number[]; } type AwarenessChangeSubscriber = (changeStates: Map<number, RvAwareness>, changes: AwarenessChanges) => vo