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

216 lines (215 loc) 6.41 kB
import { AtomController } from './common/atom-controller'; import { ResultType } from './common/data-type'; interface IColor { r: number; g: number; b: number; a: number; } interface ISkyLight { skyLightIntensity?: number; nightIntensity?: number; skyLightColor?: IColor; lowerHemisphereColor?: IColor; } interface ISunLight { sunLightIntensity?: number; sunLightColor?: IColor; sunLightTemperature?: number; sunElevation?: number; sunAzimuth?: number; sunSize?: number; enableSunLightShadow?: boolean; rayCountDirectional?: number; samplesPerRayDirectional?: number; } interface IFog { fogInscatteringColor?: IColor; fogDensity?: number; fogHeightFalloff?: number; fogStartDistance?: number; } interface IWeather { cloudIntensity?: number; rainAmount?: number; snowAmount?: number; } interface IenvironmentSetting { skyLight?: ISkyLight; sunLight?: ISunLight; fog?: IFog; weather?: IWeather; } interface IscenePostSettings { filter?: string; filterIntensity?: number; exposure?: number; saturation?: number; contrast?: number; bloomIntensity?: number; bloomThreshold?: number; colorGradingGlobalOffset?: IColor; /** @since WDPAPI 2.4.0 - 环境光遮蔽(AO)强度,取值 [0, 1],默认 0.25 */ ambientOcclusionIntensity?: number; /** @since WDPAPI 2.4.0 - 环境光遮蔽(AO)半径,取值 [0.1, 500],默认 8 */ ambientOcclusionRadius?: number; } /** * @public * @class EnvironmentController * @extends AtomController */ declare class EnvironmentController extends AtomController { private apiClassName; private EnvironmentValidate; /** * @constructor * @param {any} obj */ constructor(obj: any); /** * @public * @async * @function GetCurrentWeather * @param {string} cityName * @returns {Promise<ResultType>} */ GetCurrentWeather(cityName: string): Promise<ResultType>; /** * @public * @async * @function GetCityInfo * @param {string} cityName * @returns {Promise<ResultType>} */ GetCityInfo(cityName: string): Promise<ResultType>; /** * @public * @async * @function SetRealTimeWeatherTimerAllowed * @param {boolean} isAllowed (default value is true) * @returns {Promise<ResultType>} */ SetRealTimeWeatherTimerAllowed(isAllowed?: boolean): Promise<ResultType>; /** * @public * @async * @function GetSkylightTime * @returns {Promise<ResultType>} */ GetSkylightTime(): Promise<ResultType>; /** * @public * @async * @function SetSkylightTime * @param {string} skylightTime * @param {number} durationSeconds * @param {boolean} bRealtime (default value is false) * @returns {Promise<ResultType>} */ SetSkylightTime(skylightTime: string, durationSeconds: number, bRealtime?: boolean): Promise<ResultType>; /** * @public * @async * @function GetSceneWeather * @returns {Promise<ResultType>} */ GetSceneWeather(): Promise<ResultType>; /** * @public * @async * @function SetSceneWeather * @param {string} sceneWeather * @param {number} durationSeconds * @param {boolean} bRealtime (default value is false) * @returns {Promise<ResultType>} */ SetSceneWeather(sceneWeather: string, durationSeconds: number, bRealtime?: boolean): Promise<ResultType>; /** * @public * @async * @function SetSceneCustomSettings * @param {IenvironmentSetting} opt * @returns {Promise<ResultType>} */ SetSceneCustomSettings(opt: IenvironmentSetting): Promise<ResultType>; /** * @public * @async * @function GetSceneCustomSettings * @returns {Promise<ResultType>} */ GetSceneCustomSettings(): Promise<ResultType>; /** * @public * @async * @function SetScenePostSettings * @param {IscenePostSettings} opt * @returns {Promise<ResultType>} */ SetScenePostSettings(opt: IscenePostSettings): Promise<ResultType>; /** * @public * @async * @function GetScenePostSettings * @returns {Promise<ResultType>} */ GetScenePostSettings(): Promise<ResultType>; /** * @public * @async * @function SetEnvironment * @param {object} opt * @param {object} [opt.skylightTime] * @param {string} opt.skylightTime.skylightTime * @param {number} opt.skylightTime.durationSeconds * @param {boolean} opt.skylightTime.bRealtime * @param {object} [opt.sceneWeather] * @param {string} opt.sceneWeather.sceneWeather * @param {number} opt.sceneWeather.durationSeconds * @param {boolean} opt.sceneWeather.bRealtime * @param {IenvironmentSetting} [opt.customSettings] * @param {IscenePostSettings} [opt.postSettings] * @returns {Promise<ResultType>} */ SetEnvironment(opt: { skylightTime?: { skylightTime: string; durationSeconds: number; }; sceneWeather?: { sceneWeather: string; durationSeconds: number; }; customSettings?: IenvironmentSetting; postSettings?: IscenePostSettings; }): Promise<ResultType>; /** * @public * @async * @function GetEnvironment * @returns {Promise<ResultType>} */ GetEnvironment(): Promise<ResultType>; /** * @public * @async * @deprecated 自 WDPAPI 2.4.0 起已弃用,后续版本将移除。请改用 GetSceneCustomSettings 读取当前场景自定义环境参数。 * @function GetSceneWeatherPreset * @param {string} skylightTime * @param {string} sceneWeather * @returns {Promise<ResultType>} */ GetSceneWeatherPreset(skylightTime: string, sceneWeather: string): Promise<ResultType>; /** * @public * @async * @deprecated 自 WDPAPI 2.4.0 起已弃用,后续版本将移除。请改用 GetScenePostSettings 读取当前场景后期处理参数。 * @function GetScenePostPreset * @param {string} skylightTime * @param {string} sceneWeather * @returns {Promise<ResultType>} */ GetScenePostPreset(skylightTime: string, sceneWeather: string): Promise<ResultType>; } export default EnvironmentController;