Skip to content

Commit

Permalink
Modify the create.d.ts (cocos#3059)
Browse files Browse the repository at this point in the history
1. fixed the problem that CCDebug doesn't contain cc.debug.DebugMode.
2. adjust the marco file, forbid the user to use the cc.KEY straightly
  • Loading branch information
ColinCollins authored and pandamicro committed Aug 9, 2018
1 parent 4715e7a commit 6a3c457
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 24 deletions.
2 changes: 0 additions & 2 deletions cocos2d/animation/types.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@
THE SOFTWARE.
****************************************************************************/

var JS = cc.js;

var WrapModeMask = {
Loop: 1 << 1,
ShouldWrap: 1 << 2,
Expand Down
31 changes: 14 additions & 17 deletions cocos2d/core/CCDebug.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
THE SOFTWARE.
****************************************************************************/

const Enum = require('./platform/CCEnum');
const debugInfos = require('../../DebugInfos') || {};
const ERROR_MAP_URL = 'https://github.com/cocos-creator/engine/blob/master/EngineErrorMap.md';

Expand Down Expand Up @@ -287,20 +286,12 @@ cc.assertID = function (cond) {
};

/**
* !#en An object to boot the game.
* !#zh 包含游戏主体信息并负责驱动游戏的游戏对象。
* @class debug
* @main
* @static
*/

/**
* !#en Enum for debug modes.
* !#zh 调试模式
* @enum DebugMode
* @property
*/
var DebugMode = Enum({
* !#en Enum for debug modes.
* !#zh 调试模式
* @enum debug.DebugMode
* @memberof cc
*/
var DebugMode = cc.Enum({
/**
* !#en The debug mode none.
* !#zh 禁止模式,禁止显示任何日志信息。
Expand Down Expand Up @@ -358,7 +349,13 @@ var DebugMode = Enum({
*/
ERROR_FOR_WEB_PAGE: 6
});

/**
* !#en An object to boot the game.
* !#zh 包含游戏主体信息并负责驱动游戏的游戏对象。
* @class debug
* @main
* @static
*/
module.exports = cc.debug = {
DebugMode: DebugMode,

Expand All @@ -369,7 +366,7 @@ module.exports = cc.debug = {
* !#zh 通过 error id 和必要的参数来获取错误信息。
* @method getError
* @param {id} errorId
* @param {ANY} [param]
* @param {any} [param]
* @return {String}
*/
getError: getTypedFormatter('ERROR'),
Expand Down
1 change: 1 addition & 0 deletions cocos2d/core/assets/CCTexture2D.js
Original file line number Diff line number Diff line change
Expand Up @@ -453,6 +453,7 @@ var Texture2D = cc.Class({
* 销毁该贴图,并立即释放它对应的显存。(继承自 cc.Object.destroy)<br/>
* 销毁后,该对象不再可用。您可以在访问对象之前使用 cc.isValid(obj) 来检查对象是否已被销毁。
* @method destroy
* @return {Boolean} inherit from the CCObject
*/
destroy () {
this._image = null;
Expand Down
8 changes: 4 additions & 4 deletions cocos2d/core/platform/CCMacro.js
Original file line number Diff line number Diff line change
Expand Up @@ -359,7 +359,7 @@ js.getset(cc.macro, 'ENABLE_3D', function () {
/**
* !#en Key map for keyboard event
* !#zh 键盘事件的按键值
* @enum KEY
* @enum macro.KEY
* @example {@link cocos2d/core/platform/CCCommon/KEY.js}
*/
cc.macro.KEY = {
Expand Down Expand Up @@ -1367,7 +1367,7 @@ cc.macro.KEY = {

/**
* Image formats
* @enum ImageFormat
* @enum macro.ImageFormat
*/
cc.macro.ImageFormat = cc.Enum({
/**
Expand Down Expand Up @@ -1445,7 +1445,7 @@ cc.macro.ImageFormat = cc.Enum({
* !#zh
* 混合因子
* 可参考: http://www.andersriggelsen.dk/glblendfunc.php
* @enum BlendFactor
* @enum macro.BlendFactor
*/
cc.macro.BlendFactor = cc.Enum({
/**
Expand Down Expand Up @@ -1511,7 +1511,7 @@ cc.macro.BlendFactor = cc.Enum({
});

/**
* @enum TextAlignment
* @enum macro.TextAlignment
*/
cc.macro.TextAlignment = cc.Enum({
/**
Expand Down
2 changes: 1 addition & 1 deletion cocos2d/particle/CCParticleSystem.js
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ var properties = {
/**
* !#en Indicate whether the system simulation have stopped.
* !#zh 指示粒子播放是否完毕。
* @property {Boolean} autoRemoveOnFinish
* @property {Boolean} stopped
*/
_stopped: true,
stopped: {
Expand Down

0 comments on commit 6a3c457

Please sign in to comment.