Skip to content

Commit

Permalink
fix onInitialize map types
Browse files Browse the repository at this point in the history
  • Loading branch information
Geoffrey Hendrey committed Feb 20, 2024
1 parent 155dabd commit ed20e6a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion src/CliCore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,13 @@ export default class CliCore {
private currentDirectory:string;
private server; //http server to serve SVG images
replServer:repl.REPLServer;
public onInit: () => Promise<void>|void;

constructor(templateProcessor: TemplateProcessor = null) {
this.templateProcessor = templateProcessor;
this.logLevel = "info";
this.currentDirectory = process.cwd();
this.onInit = ()=>{};
}
public close(){
if(this.templateProcessor){
Expand All @@ -46,7 +48,7 @@ export default class CliCore {
this.server.close();
}
}
public onInit: () => Promise<void>;


static minimistArgs(replCmdInputStr) {
const args = parseArgsStringToArgv(replCmdInputStr);
Expand Down
2 changes: 1 addition & 1 deletion src/TemplateProcessor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ export default class TemplateProcessor {
private timerManager:TimerManager;

/** Allows caller to set a callback to propagate initialization into their framework */
public readonly onInitialize: Map<string,() => Promise<void>>;
public readonly onInitialize: Map<string,() => Promise<void>|void>;
/** Allows a caller to receive a callback after the template is evaluated, but before any temporary variables are removed*/
public postInitialize: ()=> Promise<void>;

Expand Down

0 comments on commit ed20e6a

Please sign in to comment.