This is my class:
class CONSTANT {
static readonly PATH = new class {
/** private visibility because these relative paths don't make sense for direct access, they're only useful to path class
*
* @type {{AFTER_EFFECTS_TEMPLATE_BINARY_VERSION: module:fs.PathLike; AFTER_EFFECTS_TEMPLATE_XML_VERSION: module:fs.PathLike; RELATIVE_PATH_TO_AFTER_EFFECTS: module:fs.PathLike; OUTPUT_DIRECTORY_NAME: module:fs.PathLike; INPUT_DIRECTORY_NAME: module:fs.PathLike; ASSETS_DIRECTORY_NAME: module:fs.PathLike}}
*/
private readonly RELATIVE = new class {
readonly AFTER_EFFECTS_TEMPLATE_FILENAME: fs.PathLike = '\\video-template.aep';
readonly AFTER_EFFECTS_TEMPLATE_BINARY_VERSION: fs.PathLike = `\\assets\\aep-template\\src${this.AFTER_EFFECTS_TEMPLATE_FILENAME}`;
readonly AFTER_EFFECTS_TEMPLATE_XML_VERSION: fs.PathLike = '\\assets\\aep-template\\intermediates\\video-template.aepx';
readonly RELATIVE_PATH_TO_AFTER_EFFECTS: fs.PathLike = '\\Adobe\\Adobe After Effects CC 2018\\Support Files\\AfterFX.exe';
readonly OUTPUT_DIRECTORY_NAME: fs.PathLike = '\\output';
readonly INPUT_DIRECTORY_NAME: fs.PathLike = '\\input';
readonly ASSETS_DIRECTORY_NAME: fs.PathLike = '\\assets';
};
}
}
I want to type the RELATIVE
anonymous class to only have properties of the type fs.PathLike
. Is this possible without mentioning type on each property?
PS: The reason I've this and not an object literal is because I can combine properties of the class among themselves see: https://stackoverflow.com/a/50929798/1311745