Merge pull request #1655 from jareguo/master

refine creator.d.ts
This commit is contained in:
Wang Nan
2017-05-17 14:22:39 +08:00
committed by GitHub
5 changed files with 24 additions and 24 deletions
+5 -5
View File
@@ -333,7 +333,7 @@ var Component = cc.Class({
* var sprite = node.addComponent(cc.Sprite);
* var test = node.addComponent("Test");
* @typescript
* addComponent<T extends Component>(type: {new(): T; }): T
* addComponent<T extends Component>(type: typeof T): T
* addComponent(className: string): any
*/
addComponent (typeOrClassName) {
@@ -357,7 +357,7 @@ var Component = cc.Class({
* // get custom test calss.
* var test = node.getComponent("Test");
* @typescript
* getComponent<T extends Component>(type: {new(): T; }): T
* getComponent<T extends Component>(type: typeof T): T
* getComponent(className: string): any
*/
getComponent (typeOrClassName) {
@@ -375,7 +375,7 @@ var Component = cc.Class({
* var sprites = node.getComponents(cc.Sprite);
* var tests = node.getComponents("Test");
* @typescript
* getComponents<T extends Component>(type: {new(): T; }): T[]
* getComponents<T extends Component>(type: typeof T): T[]
* getComponents(className: string): any[]
*/
getComponents (typeOrClassName) {
@@ -393,7 +393,7 @@ var Component = cc.Class({
* var sprite = node.getComponentInChildren(cc.Sprite);
* var Test = node.getComponentInChildren("Test");
* @typescript
* getComponentInChildren<T extends Component>(type: {new(): T; }): T
* getComponentInChildren<T extends Component>(type: typeof T): T
* getComponentInChildren(className: string): any
*/
getComponentInChildren (typeOrClassName) {
@@ -411,7 +411,7 @@ var Component = cc.Class({
* var sprites = node.getComponentsInChildren(cc.Sprite);
* var tests = node.getComponentsInChildren("Test");
* @typescript
* getComponentsInChildren<T extends Component>(type: {new(): T; }): T[]
* getComponentsInChildren<T extends Component>(type: typeof T): T[]
* getComponentsInChildren(className: string): any[]
*/
getComponentsInChildren (typeOrClassName) {
+9 -9
View File
@@ -409,9 +409,9 @@ proto._parseLoadResArgs = function (type, onProgress, onComplete) {
* cc.log('Result should be a sprite frame: ' + (spriteFrame instanceof cc.SpriteFrame));
* });
* @typescript
* loadRes(url: string, type: {new (): cc.Asset}, progressCallback: Function, completeCallback: ((error: Error, resource: any) => void)|null): void
* loadRes(url: string, type: {new (): cc.Asset}, completeCallback: (error: Error, resource: any) => void): void
* loadRes(url: string, type: {new (): cc.Asset}): void
* loadRes(url: string, type: typeof cc.Asset, progressCallback: Function, completeCallback: ((error: Error, resource: any) => void)|null): void
* loadRes(url: string, type: typeof cc.Asset, completeCallback: (error: Error, resource: any) => void): void
* loadRes(url: string, type: typeof cc.Asset): void
* loadRes(url: string, progressCallback: Function, completeCallback: ((error: Error, resource: any) => void)|null): void
* loadRes(url: string, completeCallback: (error: Error, resource: any) => void): void
* loadRes(url: string): void
@@ -522,9 +522,9 @@ proto._loadResUuids = function (uuids, progressCallback, completeCallback, urls)
* // ...
* });
* @typescript
* loadResArray(url: string[], type: {new (): cc.Asset}, progressCallback: Function, completeCallback: ((error: Error, resource: any[]) => void)|null): void
* loadResArray(url: string[], type: {new (): cc.Asset}, completeCallback: (error: Error, resource: any[]) => void): void
* loadResArray(url: string[], type: {new (): cc.Asset}): void
* loadResArray(url: string[], type: typeof cc.Asset, progressCallback: Function, completeCallback: ((error: Error, resource: any[]) => void)|null): void
* loadResArray(url: string[], type: typeof cc.Asset, completeCallback: (error: Error, resource: any[]) => void): void
* loadResArray(url: string[], type: typeof cc.Asset): void
* loadResArray(url: string[], progressCallback: Function, completeCallback: ((error: Error, resource: any[]) => void)|null): void
* loadResArray(url: string[], completeCallback: (error: Error, resource: any[]) => void): void
* loadResArray(url: string[]): void
@@ -591,9 +591,9 @@ proto.loadResArray = function (urls, type, progressCallback, completeCallback) {
* var url = urls[0];
* });
* @typescript
* loadResDir(url: string, type: {new (): cc.Asset}, progressCallback: Function, completeCallback: ((error: Error, resource: any[], urls: string[]) => void)|null): void
* loadResDir(url: string, type: {new (): cc.Asset}, completeCallback: (error: Error, resource: any[], urls: string[]) => void): void
* loadResDir(url: string, type: {new (): cc.Asset}): void
* loadResDir(url: string, type: typeof cc.Asset, progressCallback: Function, completeCallback: ((error: Error, resource: any[], urls: string[]) => void)|null): void
* loadResDir(url: string, type: typeof cc.Asset, completeCallback: (error: Error, resource: any[], urls: string[]) => void): void
* loadResDir(url: string, type: typeof cc.Asset): void
* loadResDir(url: string, progressCallback: Function, completeCallback: ((error: Error, resource: any[], urls: string[]) => void)|null): void
* loadResDir(url: string, completeCallback: (error: Error, resource: any[], urls: string[]) => void): void
* loadResDir(url: string): void
+1 -1
View File
@@ -769,7 +769,7 @@ function declareProperties (cls, className, properties, baseClass, mixins, es6)
*
* @param {Object} [options.editor] - attributes for Component listed below.
* @param {Boolean} [options.editor.executeInEditMode=false] - Allows the current component to run in edit mode. By default, all components are executed only at runtime, meaning that they will not have their callback functions executed while the Editor is in edit mode.
* @param {Component} [options.editor.requireComponent] - Automatically add required component as a dependency.
* @param {Function} [options.editor.requireComponent] - Automatically add required component as a dependency.
* @param {String} [options.editor.menu] - The menu path to register a component to the editors "Component" menu. Eg. "Rendering/Camera".
* @param {Number} [options.editor.executionOrder=0] - The execution order of lifecycle methods for Component. Those less than 0 will execute before while those greater than 0 will execute after. The order will only affect onLoad, onEnable, start, update and lateUpdate while onDisable and onDestroy will not be affected.
* @param {Boolean} [options.editor.disallowMultiple] - If specified to a type, prevents Component of the same type (or subtype) to be added more than once to a Node.
+4 -4
View File
@@ -194,8 +194,8 @@ var ccclass = checkCtorArgument(function (ctor, name) {
* @method property
* @param {Object} [options] - an object with some property attributes
* @param {Any} [options.type]
* @param {RawAsset} [options.url]
* @param {Boolean} [options.visible]
* @param {Function} [options.url]
* @param {Boolean|Function} [options.visible]
* @param {String} [options.displayName]
* @param {String} [options.tooltip]
* @param {Boolean} [options.multiline]
@@ -286,7 +286,7 @@ var ccclass = checkCtorArgument(function (ctor, name) {
* }
* });
* @typescript
* property(options?: {type?: any; url?: cc.RawAsset; visible?: boolean; displayName?: string; tooltip?: string; multiline?: boolean; readonly?: boolean; min?: number; max?: number; step?: number; range?: number[]; slide?: boolean; serializable?: boolean; editorOnly?: boolean; override?: boolean; animatable?: boolean; default?: any}): Function
* property(options?: {type?: any; url?: typeof cc.RawAsset; visible?: boolean|(() => boolean); displayName?: string; tooltip?: string; multiline?: boolean; readonly?: boolean; min?: number; max?: number; step?: number; range?: number[]; slide?: boolean; serializable?: boolean; editorOnly?: boolean; override?: boolean; animatable?: boolean; default?: any}): Function
* property(_target: Object, _key: any, _desc?: any): void
*/
function property (ctorProtoOrOptions, propName, desc) {
@@ -418,7 +418,7 @@ var executeInEditMode = (CC_DEV ? createEditorDecorator : createDummyDecorator)(
* // ...
* }
* @typescript
* requireComponent(requiredComponent: {new (): cc.Component}): Function
* requireComponent(requiredComponent: typeof cc.Component): Function
*/
var requireComponent = createEditorDecorator(checkCompArgument, 'requireComponent');
+5 -5
View File
@@ -705,7 +705,7 @@ var BaseNode = cc.Class({
* // get custom test calss.
* var test = node.getComponent("Test");
* @typescript
* getComponent<T extends Component>(type: {new(): T; }): T
* getComponent<T extends Component>(type: typeof T): T
* getComponent(className: string): any
*/
getComponent (typeOrClassName) {
@@ -726,7 +726,7 @@ var BaseNode = cc.Class({
* var sprites = node.getComponents(cc.Sprite);
* var tests = node.getComponents("Test");
* @typescript
* getComponents<T extends Component>(type: {new(): T; }): T[]
* getComponents<T extends Component>(type: typeof T): T[]
* getComponents(className: string): any[]
*/
getComponents (typeOrClassName) {
@@ -747,7 +747,7 @@ var BaseNode = cc.Class({
* var sprite = node.getComponentInChildren(cc.Sprite);
* var Test = node.getComponentInChildren("Test");
* @typescript
* getComponentInChildren<T extends Component>(type: {new(): T; }): T
* getComponentInChildren<T extends Component>(type: typeof T): T
* getComponentInChildren(className: string): any
*/
getComponentInChildren (typeOrClassName) {
@@ -768,7 +768,7 @@ var BaseNode = cc.Class({
* var sprites = node.getComponentsInChildren(cc.Sprite);
* var tests = node.getComponentsInChildren("Test");
* @typescript
* getComponentsInChildren<T extends Component>(type: {new(): T; }): T[]
* getComponentsInChildren<T extends Component>(type: typeof T): T[]
* getComponentsInChildren(className: string): any[]
*/
getComponentsInChildren (typeOrClassName) {
@@ -804,7 +804,7 @@ var BaseNode = cc.Class({
* var sprite = node.addComponent(cc.Sprite);
* var test = node.addComponent("Test");
* @typescript
* addComponent<T extends Component>(type: {new(): T; }): T
* addComponent<T extends Component>(type: typeof T): T
* addComponent(className: string): any
*/
addComponent (typeOrClassName) {