Skip to content

Commit

Permalink
fix: CherryEngine type declaration (#630)
Browse files Browse the repository at this point in the history
close #628
  • Loading branch information
RSS1102 authored Oct 30, 2023
1 parent 5d3e02e commit 9d93b32
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions src/index.engine.core.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ class CherryEngine extends CherryStatic {
};

/**
*
* @param {any} options
*/
constructor(options) {
Expand All @@ -51,14 +50,16 @@ class CherryEngine extends CherryStatic {
opts.engine.global.urlProcessor = urlProcessorProxy(opts.engine.global.urlProcessor);
}

/** @type {import('./Engine').default}*/
// @ts-ignore hack Cherry Instance
this.engine = new Engine(opts, { options: opts });
// @ts-ignore
return this.engine;
return new Engine(opts, { options: opts });
}
}

export { SyntaxHookBase, MenuHookBase };

export default CherryEngine;
/**
* @typedef {typeof CherryStatic & (new (options: Partial<import('~types/cherry').CherryOptions>) => Engine)}
*/
const CherryEngineExport = CherryEngine;

export default CherryEngineExport;

0 comments on commit 9d93b32

Please sign in to comment.