Files
esengine/demo/libs/modules/game/game.d.ts

2503 lines
78 KiB
TypeScript
Raw Normal View History

2020-06-08 11:49:45 +08:00
declare namespace egret {
/**
* The URLLoaderDataFormat class provides values that specify how downloaded data is received.
* @see http://edn.egret.com/cn/docs/page/600 Read different data format
* @version Egret 2.4
* @platform Web,Native
* @includeExample extension/game/net/URLLoaderDataFormat.ts
* @language en_US
*/
/**
* URLLoaderDataFormat
* @see http://edn.egret.com/cn/docs/page/600 读取不同数据格式
* @version Egret 2.4
* @platform Web,Native
* @includeExample extension/game/net/URLLoaderDataFormat.ts
* @language zh_CN
*/
class URLLoaderDataFormat {
/**
* Specify that downloaded data is received as raw binary data.
* @version Egret 2.4
* @platform Web
* @language en_US
*/
/**
*
* @version Egret 2.4
* @platform Web
* @language zh_CN
*/
static BINARY: string;
/**
* Specify that downloaded data is received as text.
* @version Egret 2.4
* @platform Web,Native
* @language en_US
*/
/**
*
* @version Egret 2.4
* @platform Web,Native
* @language zh_CN
*/
static TEXT: string;
/**
* Specify that downloaded data is received as URL-encoded variables.
* @version Egret 2.4
* @platform Web,Native
* @language en_US
*/
/**
* URL
* @version Egret 2.4
* @platform Web,Native
* @language zh_CN
*/
static VARIABLES: string;
/**
* Specify that downloaded data is received as bitmap texture.
* @version Egret 2.4
* @platform Web,Native
* @language en_US
*/
/**
*
* @version Egret 2.4
* @platform Web,Native
* @language zh_CN
*/
static TEXTURE: string;
/**
* Specify that downloaded data is received as sound.
* @version Egret 2.4
* @platform Web,Native
* @language en_US
*/
/**
*
* @version Egret 2.4
* @platform Web,Native
* @language zh_CN
*/
static SOUND: string;
}
}
declare namespace egret {
/**
* @version Egret 2.4
* @platform Web,Native
* @private
*/
class FrameLabel extends EventDispatcher {
/**
* @private
*/
private _name;
/**
* @private
*/
private _frame;
/**
* @private
*/
private _end;
/**
* @version Egret 2.4
* @platform Web,Native
*/
constructor(name: string, frame: number, end?: number);
/**
* Frame number
* @version Egret 2.4
* @platform Web,Native
* @language en_US
*/
/**
*
* @version Egret 2.4
* @platform Web,Native
* @language zh_CN
*/
readonly name: string;
/**
* Frame serial number of the label
* @version Egret 2.4
* @platform Web,Native
* @language en_US
*/
/**
*
* @version Egret 2.4
* @platform Web,Native
* @language zh_CN
*/
readonly frame: number;
/**
* Frame serial number, the end of the label
* @version Egret 2.4
* @platform Web,Native
* @language en_US
*/
/**
*
* @version Egret 2.4
* @platform Web,Native
* @language zh_CN
*/
readonly end: number;
/**
* Duplicate the current frame label object
* @version Egret 2.4
* @platform Web,Native
* @language en_US
*/
/**
*
* @version Egret 2.4
* @platform Web,Native
* @language zh_CN
*/
clone(): FrameLabel;
}
}
declare namespace egret {
/**
* @classdesc 使 MovieClipData MovieClip MovieClip MovieClipData MovieClipDataFactory生成
* @see http://edn.egret.com/cn/docs/page/596 MovieClip序列帧动画
* @version Egret 2.4
* @platform Web,Native
*/
class MovieClipData extends HashObject {
/**
* @private
* MovieClip数据
*/
$mcData: any;
/**
*
* @version Egret 2.4
* @platform Web,Native
*/
numFrames: number;
/**
*
* @version Egret 2.4
* @platform Web,Native
*/
frames: any[];
/**
*
* @version Egret 2.4
* @platform Web,Native
*/
labels: any[];
/**
*
* @version Egret 2.4
* @platform Web,Native
*/
events: any[];
/**
*
* @version Egret 2.4
* @platform Web,Native
*/
frameRate: number;
/**
*
* @version Egret 2.4
* @platform Web,Native
*/
textureData: any;
/**
*
* @version Egret 2.4
* @platform Web,Native
*/
spriteSheet: SpriteSheet;
/**
* egret.MovieClipData
* @version Egret 2.4
* @platform Web,Native
*/
constructor();
/**
* @private
*
* @param mcData
* @param textureData
* @param spriteSheet
*/
$init(mcData: any, textureData: any, spriteSheet: SpriteSheet): void;
/**
*
* @param frame {number}
* @returns {any}
* @version Egret 2.4
* @platform Web,Native
*/
getKeyFrameData(frame: number): any;
/**
* Texture对象
* @param frame {number}
* @returns {egret.Texture} Texture对象
* @version Egret 2.4
* @platform Web,Native
*/
getTextureByFrame(frame: number): Texture;
$getOffsetByFrame(frame: number, point: Point): void;
/**
* @private
*
* @param resName
* @returns
*/
private getTextureByResName(resName);
/**
* @private
*
* @returns
*/
$isDataValid(): boolean;
/**
* @private
*
* @returns
*/
$isTextureValid(): boolean;
/**
* @private
*
* @param mcData
*/
$fillMCData(mcData: any): void;
/**
* @private
*
* @param framesData
*/
private fillFramesData(framesData);
/**
* @private
*
* @param frameLabelsData
*/
private fillFrameLabelsData(frameLabelsData);
/**
* @private
*
* @param frameEventsData
*/
private fillFrameEventsData(frameEventsData);
/**
* @version Egret 2.4
* @platform Web,Native
*/
/**
* MovieClip数据源
*/
mcData: MovieClipData;
/**
* @private
*
* @param value
*/
private setMCData(value);
}
}
declare namespace egret {
/**
* @classdesc 使 MovieClipDataFactory MovieClipData MovieClip
* @see http://edn.egret.com/cn/docs/page/596 MovieClip序列帧动画
* @version Egret 2.4
* @platform Web,Native
*/
class MovieClipDataFactory extends EventDispatcher {
/**
*
* @version Egret 2.4
* @platform Web,Native
*/
enableCache: boolean;
/**
* @private
*/
$mcDataSet: any;
/**
* @private
*/
$spriteSheet: SpriteSheet;
/**
* @private
*/
$mcDataCache: any;
/**
* egret.MovieClipDataFactory
* @param movieClipDataSet {any} MovieClip数据集Egret官方工具生成
* @param texture {Texture}
* @version Egret 2.4
* @platform Web,Native
*/
constructor(movieClipDataSet?: any, texture?: Texture);
/**
*
* @version Egret 2.4
* @platform Web,Native
*/
clearCache(): void;
/**
* MovieClipData实例MovieClip
* @param movieClipName {string} MovieClip名字. "", MovieClip数据
* @returns {MovieClipData} MovieClipData对象
* @version Egret 2.4
* @platform Web,Native
*/
generateMovieClipData(movieClipName?: string): MovieClipData;
/**
* @private
*
* @param movieClipName
* @param cache
* @returns
*/
private findFromCache(movieClipName, cache);
/**
* @private
*
* @param movieClipName
* @param movieClip
* @param cache
*/
private fillData(movieClipName, movieClip, cache);
/**
* MovieClip数据集
* @version Egret 2.4
* @platform Web,Native
*/
mcDataSet: any;
/**
* MovieClip需要使用的纹理图
*/
texture: Texture;
/**
*
* @version Egret 2.4
* @platform Web,Native
*/
readonly spriteSheet: SpriteSheet;
/**
* @private
*
* @param value
*/
private setTexture(value);
}
}
declare namespace egret {
/**
* When the movieClip's current frame have a frameLabel, dispatches MovieClipEvent object. FrameLabel Event type: MovieClipEvent.FRAME_LABEL
* @version Egret 2.4
* @platform Web,Native
* @language en_US
*/
/**
* MovieClipEvent MovieClipEvent.FRAME_LABEL.
* @version Egret 2.4
* @platform Web,Native
* @language zh_CN
*/
class MovieClipEvent extends Event {
/**
* TextEvent create an object that contains information about movieClip events.
* @param type Type of event, you can access the MovieClipEvent.type.
* @param bubbles Determines whether the Event object participates in the bubbling stage of the event flow. The default value is false.
* @param cancelable Determine whether the Event object can be canceled. The default value is false.
* @param frameLabel When the current frame have a frameLabel, the event listeners can access this information through the frameLabel property.
* @version Egret 2.4
* @platform Web,Native
* @language en_US
*/
/**
* MovieClipEvent
* @param type MovieClipEvent.type 访
* @param bubbles Event false
* @param cancelable Event false
* @param frameLabel frameLabel 访
* @version Egret 2.4
* @platform Web,Native
* @language zh_CN
*/
constructor(type: string, bubbles?: boolean, cancelable?: boolean, frameLabel?: string);
/**
* Dispatched whenever the current frame have a frameLabel.
* @version Egret 2.4
* @platform Web,Native
* @language en_US
*/
/**
*
* @version Egret 2.4
* @platform Web,Native
* @language zh_CN
*/
static FRAME_LABEL: string;
/**
* In MovieClipEvent.FRAME_LABEL event, event corresponding string.
* @version Egret 2.4
* @platform Web,Native
* @language en_US
*/
/**
* MovieClipEvent.FRAME_LABEL event对应的字符串
* @version Egret 2.4
* @platform Web,Native
* @language zh_CN
*/
frameLabel: string;
/**
* EventDispatcher object using the specified event object thrown MovieClipEvent. The objects will be thrown in the object cache pool for the next round robin.
* @param type The type of the event, accessible as Event.type.
* @param bubbles Determines whether the Event object participates in the bubbling stage of the event flow. The default value is false.
* @param frameLabel MovieClipEvent object frameLabel
* @version Egret 2.4
* @platform Web,Native
* @language en_US
*/
/**
* 使EventDispatcher对象来抛出 MovieClipEvent
* @param target
* @param type
* @param frameLabel MovieClipEvent frameLabel
* @version Egret 2.4
* @platform Web,Native
* @language zh_CN
*/
static dispatchMovieClipEvent(target: IEventDispatcher, type: string, frameLabel?: string): boolean;
}
}
declare namespace egret {
/**
* @private
*/
class ScrollEase {
/**
* @version Egret 2.4
* @platform Web,Native
*/
constructor();
/**
*
* @param amount
* @returns
* @version Egret 2.4
* @platform Web,Native
*/
static get(amount: any): Function;
/**
* @version Egret 2.4
* @platform Web,Native
*/
static quintOut: Function;
/**
*
* @param pow
* @returns
* @version Egret 2.4
* @platform Web,Native
*/
static getPowOut(pow: any): Function;
/**
* @version Egret 2.4
* @platform Web,Native
*/
static quartOut: Function;
}
/**
* @private
*/
class ScrollTween extends EventDispatcher {
/**
* @private
*/
private static _tweens;
/**
* @private
*/
private static IGNORE;
/**
* @private
*/
private static _plugins;
/**
* @private
*/
private static _inited;
/**
* @private
*/
private _target;
/**
* @private
*/
private _useTicks;
/**
* @private
*/
private ignoreGlobalPause;
/**
* @private
*/
private loop;
/**
* @private
*/
private pluginData;
/**
* @private
*/
private _curQueueProps;
/**
* @private
*/
private _initQueueProps;
/**
* @private
*/
private _steps;
/**
* @private
*/
private _actions;
/**
* @private
*/
private paused;
/**
* @private
*/
private duration;
/**
* @private
*/
private _prevPos;
/**
* @private
*/
private position;
/**
* @private
*/
private _prevPosition;
/**
* @private
*/
private _stepPosition;
/**
* @private
*/
private passive;
/**
* Activate an object and add a ScrollTween animation to the object
* @param target {any} The object to be activated
* @param props {any} Parameters, support loop onChange onChangeObj
* @param pluginData {any} Write realized
* @param override {boolean} Whether to remove the object before adding a tween, the default value false
* @version Egret 2.4
* @platform Web,Native
* @language en_US
*/
/**
* ScrollTween
* @param target {any} ScrollTween
* @param props {any} loop() onChange() onChangeObj()
* @param pluginData {any}
* @param override {boolean} tweenfalse
* @version Egret 2.4
* @platform Web,Native
* @language zh_CN
*/
static get(target: any, props?: any, pluginData?: any, override?: boolean): ScrollTween;
/**
* Delete all ScrollTween animations from an object
* @param target The object whose ScrollTween to be deleted
* @version Egret 2.4
* @platform Web,Native
* @language en_US
*/
/**
* ScrollTween
* @param target ScrollTween
* @version Egret 2.4
* @platform Web,Native
* @language zh_CN
*/
static removeTweens(target: any): void;
/**
* @private
*
* @param delta
* @param paused
*/
private static tick(timeStamp, paused?);
private static _lastTime;
/**
* @private
*
* @param tween
* @param value
*/
private static _register(tween, value);
/**
* egret.ScrollTween
* @private
* @version Egret 2.4
* @platform Web,Native
*/
constructor(target: any, props: any, pluginData: any);
/**
* @private
*
* @param target
* @param props
* @param pluginData
*/
private initialize(target, props, pluginData);
/**
* @private
*
* @param value
* @param actionsMode
* @returns
*/
private setPosition(value, actionsMode?);
/**
* @private
*
* @param startPos
* @param endPos
* @param includeStart
*/
private _runActions(startPos, endPos, includeStart?);
/**
* @private
*
* @param step
* @param ratio
*/
private _updateTargetProps(step, ratio);
/**
* Whether setting is paused
* @param value {boolean} Whether to pause
* @returns ScrollTween object itself
* @version Egret 2.4
* @platform Web,Native
* @language en_US
*/
/**
*
* @param value {boolean}
* @returns Tween对象本身
* @version Egret 2.4
* @platform Web,Native
* @language zh_CN
*/
setPaused(value: boolean): ScrollTween;
/**
* @private
*
* @param props
* @returns
*/
private _cloneProps(props);
/**
* @private
*
* @param o
* @returns
*/
private _addStep(o);
/**
* @private
*
* @param o
* @returns
*/
private _appendQueueProps(o);
/**
* @private
*
* @param o
* @returns
*/
private _addAction(o);
/**
* Modify the property of the specified display object to a specified value
* @param props {Object} Property set of an object
* @param duration {number} Duration
* @param ease {egret.ScrollEase} Easing algorithm
* @returns {egret.ScrollTween} ScrollTween object itself
* @version Egret 2.4
* @platform Web,Native
* @language en_US
*/
/**
*
* @param props {Object}
* @param duration {number}
* @param ease {egret.ScrollEase}
* @returns {egret.ScrollTween} Tween对象本身
* @version Egret 2.4
* @platform Web,Native
* @language zh_CN
*/
to(props: any, duration?: number, ease?: Function): ScrollTween;
/**
* Execute callback function
* @param callback {Function} Callback method
* @param thisObj {any} this action scope of the callback method
* @param params {any[]} Parameter of the callback method
* @returns {egret.ScrollTween} ScrollTween object itself
* @version Egret 2.4
* @platform Web,Native
* @language en_US
*/
/**
*
* @param callback {Function}
* @param thisObj {any} this作用域
* @param params {any[]}
* @returns {egret.ScrollTween} Tween对象本身
* @version Egret 2.4
* @platform Web,Native
* @language zh_CN
*/
call(callback: Function, thisObj?: any, params?: any[]): ScrollTween;
/**
* @method egret.ScrollTween#tick
* @param delta {number}
* @private
* @version Egret 2.4
* @platform Web,Native
*/
tick(delta: number): void;
}
}
declare namespace egret {
/**
* ScrollView auxiliary classes for slides, you will pass a display object constructor. It can display more than the range display object within the specified size range. And can easily drag in this range.
* @version Egret 2.4
* @platform Web,Native
* @includeExample extension/game/display/ScrollView.ts
* @language en_US
*/
/**
* ScrollView
* @version Egret 2.4
* @platform Web,Native
* @includeExample extension/game/display/ScrollView.ts
* @language zh_CN
*/
class ScrollView extends DisplayObjectContainer {
/**
* @private
*/
_ScrV_Props_: ScrollViewProperties;
/**
* Start rolling threshold when the touch point from the initial touch point at a distance exceeding this value will trigger roll
* @version Egret 2.4
* @platform Web,Native
* @language en_US
*/
/**
*
* @version Egret 2.4
* @platform Web,Native
* @language zh_CN
*/
scrollBeginThreshold: number;
/**
* Scrolling speed, the speed is required and the default speed ratio.
* The range of scrollSpeed> 0 assigned to 2:00, the speed is 2 times the default speed
* @version Egret 2.4
* @platform Web,Native
* @language en_US
*/
/**
*
* scrollSpeed > 0 2 2
* @version Egret 2.4
* @platform Web,Native
* @language zh_CN
*/
scrollSpeed: number;
/**
* Whether to enable rebound, rebound When enabled, ScrollView contents allowed to continue to drag the border after arriving at the end user drag operation, and then bounce back boundary position
* @default true
* @version Egret 2.4
* @language en_US
*/
/**
* ScrollView中内容在到达边界后允许继续拖动
* @default true
* @version Egret 2.4
* @language zh_CN
*/
bounces: boolean;
/**
* Create a egret.ScrollView objects
* @param content {egret.DisplayObject} You need to scroll object
* @version Egret 2.4
* @platform Web,Native
* @language en_US
*/
/**
* egret.ScrollView
* @param content {egret.DisplayObject}
* @version Egret 2.4
* @platform Web,Native
* @language zh_CN
*/
constructor(content?: DisplayObject);
/**
* @private
*/
_content: DisplayObject;
/**
* Set to scroll object
* @param content {egret.DisplayObject} You need to scroll object
* @version Egret 2.4
* @platform Web,Native
* @language en_US
*/
/**
*
* @param content {egret.DisplayObject}
* @version Egret 2.4
* @platform Web,Native
* @language zh_CN
*/
setContent(content: DisplayObject): void;
/**
* Remove rolling objects
* @version Egret 2.4
* @platform Web,Native
* @language en_US
*/
/**
*
* @version Egret 2.4
* @platform Web,Native
* @language zh_CN
*/
removeContent(): void;
/**
* Vertical scroll bar display policy, on / off / auto.
* @version Egret 2.4
* @platform Web,Native
* @language en_US
*/
/**
* on/off/auto
* @version Egret 2.4
* @platform Web,Native
* @language zh_CN
*/
verticalScrollPolicy: string;
/**
* The horizontal scroll bar display policy, on / off / auto.
* @version Egret 2.4
* @platform Web,Native
* @language en_US
*/
/**
* on/off/auto
* @version Egret 2.4
* @platform Web,Native
* @language zh_CN
*/
horizontalScrollPolicy: string;
/**
* Gets or sets the horizontal scroll position
* @returns {number}
* @version Egret 2.4
* @platform Web,Native
* @language en_US
*/
/**
* ,
* @returns {number}
* @version Egret 2.4
* @platform Web,Native
* @language zh_CN
*/
scrollLeft: number;
/**
* Gets or sets the vertical scroll position
* @returns {number}
* @version Egret 2.4
* @platform Web,Native
* @language en_US
*/
/**
* ,
* @returns {number}
* @version Egret 2.4
* @platform Web,Native
* @language zh_CN
*/
scrollTop: number;
/**
* Set scroll position
* @param top {number} The vertical scroll position
* @param left {number} The horizontal scroll position
* @param isOffset {boolean} Optional parameter, the default is false, whether it is the amount of scrolling increase as top = 1 on behalf of one pixel scroll up
* @version Egret 2.4
* @platform Web,Native
* @language en_US
*/
/**
*
* @param top {number}
* @param left {number}
* @param isOffset {boolean} false top=1 1
* @version Egret 2.4
* @platform Web,Native
* @language zh_CN
*/
setScrollPosition(top: number, left: number, isOffset?: boolean): void;
/**
* @private
*
* @param top
* @param left
*/
private _validatePosition(top?, left?);
/**
* @private
* @inheritDoc
*/
$setWidth(value: number): void;
/**
* @private
* @inheritDoc
*/
$setHeight(value: number): void;
/**
* @private
*
*/
_updateContentPosition(): void;
/**
* @private
*
* @returns
*/
_checkScrollPolicy(): boolean;
/**
* @private
*
* @param policy
* @param contentLength
* @param viewLength
* @returns
*/
private __checkScrollPolicy(policy, contentLength, viewLength);
/**
* @private
*
* @returns
*/
_addEvents(): void;
/**
* @private
*
* @returns
*/
_removeEvents(): void;
private _tempStage;
/**
* @private
*
* @param e
*/
_onTouchBegin(e: TouchEvent): void;
/**
* @private
*/
private delayTouchBeginEvent;
/**
* @private
*/
private touchBeginTimer;
/**
* @private
*
* @param event
*/
_onTouchBeginCapture(event: TouchEvent): void;
/**
* @private
*
* @param event
* @returns
*/
private _onTouchEndCapture(event);
/**
* @private
*
*/
private _onTouchBeginTimer();
/**
* @private
*
* @param event
* @returns
*/
private dispatchPropagationEvent(event);
/**
* @private
*
* @param event
* @returns
*/
_onTouchMove(event: TouchEvent): void;
/**
* @private
*
* @param event
* @returns
*/
_onTouchEnd(event: TouchEvent): void;
/**
* @private
*
* @param event
* @returns
*/
_onEnterFrame(event: Event): void;
/**
* @private
*
* @param e
* @returns
*/
private _logTouchEvent(e);
/**
* @private
*
* @param e
* @returns
*/
private _getPointChange(e);
/**
* @private
*
* @param e
* @returns
*/
private _calcVelocitys(e);
/**
* @private
*
* @returns
*/
_getContentWidth(): number;
/**
* @private
*
* @returns
*/
_getContentHeight(): number;
/**
* The left side of the maximum distance
* @returns The left side of the maximum distance
* @version Egret 2.4
* @platform Web,Native
* @language en_US
*/
/**
*
* @returns
* @version Egret 2.4
* @platform Web,Native
* @language zh_CN
*/
getMaxScrollLeft(): number;
/**
* Above the maximum distance
* @returns Above the maximum distance
* @version Egret 2.4
* @platform Web,Native
* @language en_US
*/
/**
*
* @returns
* @version Egret 2.4
* @platform Web,Native
* @language zh_CN
*/
getMaxScrollTop(): number;
/**
* @private
*/
private static weight;
/**
* @private
*
*/
private _moveAfterTouchEnd();
/**
* @private
*
* @param tw
*/
private onTweenFinished(tw);
/**
* @private
*
* @returns
*/
_onScrollStarted(): void;
/**
* @private
*
* @returns
*/
_onScrollFinished(): void;
/**
* Set the scroll position above the distance
* @param scrollTop Position above distance
* @param duration Easing of time, in milliseconds
* @returns Get tween vertical scrolling
* @version Egret 2.4
* @platform Web,Native
* @language en_US
*/
/**
*
* @param scrollTop
* @param duration
* @returns tween
* @version Egret 2.4
* @platform Web,Native
* @language zh_CN
*/
setScrollTop(scrollTop: number, duration?: number): void;
/**
* Set the scroll position from the left side
* @param scrollLeft From the position on the left side
* @param duration Get tween vertical scrolling
* @returns Gets the horizontal scroll tween
* @version Egret 2.4
* @platform Web,Native
* @language en_US
*/
/**
*
* @param scrollLeft
* @param duration
* @returns tween
* @version Egret 2.4
* @platform Web,Native
* @language zh_CN
*/
setScrollLeft(scrollLeft: number, duration?: number): void;
/**
* @private
*
* @param pixelsPerMS
* @param curPos
* @param maxPos
* @returns
*/
private getAnimationDatas(pixelsPerMS, curPos, maxPos);
/**
* @private
*
* @param event
* @returns
*/
private cloneTouchEvent(event);
/**
* @private
*
* @returns
*/
private throwNotSupportedError();
/**
* @deprecated
* @inheritDoc
* @inheritDoc
* @version Egret 2.4
* @platform Web,Native
*/
addChild(child: DisplayObject): DisplayObject;
/**
* @deprecated
* @inheritDoc
* @version Egret 2.4
* @platform Web,Native
*/
addChildAt(child: DisplayObject, index: number): DisplayObject;
/**
* @deprecated
* @inheritDoc
* @version Egret 2.4
* @platform Web,Native
*/
removeChild(child: DisplayObject): DisplayObject;
/**
* @deprecated
* @inheritDoc
* @version Egret 2.4
* @platform Web,Native
*/
removeChildAt(index: number): DisplayObject;
/**
* @deprecated
* @inheritDoc
* @version Egret 2.4
* @platform Web,Native
*/
setChildIndex(child: DisplayObject, index: number): void;
/**
* @deprecated
* @inheritDoc
* @version Egret 2.4
* @platform Web,Native
*/
swapChildren(child1: DisplayObject, child2: DisplayObject): void;
/**
* @deprecated
* @inheritDoc
* @version Egret 2.4
* @platform Web,Native
*/
swapChildrenAt(index1: number, index2: number): void;
}
}
declare namespace egret {
/**
* @private
* @version Egret 2.4
* @platform Web,Native
*/
class ScrollViewProperties {
/**
* @private
*/
_verticalScrollPolicy: string;
/**
* @private
*/
_horizontalScrollPolicy: string;
/**
* @private
*/
_scrollLeft: number;
/**
* @private
*/
_scrollTop: number;
/**
* @private
*/
_hCanScroll: boolean;
/**
* @private
*/
_vCanScroll: boolean;
/**
* @private
*/
_lastTouchPosition: egret.Point;
/**
* @private
*/
_touchStartPosition: egret.Point;
/**
* @private
*/
_scrollStarted: boolean;
/**
* @private
*/
_lastTouchTime: number;
/**
* @private
*/
_lastTouchEvent: TouchEvent;
/**
* @private
*/
_velocitys: Array<{
x: number;
y: number;
}>;
/**
* @private
*/
_isHTweenPlaying: boolean;
/**
* @private
*/
_isVTweenPlaying: boolean;
/**
* @private
*/
_hScrollTween: ScrollTween;
/**
* @private
*/
_vScrollTween: ScrollTween;
/**
* @private
*/
_bounces: boolean;
}
}
declare namespace egret {
/**
* UThe URLLoader class downloads data from a URL as text, binary data, or URL-encoded variables. It is useful for downloading text files, XML, or other information to be used in a dynamic, data-driven application.
* A URLLoader object downloads all of the data from a URL before making it available to code in the applications. It sends out notifications about the progress of the download,
* which you can monitor through bytesLoaded and bytesTotal properties, as well as through dispatched events.
* @see http://edn.egret.com/cn/docs/page/601 Build communication request
* @event egret.Event.COMPLETE Dispatched when the net request is complete.
* @event egret.IOErrorEvent.IO_ERROR io error.
* @version Egret 2.4
* @platform Web,Native
* @includeExample extension/game/net/URLLoader.ts
* @language en_US
*/
/**
* URLLoader URL URL XML
* URLLoader URL
* bytesLoaded bytesTotal
* @see http://edn.egret.com/cn/docs/page/601 构建通信请求
* @event egret.Event.COMPLETE
* @event egret.IOErrorEvent.IO_ERROR
* @version Egret 2.4
* @platform Web,Native
* @includeExample extension/game/net/URLLoader.ts
* @language zh_CN
*/
class URLLoader extends EventDispatcher {
/**
* Create an egret.URLLoader object
* @param request {URLRequest} A URLRequest object specifies the URL to be downloaded.
* If this parameter is omitted, no load operation begins. If a parameter is specified, the load operation begins immediately
* @version Egret 2.4
* @platform Web,Native
* @language en_US
*/
/**
* egret.URLLoader
* @param request {URLRequest} URLRequest URL
*
* @version Egret 2.4
* @platform Web,Native
* @language zh_CN
*/
constructor(request?: URLRequest);
/**
* Control whether the downloaded data is received as text (URLLoaderDataFormat.TEXT), raw binary data (URLLoaderDataFormat.BINARY), or URL-encoded variables (URLLoaderDataFormat.VARIABLES).
* If the value of the dataFormat property is URLLoaderDataFormat.TEXT, the received data is a string containing the text of the loaded file.
* If the value of the dataFormat property is URLLoaderDataFormat.BINARY, the received data is a ByteArray object containing the raw binary data.
* If the value of the dataFormat property is URLLoaderDataFormat.TEXTURE, the received data is a Texture object containing the bitmap data.
* If the value of the dataFormat property is URLLoaderDataFormat.VARIABLES, the received data is a URLVariables object containing the URL-encoded variables.
* The default value is URLLoaderDataFormat.TEXT.
* @default egret.URLLoaderDataFormat.TEXT
* @version Egret 2.4
* @platform Web,Native
* @language en_US
*/
/**
* (URLLoaderDataFormat.TEXT) (URLLoaderDataFormat.BINARY) URL (URLLoaderDataFormat.VARIABLES)
* dataFormat URLLoaderDataFormat.TEXT
* dataFormat URLLoaderDataFormat.BINARY ByteArray
* dataFormat URLLoaderDataFormat.TEXTURETexture对象
* dataFormat URLLoaderDataFormat.VARIABLES URL URLVariables
* @default egret.URLLoaderDataFormat.TEXT
* @version Egret 2.4
* @platform Web,Native
* @language zh_CN
*/
dataFormat: string;
/**
* The data received from the load operation. This property is populated only when the load operation is complete. The format of the data depends on the setting of the dataFormat property:
* If the dataFormat property is URLLoaderDataFormat.TEXT, the received data is a string containing the text of the loaded file.
* If the dataFormat property is URLLoaderDataFormat.BINARY, the received data is a ByteArray object containing the raw binary data.
* If the dataFormat property is URLLoaderDataFormat.TEXTURE, the received data is a Texture object containing the bitmap data.
* If the dataFormat property is URLLoaderDataFormat.VARIABLES, the received data is a URLVariables object containing the URL-encoded variables.
* @version Egret 2.4
* @platform Web,Native
* @language en_US
*/
/**
* dataFormat
* dataFormat URLLoaderDataFormat.TEXT
* dataFormat URLLoaderDataFormat.BINARY ByteArray
* dataFormat URLLoaderDataFormat.TEXTURETexture对象
* dataFormat URLLoaderDataFormat.VARIABLES URL URLVariables
* @version Egret 2.4
* @platform Web,Native
* @language zh_CN
*/
data: any;
/**
* @private
*/
_request: URLRequest;
/**
* Send and load data from the specified URL. The data can be received as text, raw binary data, or URL-encoded variables, depending on the value you set for the dataFormat property.
* Note that the default value of the dataFormat property is text. If you want to send data to the specified URL, you can set the data property in the URLRequest object.
* @param request {URLRequest} A URLRequest object specifies the URL to be downloaded.
* @version Egret 2.4
* @platform Web,Native
* @language en_US
*/
/**
* URL URL dataFormat
* dataFormat URL URLRequest data
* @param request {URLRequest} URLRequest URL
* @version Egret 2.4
* @platform Web,Native
* @language zh_CN
*/
load(request: URLRequest): void;
private getResponseType(dataFormat);
/**
* @private
*/
private sound;
/**
* @private
*
* @param loader
*/
private loadSound(loader);
private onSoundoadComplete(event);
private onSoundLoaderPostProgress(event);
private onSoundLoaderError(event);
private removeSoundLoaderListeners();
/**
* @private
*/
private imageLoader;
/**
* @private
*/
private virtualUrl;
/**
* @private
*
* @param loader
*/
private loadTexture(loader);
private onImageLoadComplete(event);
private onImageLoaderPostProgress(event);
private onImageLoaderError(event);
private removeImageLoaderListeners();
/**
* @private
*/
_status: number;
/**
* @private
*
*/
__recycle(): void;
}
}
declare namespace egret {
/**
* @version Egret 2.4
* @platform Web,Native
* @includeExample extension/game/display/MovieClip.ts
* @language en_US
*/
/**
* MovieClip DisplayObject EventDispatcher DisplayObject MovieClip
* @extends egret.DisplayObject
* @event egret.Event.COMPLETE
* @event egret.Event.LOOP_COMPLETE COMPLETE LOOP_COMPLETE
* @see http://edn.egret.com/cn/docs/page/596 MovieClip序列帧动画
* @version Egret 2.4
* @platform Web,Native
* @includeExample extension/game/display/MovieClip.ts
* @language zh_CN
*/
class MovieClip extends DisplayObject {
$texture: Texture;
private offsetPoint;
$movieClipData: MovieClipData;
/**
* @private
*/
private frames;
/**
* @private
*/
$totalFrames: number;
/**
* @version Egret 2.4
* @platform Web,Native
* @private
*/
frameLabels: any[];
/**
* @private
*/
$frameLabelStart: number;
/**
* @private
*/
$frameLabelEnd: number;
/**
* @version Egret 2.4
* @platform Web,Native
* @private
*/
frameEvents: any[];
/**
* @private
*/
private frameIntervalTime;
/**
* @private
*/
$eventPool: string[];
$isPlaying: boolean;
/**
* @private
*/
private isStopped;
/**
* @private
*/
private playTimes;
/**
* @private
*/
$currentFrameNum: number;
/**
* @private
*/
$nextFrameNum: number;
/**
* @private
*/
private displayedKeyFrameNum;
/**
* @private
*/
private passedTime;
/**
* @private
*/
private $frameRate;
/**
* MovieClip MovieClip addElement方法
* @param movieClipData {movieClipData} movieClipData
* @version Egret 2.4
* @platform Web,Native
*/
constructor(movieClipData?: MovieClipData);
protected createNativeDisplayObject(): void;
/**
* @private
*/
$smoothing: boolean;
/**
* Whether or not is smoothed when scaled.
* @version Egret 3.0
* @platform Web
* @language en_US
*/
/**
*
* @version Egret 3.0
* @platform Web
* @language zh_CN
*/
smoothing: boolean;
/**
* @private
*
*/
$init(): void;
/**
* @private
*
*/
$reset(): void;
/**
* @private
*
*/
private _initFrame();
/**
* @private
*/
$updateRenderNode(): void;
/**
* @private
*/
$measureContentBounds(bounds: Rectangle): void;
/**
* @private
*
* @param stage
* @param nestLevel
*/
$onAddToStage(stage: Stage, nestLevel: number): void;
/**
* @private
*
*/
$onRemoveFromStage(): void;
/**
* @private
* FrameLabel对象
* @param labelName {string}
* @param ignoreCase {boolean} false
* @returns {egret.FrameLabel} FrameLabel对象
*/
private getFrameLabelByName(labelName, ignoreCase?);
/**
* @private
*
* @param labelName {string}
*/
private getFrameStartEnd(labelName);
/**
* @private
* FrameLabel对象
* @param frame {number}
* @returns {egret.FrameLabel} FrameLabel对象
*/
private getFrameLabelByFrame(frame);
/**
* @private
* FrameLabel对象FrameLabel对象
* @method egret.MovieClip#getFrameLabelForFrame
* @param frame {number}
* @returns {egret.FrameLabel} FrameLabel对象
*/
private getFrameLabelForFrame(frame);
/**
*
* @param playTimes {number} >=1<0循环播放默认值 0不改变播放次数(MovieClip初始播放次数设置为1)
* @version Egret 2.4
* @platform Web,Native
*/
play(playTimes?: number): void;
/**
*
* @version Egret 2.4
* @platform Web,Native
*/
stop(): void;
/**
*
* @version Egret 2.4
* @platform Web,Native
*/
prevFrame(): void;
/**
*
* @version Egret 2.4
* @platform Web,Native
*/
nextFrame(): void;
/**
*
* @param frame {any}
* @param playTimes {number} >=1<0循环播放默认值 0不改变播放次数
* @version Egret 2.4
* @platform Web,Native
*/
gotoAndPlay(frame: string | number, playTimes?: number): void;
/**
*
* @param frame {any}
* @version Egret 2.4
* @platform Web,Native
*/
gotoAndStop(frame: string | number): void;
/**
* @private
*
* @param frame
*/
private gotoFrame(frame);
/**
* @private
*/
private lastTime;
/**
* @private
*
* @param advancedTime
* @returns
*/
private advanceTime(timeStamp);
/**
* @private
*
*/
private advanceFrame();
/**
* @private
*
*/
private constructFrame();
/**
* @private
*
*/
$renderFrame(): void;
/**
* @private
*
*/
private handlePendingEvent();
/**
* MovieClip
* @version Egret 2.4
* @platform Web,Native
*/
readonly totalFrames: number;
/**
* MovieClip
* @version Egret 2.4
* @platform Web,Native
*/
readonly currentFrame: number;
/**
* MovieClip currentFrameLabel返回null
* @version Egret 2.4
* @platform Web,Native
*/
readonly currentFrameLabel: string;
/**
* currentLabel返回包含标签的先前帧的标签currentLabel返回null
* @version Egret 2.4
* @platform Web,Native
*/
readonly currentLabel: string;
/**
* MovieClip
* @version Egret 2.4
* @platform Web,Native
*/
frameRate: number;
/**
* MovieClip
* @version Egret 2.4
* @platform Web,Native
*/
readonly isPlaying: boolean;
/**
* @version Egret 2.4
* @platform Web,Native
*/
/**
* MovieClip数据源
*/
movieClipData: MovieClipData;
/**
* @private
*
* @param value
*/
private setMovieClipData(value);
/**
* @private
*
* @param value
*/
private setPlayTimes(value);
/**
* @private
*
* @param value
*/
private setIsStopped(value);
}
}
declare namespace egret {
/**
* The URLRequest class captures all of the information in a single HTTP request.
* @see http://edn.egret.com/cn/index.php/article/index/id/601 Build communication request
* @version Egret 2.4
* @platform Web,Native
* @includeExample extension/game/net/URLRequest.ts
* @language en_US
*/
/**
* URLRequest HTTP
* @see http://edn.egret.com/cn/index.php/article/index/id/601 构建通信请求
* @version Egret 2.4
* @platform Web,Native
* @includeExample extension/game/net/URLRequest.ts
* @language zh_CN
*/
class URLRequest extends HashObject {
/**
* Create an egret.URLRequest object
* @param url {string} Addresses for URL requests
* @version Egret 2.4
* @platform Web,Native
* @language en_US
*/
/**
* egret.URLRequest
* @param url {string}
* @version Egret 2.4
* @platform Web,Native
* @language zh_CN
*/
constructor(url?: string);
/**
* An object contains data to be transmitted with the URL request.
* This property is used in conjunction with the method property. When the value of method is GET, the value of data is appended to the value of URLRequest.url, using HTTP query-string syntax.
* When the method value is POST (or any value other than GET), the value of data is transmitted in the body of the HTTP request.
* The URLRequest API offers binary POST support and support for URL-encoded variables, as well as support for strings. The data object can be a ArrayBuffer, URLVariables, or String object.
* The way in which the data is used depends on the type of object used:
* If the object is a ArrayBuffer object, the binary data of the ArrayBuffer object is used as POST data. For GET, data of ArrayBuffer type is not supported.
* If the object is a URLVariables object and the method is POST, then the variables are encoded using x-www-form-urlencoded format and the resulting string is used as POST data.
* If the object is a URLVariables object and the method is GET, the URLVariables object will define variables to be sent with the URLRequest object.
* Otherwise, the object is converted into a string, and the string is used as the POST or GET data.
* @version Egret 2.4
* @platform Web,Native
* @language en_US
*/
/**
* URL
* method 使 method GET 使 HTTP data URLRequest.url
* method POST GET HTTP data
* URLRequest API POST URL ArrayBufferURLVariables String
* 使
* ArrayBuffer ArrayBuffer POST GET ArrayBuffer
* URLVariables POST使 x-www-form-urlencoded POST
* URLVariables GET URLVariables URLRequest
* POST GET
* @version Egret 2.4
* @platform Web,Native
* @language zh_CN
*/
data: any;
/**
* Request method, valid values are URLRequestMethod.GET or URLRequestMethod.POST.
* @version Egret 2.4
* @platform Web,Native
* @language en_US
*/
/**
* URLRequestMethod.GET URLRequestMethod.POST
* @version Egret 2.4
* @platform Web,Native
* @language zh_CN
*/
method: string;
/**
* The requested URL.
* @version Egret 2.4
* @platform Web,Native
* @language en_US
*/
/**
* URL
* @version Egret 2.4
* @platform Web,Native
* @language zh_CN
*/
url: string;
/**
* The array of HTTP request headers to be appended to the HTTP request. The array is composed of URLRequestHeader objects.
* Each object in the array must be a URLRequestHeader object that contains a name string and a value string.
* Because of browser compatibility, this property has not been achieved in html5
* @version Egret 2.4
* @platform Web,Native
* @language en_US
*/
/**
* HTTP HTTP URLRequestHeader
* URLRequestHeader
* html5
* @version Egret 2.4
* @platform Web,Native
* @language zh_CN
*/
requestHeaders: Array<URLRequestHeader>;
}
}
declare namespace egret {
/**
* A URLRequestHeader object encapsulates a single HTTP request header and consists of a name/value pair. URLRequestHeader objects are used in the requestHeaders property of the URLRequest class.
* Note: Because of browser compatibility, this property has not been achieved in html5
* @version Egret 2.4
* @platform Web,Native
* @includeExample extension/game/net/URLRequestHeader.ts
* @language en_US
*/
/**
* URLRequestHeader HTTP /URLRequestHeader URLRequest requestHeaders 使
* html5
* @version Egret 2.4
* @platform Web,Native
* @includeExample extension/game/net/URLRequestHeader.ts
* @language zh_CN
*/
class URLRequestHeader {
/**
* HTTP request header name, such as Content-Type
* @version Egret 2.4
* @platform Web,Native
* @language en_US
*/
/**
* HTTP Content-Type
* @version Egret 2.4
* @platform Web,Native
* @language zh_CN
*/
name: string;
/**
* The values associated with the name property (such as text/plain).
* @version Egret 2.4
* @platform Web,Native
* @language en_US
*/
/**
* name text/plain
* @version Egret 2.4
* @platform Web,Native
* @language zh_CN
*/
value: string;
/**
* Create an egret.URLRequestHeader object
* @version Egret 2.4
* @platform Web,Native
* @language en_US
*/
/**
* egret.URLRequestHeader
* @version Egret 2.4
* @platform Web,Native
* @language zh_CN
*/
constructor(name: string, value: string);
}
}
declare namespace egret {
/**
* The URLRequestMethod class provides values that specify whether the
* URLRequest object should use the POST method or the GET method when sending data to a server.
* @see http://edn.egret.com/cn/docs/page/599 POST与GET
* @version Egret 2.4
* @platform Web,Native
* @includeExample extension/game/net/URLRequestMethod.ts
* @language en_US
*/
/**
* URLRequestMethod
* URLRequest 使 POST GET
* @see http://edn.egret.com/cn/docs/page/599 POST与GET
* @version Egret 2.4
* @platform Web,Native
* @includeExample extension/game/net/URLRequestMethod.ts
* @language zh_CN
*/
class URLRequestMethod {
/**
* Specify that the URLRequest object is a GET.
* @version Egret 2.4
* @platform Web,Native
* @language en_US
*/
/**
* URLRequest GET
* @version Egret 2.4
* @platform Web,Native
* @language zh_CN
*/
static GET: string;
/**
* Specify that the URLRequest object is a POST.
* @version Egret 2.4
* @platform Web,Native
* @language en_US
*/
/**
* URLRequest POST
* @version Egret 2.4
* @platform Web,Native
* @language zh_CN
*/
static POST: string;
}
}
declare namespace egret {
/**
* The URLVariables class allows you to transfer variables between an application and a server.
* Use URLVariables objects with methods of the URLLoader class and the data property of the URLRequest class.
* @see http://edn.egret.com/cn/docs/page/598 Send the request with parameters
* @version Egret 2.4
* @platform Web,Native
* @includeExample extension/game/net/URLVariables.ts
* @language en_US
*/
/**
* 使 URLVariables
* URLVariables URLLoader URLRequest data 使
* @see http://edn.egret.com/cn/docs/page/598 发送带参数的请求
* @version Egret 2.4
* @platform Web,Native
* @includeExample extension/game/net/URLVariables.ts
* @language zh_CN
*/
class URLVariables extends HashObject {
/**
* Create an egret.URLVariable object
* @param source {String} A URL-encoded string containing name/value pairs.
* @version Egret 2.4
* @platform Web,Native
* @language en_US
*/
/**
* egret.URLVariables
* @param source {String} / URL
* @version Egret 2.4
* @platform Web,Native
* @language zh_CN
*/
constructor(source?: string);
/**
* Key-value pair data object saved in this URLVariables object
* @version Egret 2.4
* @platform Web,Native
* @language en_US
*/
/**
* URLVariables
* @version Egret 2.4
* @platform Web,Native
* @language zh_CN
*/
variables: Object;
/**
* Convert the variable string into the property of this URLVariables.variables object.
* @param source {string}
* @version Egret 2.4
* @platform Web,Native
* @language en_US
*/
/**
* URLVariables.variables
* @param source {string}
* @version Egret 2.4
* @platform Web,Native
* @language zh_CN
*/
decode(source: string): void;
/**
* Return a string containing all enumerable variables using the MIME content encoding format : application/x-www-form-urlencoded.
* @version Egret 2.4
* @platform Web,Native
* @language en_US
*/
/**
* MIME application/x-www-form-urlencoded
* @version Egret 2.4
* @platform Web,Native
* @language zh_CN
*/
toString(): string;
/**
* @private
*
* @param key
* @param value
*/
private encodeValue(key, value);
/**
* @private
*
* @param key
* @param value
*/
private encodeArray(key, value);
}
}
declare namespace egret {
/**
* @version Egret 2.4
* @platform Web,Native
* @includeExample extension/game/player/Ticker.ts
* @language en_US
*/
/**
* @version Egret 2.4
* @platform Web,Native
* @includeExample extension/game/player/Ticker.ts
* @language zh_CN
*/
class Ticker extends EventDispatcher {
/**
* @deprecated
* @version Egret 2.4
* @platform Web,Native
*/
constructor();
private _timeScale;
private _paused;
private _callIndex;
private _callList;
private _lastTime;
private update(timeStamp);
private callBackList;
/**
* 使 egret.startTick
* @method egret.Ticker#register
* @param listener {Function} ,onEnterFrame(frameTime:number):void
* @param thisObject {any} this对象
* @param priority {number} Number.NEGATIVE_INFINITY Number.POSITIVE_INFINITY
* @version Egret 2.4
* @platform Web,Native
* @deprecated
*/
register(listener: Function, thisObject: any, priority?: number): void;
/**
* enterFrame事件使 egret.stopTick
* @method egret.Ticker#unregister
* @param listener {Function}
* @param thisObject {any} this对象
* @version Egret 2.4
* @platform Web,Native
* @deprecated
*/
unregister(listener: Function, thisObject: any): void;
/**
* @deprecated
* @param timeScale {number}
* @private
*/
setTimeScale(timeScale: number): void;
/**
* @deprecated
* @method egret.Ticker#getTimeScale
* @private
*/
getTimeScale(): number;
/**
*
* @deprecated
* @method egret.Ticker#pause
*/
pause(): void;
/**
*
* @deprecated
* @method egret.Ticker#resume
*/
resume(): void;
/**
* @private
*/
private static instance;
/**
* @method egret.Ticker.getInstance
* @returns {Ticker}
* @version Egret 2.4
* @platform Web,Native
* @deprecated
*/
static getInstance(): egret.Ticker;
}
}
declare namespace egret {
/**
* @class egret.MainContext
* @classdesc
* MainContext是游戏的核心跨平台接口Context
* @extends egret.EventDispatcher
* @private
* @version Egret 2.4
* @platform Web,Native
*/
class MainContext extends EventDispatcher {
/**
* @version Egret 2.4
* @platform Web,Native
*/
constructor();
/**
* Context
* @member egret.MainContext#rendererContext
* @version Egret 2.4
* @platform Web,Native
*/
/**
* Context
* @member egret.MainContext#touchContext
* @version Egret 2.4
* @platform Web,Native
*/
/**
* divice
* @member egret.MainContext#deviceContext
* @version Egret 2.4
* @platform Web,Native
*/
/**
*
* @member egret.MainContext#stage
* @version Egret 2.4
* @platform Web,Native
*/
readonly stage: Stage;
/**
* @version Egret 2.4
* @platform Web,Native
*/
static deviceType: string;
/**
* @version Egret 2.4
* @platform Web,Native
*/
static DEVICE_PC: string;
/**
* @version Egret 2.4
* @platform Web,Native
*/
static DEVICE_MOBILE: string;
/**
* Flash的滑动跑道模型
* @method egret.MainContext#run
* @version Egret 2.4
* @platform Web,Native
*/
/**
* @private
*/
private static _instance;
/**
* @method egret.Ticker.getInstance
* @returns {Ticker}
* @version Egret 2.4
* @platform Web,Native
*/
static readonly instance: egret.MainContext;
}
}
declare namespace egret {
/**
* Tool class for object cache repeat use, which can be used to construct an object pool. Objects are automatically recycled after a certain duration.
* @version Egret 2.4
* @platform Web,Native
* @includeExample extension/game/utils/Recycler.ts
* @private
* @language en_US
*/
/**
*
* @version Egret 2.4
* @platform Web,Native
* @includeExample extension/game/utils/Recycler.ts
* @private
* @language zh_CN
*/
class Recycler extends HashObject {
/**
* Create an egret.Recycler object
* @param autoDisposeTime {number} Number of frames when objects are destroyed automatically. Default value: 300
* @version Egret 2.4
* @platform Web,Native
* @language en_US
*/
/**
* egret.Recycler
* @param autoDisposeTime {number} 300
* @version Egret 2.4
* @platform Web,Native
* @language zh_CN
*/
constructor(autoDisposeTime?: number);
/**
* @private
*/
static _callBackList: any[];
static $init(): void;
static onUpdate(timeStamp: number): boolean;
/**
* @private
*
*/
private autoDisposeTime;
/**
* @private
*/
private frameCount;
/**
* @private
*
*/
$checkFrame(): void;
/**
* @private
*/
private objectPool;
/**
* @private
*/
private _length;
/**
* Number of cached objects"
* @version Egret 2.4
* @platform Web,Native
* @language en_US
*/
/**
*
* @version Egret 2.4
* @platform Web,Native
* @language zh_CN
*/
readonly length: number;
/**
* Cache an object for repeat use
* @param object {any} The object to be cached
* @version Egret 2.4
* @platform Web,Native
* @language en_US
*/
/**
*
* @param object {any}
* @version Egret 2.4
* @platform Web,Native
* @language zh_CN
*/
push(object: any): void;
/**
* Obtain a cached object
* @returns {any} The obtained cached object
* @version Egret 2.4
* @platform Web,Native
* @language en_US
*/
/**
*
* @returns {any}
* @version Egret 2.4
* @platform Web,Native
* @language zh_CN
*/
pop(): any;
/**
* Immediately clear all cached objects.
* @version Egret 2.4
* @platform Web,Native
* @language en_US
*/
/**
*
* @version Egret 2.4
* @platform Web,Native
* @language zh_CN
*/
dispose(): void;
}
}
declare namespace egret {
/**
* To specify a delay (in milliseconds) calls the function specified interval loop.
* @param listener {Function} Listener function
* @param thisObject {any} this object
* @param delay {number} Delay time, in milliseconds
* @param ...args {any} Parameter list
* @returns {number} Return index which can be used for clearInterval
* @version Egret 2.4
* @platform Web,Native
* @includeExample extension/game/utils/setInterval.ts
* @language en_US
*/
/**
*
* @param listener {Function}
* @param thisObject {any} this对象
* @param delay {number}
* @param ...args {any}
* @returns {number} clearInterval
* @version Egret 2.4
* @platform Web,Native
* @includeExample extension/game/utils/setInterval.ts
* @language zh_CN
*/
function setInterval<Z>(listener: (this: Z, ...arg) => void, thisObject: Z, delay: number, ...args: any[]): number;
/**
* Clear function to run after a specified delay.
* @param key {number} Index that egret.setInterval returns
* @version Egret 2.4
* @platform Web,Native
* @includeExample egret/utils/setInterval.ts
* @language en_US
*/
/**
*
* @param key {number} egret.setInterval所返回的索引
* @version Egret 2.4
* @platform Web,Native
* @includeExample egret/utils/setInterval.ts
* @language zh_CN
*/
function clearInterval(key: number): void;
}
declare namespace egret {
/**
* Run the designated function in specified delay (in milliseconds).
* @param listener {Function} Listener function
* @param thisObject {any} this object
* @param delay {number} Delay time, in milliseconds
* @param ...args {any} Parameter list
* @returns {number} Return index which can be used for clearTimeout
* @version Egret 2.4
* @platform Web,Native
* @includeExample extension/game/utils/setTimeout.ts
* @language en_US
*/
/**
*
* @param listener {Function}
* @param thisObject {any} this对象
* @param delay {number}
* @param ...args {any}
* @returns {number} clearTimeout
* @version Egret 2.4
* @platform Web,Native
* @includeExample extension/game/utils/setTimeout.ts
* @language zh_CN
*/
function setTimeout<Z>(listener: (this: Z, ...arg) => void, thisObject: Z, delay: number, ...args: any[]): number;
/**
* Function run after the specified delay is cleared.
* @param key {number} Index that egret.setTimeout returns
* @version Egret 2.4
* @platform Web,Native
* @language en_US
*/
/**
*
* @param key {number} egret.setTimeout所返回的索引
* @version Egret 2.4
* @platform Web,Native
* @language zh_CN
*/
function clearTimeout(key: number): void;
}