From 24a7b61942a122d8f5f8886dcd03a2e9e9e8ad59 Mon Sep 17 00:00:00 2001 From: Dimas Lanjaka Date: Thu, 10 Aug 2023 17:04:43 +0700 Subject: [PATCH] feat: define global variable hexo (#5242) useful for plugin written in typescript or let IDE detecting it --- lib/hexo/index.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lib/hexo/index.ts b/lib/hexo/index.ts index e8c06b83d4..21c14183fb 100644 --- a/lib/hexo/index.ts +++ b/lib/hexo/index.ts @@ -598,4 +598,11 @@ Hexo.prototype.core_dir = Hexo.core_dir; Hexo.version = version; Hexo.prototype.version = Hexo.version; +// define global variable +// this useful for plugin written in typescript +declare global { + // eslint-disable-next-line one-var + const hexo: Hexo; +} + export = Hexo;