Initial commit
This commit is contained in:
43
code/templates/class-template.js
Normal file
43
code/templates/class-template.js
Normal file
@@ -0,0 +1,43 @@
|
||||
/**
|
||||
* Class Template
|
||||
*
|
||||
* @class ClassName
|
||||
* @description Description of what this class does
|
||||
*/
|
||||
export class ClassName {
|
||||
/**
|
||||
* Create a new instance
|
||||
* @param {type} param - Description
|
||||
*/
|
||||
constructor(param) {
|
||||
this.param = param;
|
||||
// TODO: Initialize properties
|
||||
}
|
||||
|
||||
/**
|
||||
* Method description
|
||||
* @param {type} arg - Description
|
||||
* @returns {type} Description
|
||||
*/
|
||||
methodName(arg) {
|
||||
// TODO: Implement method logic
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Static method example
|
||||
* @param {type} arg - Description
|
||||
* @returns {type} Description
|
||||
*/
|
||||
static staticMethod(arg) {
|
||||
// TODO: Implement static method
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
// Alternative export:
|
||||
// export default ClassName;
|
||||
|
||||
// Usage example:
|
||||
// import { ClassName } from './class-template.js';
|
||||
// const instance = new ClassName(param);
|
||||
16
code/templates/function-template.js
Normal file
16
code/templates/function-template.js
Normal file
@@ -0,0 +1,16 @@
|
||||
/**
|
||||
* Function Template
|
||||
*
|
||||
* @param {type} paramName - Description
|
||||
* @returns {type} Description
|
||||
*/
|
||||
export function functionName(paramName) {
|
||||
// TODO: Implement function logic
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
// Alternative export styles:
|
||||
// export default functionName; // Default export
|
||||
// export { functionName }; // Named export
|
||||
// export { functionName as myFunction }; // Renamed export
|
||||
51
code/templates/module-template.js
Normal file
51
code/templates/module-template.js
Normal file
@@ -0,0 +1,51 @@
|
||||
/**
|
||||
* Module Template
|
||||
*
|
||||
* Example of a utility module with multiple exports
|
||||
*/
|
||||
|
||||
/**
|
||||
* Function one
|
||||
* @param {type} param - Description
|
||||
* @returns {type} Description
|
||||
*/
|
||||
export function functionOne(param) {
|
||||
// Implementation
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Function two
|
||||
* @param {type} param - Description
|
||||
* @returns {type} Description
|
||||
*/
|
||||
export function functionTwo(param) {
|
||||
// Implementation
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Constant export
|
||||
*/
|
||||
export const CONSTANT_VALUE = "value";
|
||||
|
||||
/**
|
||||
* Object export
|
||||
*/
|
||||
export const config = {
|
||||
option1: true,
|
||||
option2: "value",
|
||||
};
|
||||
|
||||
// Default export (optional)
|
||||
export default {
|
||||
functionOne,
|
||||
functionTwo,
|
||||
CONSTANT_VALUE,
|
||||
config,
|
||||
};
|
||||
|
||||
// Usage examples:
|
||||
// import { functionOne, functionTwo } from './module-template.js';
|
||||
// import utils from './module-template.js'; // Default import
|
||||
// import * as utils from './module-template.js'; // Namespace import
|
||||
Reference in New Issue
Block a user