UNPKG

wdpapi

Version:

51WORLD WdpApi is a set of programming interfaces developed by JavaScript that is responsible for negotiating between web pages and cloud rendering platforms. Supported by 51Cloud rendering platform, it enables the users to create any HTML5 UI element on

599 lines (598 loc) 14.1 kB
/** * @interface ResultType * @param {boolean} success * @param {string} message (optional) * @param {number} errCode (optional) * @param {string} guid (optional) * @param {number} type (optional) * @param {string} event_name (optional) * @param {any} result (optional) */ export interface ResultType { success: boolean; message?: string; errCode?: number; guid?: string; type?: number; event_name?: string; result?: any; } /** * @interface IApiData * @param {Array<string>} addedEids * @param {Array<string>} removedEids * @param {Record<string, any>} updateInfo */ export interface IApiData { addedEids: Array<string>; removedEids: Array<string>; updateInfo: Record<string, any>; } /** * @type {MinMaxType} * @alias Array<number> */ export type MinMaxType = Array<number>; /** * @type {Coord2DType} * @alias Array<number> */ export type Coord2DType = Array<number>; /** * @type {CoordType} * @alias Array<number> */ export type CoordType = Array<number>; /** * @interface CoordObjType * @param {number} x (optional) * @param {number} y (optional) * @param {number} z (optional) */ export interface CoordObjType { x?: number; y?: number; z?: number; } /** * @interface RotatorType * @param {number} pitch (optional) * @param {number} yaw (optional) * @param {number} roll (optional) */ export interface RotatorType { pitch?: number; yaw?: number; roll?: number; } /** * @interface Rotator2DType * @param {number} pitch (optional) * @param {number} yaw (optional) */ export interface Rotator2DType { pitch?: number; yaw?: number; } /** * @type {ScaleType} * @alias Array<number> */ export type ScaleType = Array<number>; /** * @interface EntityEidType * @param {string | null} eid (optional) */ export interface EntityEidType { eid?: string | null; } /** * @interface EntityGeometryType * @param {any} geometry (optional) */ export interface EntityGeometryType { geometry?: any; } /** * @interface PointType * @extends EntityEidType,Partial<BasicInfoAtomType> * @param {CoordType} point (optional) */ export interface PointType extends EntityEidType, Partial<BasicInfoAtomType> { point?: CoordType; } /** * @interface Point2DType * @extends EntityEidType,Partial<BasicInfoAtomType> * @param {Coord2DType} point (optional) */ export interface Point2DType extends EntityEidType, Partial<BasicInfoAtomType> { point?: Coord2DType; } /** * @interface PolylineType * @extends EntityEidType,Partial<BasicInfoAtomType> * @param {{points: Array<CoordType>}} polyline (optional) */ export interface PolylineType extends EntityEidType, Partial<BasicInfoAtomType> { polyline?: Array<CoordType>; } /** * @interface Polyline2DType * @extends EntityEidType,Partial<BasicInfoAtomType> * @param {{points: Array<Coord2DType>}} polyline (optional) */ export interface Polyline2DType extends EntityEidType, Partial<BasicInfoAtomType> { polyline?: Array<Coord2DType>; } /** * @interface LoopType * @param {Array<CoordType>} points */ export interface LoopType { points: Array<CoordType>; } export type PolygonLoopType = Array<Array<CoordType>>; /** * @interface PolygonType * @extends EntityEidType,Partial<BasicInfoAtomType> * @param {PolygonLoopType} polygon (optional) */ export interface PolygonType extends EntityEidType, Partial<BasicInfoAtomType> { polygon?: PolygonLoopType; } /** * @interface ICurves * @param {string} type (optional) * @param {Coord2DType} o (optional) * @param {number} r (optional) * @param {number} s (optional) * @param {number} e (optional) */ interface ICurves { type?: string; o?: Coord2DType; r?: number; s?: number; e?: number; } /** * @interface Loop2DType * @param {Array<Coord2DType>} points (optional) * @param {Array<ICurves>} curves (optional) */ export interface Loop2DType { points?: Array<Coord2DType>; curves?: Array<ICurves>; } export type Polygon2DLoopType = Array<Array<Coord2DType>>; /** * @interface Polygon2DType * @extends EntityEidType,Partial<BasicInfoAtomType> * @param {Polygon2DLoopType} polygon (optional) */ export interface Polygon2DType extends EntityEidType, Partial<BasicInfoAtomType> { polygon?: Polygon2DLoopType; } /** * @interface HeatMapDataType * @extends EntityGeometryType * @param {string | null} pointEntityEid (optional) * @param {number} value (optional) */ export interface HeatMapDataType extends EntityGeometryType { pointEntityEid?: string | null; value?: number; } /** * @interface BasicInfoAtomType * @param {string} entityName * @param {string} customId * @param {any} customData * @param {string} parentEid */ export interface BasicInfoAtomType { entityName: string; customId: string; customData: any; parentEid: string; } /** * @interface TransformAtomType * @param {CoordType} location * @param {RotatorType} rotator * @param {ScaleType} scale3d * @param {Array<number>} pivotOffset */ export interface TransformAtomType { location: CoordType; rotator: RotatorType; scale3d: ScaleType; pivotOffset: Array<number>; } /** * @interface TransformAtom2DType * @param {CoordType} location */ export interface TransformAtom2DType { location: CoordType; } /** * @interface VisibleAtomType * @param {boolean} bVisible */ export interface VisibleAtomType { bVisible: boolean; } /** * @interface EntityFlagAtomType * @param {boolean} bLocked */ export interface EntityFlagAtomType { bLocked: boolean; } /** * @interface PointEntityAtomType * @param {CoordType} point */ export interface PointEntityAtomType { point: CoordType; } /** * @interface Point2DEntityAtomType * @param {CoordType} point */ export interface Point2DEntityAtomType { point: Coord2DType; } /** * @interface Polygon2DEntityAtomType * @param {Polygon2DLoopType} polygon */ export interface Polygon2DEntityAtomType { polygon: Polygon2DLoopType; } /** * @interface PolygonEntityAtomType * @param {PolygonLoopType} polygon */ export interface PolygonEntityAtomType { polygon: PolygonLoopType; } /** * @interface PolylineEntityAtomType * @param {Array<CoordType>} polyline */ export interface PolylineEntityAtomType { polyline: Array<CoordType>; } /** * @interface Polyline2DEntityAtomType * @param {Array<Coord2DType>} polyline */ export interface Polyline2DEntityAtomType { polyline: Array<Coord2DType>; } /** * @interface AssetsAtomType * @param {Array<string>} seedIds */ export interface AssetsAtomType { seedIds: Array<string>; } /** * @interface AssetAtomType * @param {string | null} seedId */ export interface AssetAtomType { seedId: string | null; } /** * @interface AssetsAtomType * @param {Array<string>} seedIds */ export interface AssetsAtomType { seedIds: Array<string>; } export interface IinstanceComponentInfos { componentName: string; parentName: string; assetId: string; meshName: string; componentLocation: CoordType; componentRotator: RotatorType; componentScale: IScale3D; nodeIds: Array<string | number>; positions: Array<CoordType>; idToRotator: { [key: string]: RotatorType; }; idToScale: { [key: string]: IScale3D; }; hiddenIds: Array<string | number>; } export interface IsmEntityAtomType { instanceComponentInfos: Array<Partial<IinstanceComponentInfos>>; } /** * @interface ICamera * @param {number} hideDistance * @param {string} hideType * @param {string} scaleMode */ interface ICamera { hideDistance: number; hideType: string; scaleMode: string; url?: string; size?: Array<number>; } /** * @interface IInteraction * @param {boolean} clickTop * @param {boolean} hoverTop */ interface IInteraction { clickTop: boolean; hoverTop: boolean; } /** * @interface IEntity * @param {number} overlapOrder */ interface IEntity { overlapOrder: number; } /** * @interface Visible2DAtomType * @param {ICamera} camera * @param {IInteraction} interaction * @param {IEntity} entity */ export interface Visible2DAtomType { camera: ICamera; interaction: IInteraction; entity: IEntity; } /** * @interface IBaseData * @param {BasicInfoAtomType} BasicInfoAtom (optional) * @param {TransformAtomType} TransformAtom (optional) * @param {VisibleAtomType} VisibleAtom (optional) * @param {Visible2DAtomType} Visible2DAtom (optional) */ export interface IBaseData { BasicInfoAtom?: BasicInfoAtomType; TransformAtom?: TransformAtomType; VisibleAtom?: VisibleAtomType; Visible2DAtom?: Visible2DAtomType; } /** * @type {CoordZRefType} * @alias 'surface'|'ground'|'altitude' */ export type CoordZRefType = 'surface' | 'ground' | 'altitude'; /** * @interface ICalculateCoordZ * @param {CoordZRefType} coordZRef * @param {number} coordZOffset */ export interface ICalculateCoordZ { coordZRef: CoordZRefType; coordZOffset: number; } /** * @interface IOperations * @param {ICalculateCoordZ} calculateCoordZ */ export interface IOperations { calculateCoordZ: ICalculateCoordZ; } /** * @type {ICoordinates} * @alias Array<Array<number>> */ export type ICoordinates = Array<Array<number>>; /** * @type {ICoordinates2D} * @alias Array<Array<Array<number>>> */ export type ICoordinates2D = Array<Array<Array<number>>>; /** * @interface IPoint * @param {Array<number>} point * @param {number} value */ export interface IPoint { point: Array<number>; value: number; } /** * @interface IPolylineATom * @param {ICoordinates} coordinates * @param {boolean} bClosed */ export interface IPolylineATom { coordinates: ICoordinates; bClosed: boolean; } /** * @interface IPolygon2DAtom * @param {ICoordinates2D} coordinates * @param {number} coordZ */ export interface IPolygon2DAtom { coordinates: ICoordinates2D; coordZ: number; } /** * @interface IPointValueAtom * @param {Array<IPoint>} features */ export interface IPointValueAtom { features: Array<IPoint>; } /** * @interface IOBjectCache * @param {Record<string, any>} object */ export interface IOBjectCache { object: Record<string, any>; } /** * @interface EntityOutlinerAtomType * @param {string} index */ export interface EntityOutlinerAtomType { index: string; } /** * @type {deepPartial<T>} */ export type deepPartial<T> = { [K in keyof T]?: T[K] extends object ? deepPartial<T[K]> : T[K]; }; /** * @interface eventType * @param {string} name * @param {Function} func ((e: any, opt?: {objSync?: Array<eventType>, objPri?: Array<eventType>, obj?: eventType, objs?: Array<eventType>}) => Promise<void> | void) */ export interface eventType { name: string; func: (e: any, opt?: { objSync?: Array<eventType>; objPri?: Array<eventType>; obj?: eventType; objs?: Array<eventType>; }) => Promise<void> | void; sync?: boolean; } /** * @interface IOffset * @param {number} left * @param {number} forward * @param {number} up */ export interface IOffset { left?: number; forward?: number; up?: number; } /** * @interface IRotation * @param {number} x (optional) * @param {number} y (optional) * @param {number} z (optional) * @param {number} w (optional) */ export interface IRotation { x: number; y: number; z: number; w: number; } /** * @type {ITranslation} */ export type ITranslation = Array<number>; /** * @type {IScale3D} */ export type IScale3D = Array<number>; export interface IExecuteArrayDuplicate { entities: Array<Record<string, any>>; num?: number; translation?: Array<number>; rotator?: Array<number>; scale?: Array<number>; coordType?: string; bInstance?: boolean; instanceName?: string; } export interface IPickerMaterial { eid: string; meshName: string; materialIndex: number; } export interface IRegisterEvents { objSync?: Array<eventType>; objPri?: Array<eventType>; obj?: eventType; objs?: Array<eventType>; } export interface IColorRGBA { r: number; g: number; b: number; a?: number; } export interface IindexAndNameArray { index: number; name: string; } export interface IindexAndSwitchArray { index: number; bEnable: boolean; } export interface IColorObj { r: number; g: number; b: number; a?: number; } export type TAlpha = 'decimal' | 'integer'; export interface IstartApi { apiClassName: string; apiFuncName: string; } export type Tjustification = 'Left' | 'Center' | 'Right'; export interface IGeometryData { point?: Array<Record<string, any>>; point2D?: Array<Record<string, any>>; polyline?: Array<Record<string, any>>; polyline2D?: Array<Record<string, any>>; polygon?: Array<Record<string, any>>; polygon2D?: Array<Record<string, any>>; } export interface IGeometryObject { point?: Record<string, any>; point2D?: Record<string, any>; polyline?: Record<string, any>; polyline2D?: Record<string, any>; polygon?: Record<string, any>; polygon2D?: Record<string, any>; } export type TbgOverlap = 'backward' | 'forward' | 'hide'; export interface IinstanceTransform { rotator: RotatorType; location: CoordType; scale3d: CoordType; } export interface IcomponentNameToTransform { [key: string]: IinstanceTransform; } export interface ISetComponentsTransformParams { eid: string; componentNameToTransform: IcomponentNameToTransform; } export interface InodesTransformInfo extends IinstanceTransform { nodeIds: Array<number>; } export type TscrollPolicy = 'default' | 'always'; export type ICallType = 'SD' | 'Unpublished' | 'Published'; export interface Ianalytics { apiType: 'action' | 'event' | 'error' | 'default'; callType: ICallType; startTime?: number; endTime?: number; apiVersion: string; order?: string; className?: string; funcName?: string; guid?: string; args?: Record<string, any>; result?: Record<string, any>; extends?: string; } export {};