Last active
December 31, 2015 18:19
-
-
Save codeBelt/8025801 to your computer and use it in GitHub Desktop.
StructureTS PhpStorm/WebStorm Templates
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ///<reference path='replace/path/${Extends}.ts'/> | |
| module ${Namespace} { | |
| import ${Extends} = StructureTS.${Extends}; | |
| /** | |
| * YUIDoc_comment | |
| * | |
| * @class ${NAME} | |
| * @extends ${Extends} | |
| * @module ${Namespace} | |
| * @constructor | |
| **/ | |
| export class ${NAME} extends ${Extends} { | |
| constructor() { | |
| super(); | |
| } | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * YUIDoc_comment | |
| * | |
| * @method $name$ | |
| * @$accessType$ | |
| */ | |
| $accessType$ $name$($param$):void { | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * YUIDoc_comment | |
| * | |
| * @property $name$ | |
| * @type {$type$} | |
| * @$accessType$ | |
| */ | |
| $accessType$ $name$:$type$ = null; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ///<reference path='com/codebelt/structurets/model/ValueObject.ts'/> | |
| ///<reference path='com/codebelt/structurets/interface/IValueObject.ts'/> | |
| module ${Namespace} { | |
| import ValueObject = StructureTS.ValueObject; | |
| import IValueObject = StructureTS.IValueObject; | |
| /** | |
| * YUIDoc_comment | |
| * | |
| * @class ${NAME} | |
| * @param [data] {any} Provide a way to update the value object upon initialization. | |
| * @extends ValueObject | |
| * @module ${Namespace} | |
| * @constructor | |
| **/ | |
| export class ${NAME} extends ValueObject { | |
| constructor(data:any = null) { | |
| super(); | |
| if (data) { | |
| this.update(data); | |
| } | |
| } | |
| /** | |
| * @overridden ValueObject.update | |
| */ | |
| public update(data:any):void { | |
| } | |
| /** | |
| * @overridden ValueObject.copy | |
| */ | |
| public copy():${NAME} { | |
| var data:IValueObject = super.copy(); | |
| return new ${NAME}(data); | |
| } | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ///<reference path='replace/path/${Extends}.ts'/> | |
| module ${Namespace} { | |
| import ${Extends} = StructureTS.${Extends}; | |
| /** | |
| * YUIDoc_comment | |
| * | |
| * @class ${NAME} | |
| * @extends ${Extends} | |
| * @module ${Namespace} | |
| * @constructor | |
| **/ | |
| export class ${NAME} extends ${Extends} { | |
| constructor() { | |
| super(); | |
| } | |
| /** | |
| * @overridden ${Extends}.createChildren | |
| */ | |
| public createChildren():void { | |
| super.createChildren(); | |
| // Create and add your child objects to this parent class. | |
| } | |
| /** | |
| * @overridden ${Extends}.layoutChildren | |
| */ | |
| public layoutChildren():void { | |
| // Layout or update the child objects in this parent class. | |
| } | |
| /** | |
| * @overridden ${Extends}.enable | |
| */ | |
| public enable():void { | |
| if (this.isEnabled === true) return; | |
| // Enable the child objects and add any event listeners. | |
| super.enable(); | |
| } | |
| /** | |
| * @overridden ${Extends}.disable | |
| */ | |
| public disable():void { | |
| if (this.isEnabled === false) return; | |
| // Disable the child objects and remove any event listeners. | |
| super.disable(); | |
| } | |
| /** | |
| * @overridden ${Extends}.destroy | |
| */ | |
| public destroy():void { | |
| super.destroy(); | |
| // Destroy the child objects and references in this parent class to prevent memory leaks. | |
| } | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ///<reference path='$path$'/> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment