import TemplaterPlugin from "main" ; import { App } from "obsidian" ; import { RunningConfig } from "Templater" ; import { IGenerateObject } from "functions/IGenerateObject" ; import { ModuleName } from "functions/TpDocumentation" ; export abstract class InternalModule implements IGenerateObject { public abstract name : ModuleName ; protected static_functions : Map < string , unknown > = new Map ( ) ; protected dynamic_functions : Map < string , unknown > = new Map ( ) ; protected config : RunningConfig ; protected static_object : { [ x ] : unknown ; } ; constructor ( protected app , protected plugin ) { } getName ( ) { return this . name ; } abstract create_static_templates ( ) ; abstract create_dynamic_templates ( ) ; async init ( ) { await this . create_static_templates ( ) ; this . static_object = Object . fromEntries ( this . static_functions ) ; } async generate_object ( new_config ) { this . config = new_config ; await this . create_dynamic_templates ( ) ; return { ... this . static_object , ... Object . fromEntries ( this . dynamic_functions ) , } ; } }