From dc7ca55f0d82c8e9fd3a142011ccc5246eaf8695 Mon Sep 17 00:00:00 2001 From: Jimmy Date: Sat, 28 Oct 2023 23:07:54 +0800 Subject: [PATCH] fix: `CherryEngine` type declaration close #628 --- src/index.engine.core.js | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/index.engine.core.js b/src/index.engine.core.js index 1c289c821..070fb5ede 100644 --- a/src/index.engine.core.js +++ b/src/index.engine.core.js @@ -38,7 +38,6 @@ class CherryEngine extends CherryStatic { }; /** - * * @param {any} options */ constructor(options) { @@ -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) => Engine)} + */ +const CherryEngineExport = CherryEngine; + +export default CherryEngineExport;