From b06e8516e0837f25e8ef09022b04140c138ab3e7 Mon Sep 17 00:00:00 2001 From: Convly Date: Mon, 13 Jun 2022 10:00:03 +0200 Subject: [PATCH] Update Strapi definition --- packages/core/strapi/lib/types/strapi.d.ts | 82 ++++++++++++++++++++++ 1 file changed, 82 insertions(+) diff --git a/packages/core/strapi/lib/types/strapi.d.ts b/packages/core/strapi/lib/types/strapi.d.ts index 9d0843b2f1..ab1022cc74 100644 --- a/packages/core/strapi/lib/types/strapi.d.ts +++ b/packages/core/strapi/lib/types/strapi.d.ts @@ -282,6 +282,62 @@ export interface Strapi { * Binds database queries for a specific model based on its unique identifier. */ query(uid: string): any; + + /** + * Main Strapi container holding all the registries and providers (config, content-types, services, policies, etc...) + */ + container: any; + + /** + * References to all the directories handled by Strapi + */ + dirs: StrapiDirectories; + + /** + * Internal flag used to check if the application has been loaded + */ + isLoaded: boolean; + + /** + * Fully reload the application + */ + reload(): void; + + /** + * Holds a reference to the Koa application and the http server used by Strapi + */ + server: any; + + /** + * Strapi util used to manage application files + */ + fs: any; + + /** + * Event hub used to send and receive events from anywhere in the application + */ + eventHub: any; + + /** + * Internal util used to log stats and messages on application Startup + */ + startupLogger: any; + + /** + * Strapi logger used to send errors, warning or information messages + */ + log: any; + + + /** + * Used to manage cron within Strapi + */ + cron: any; + + /** + * Telemetry util used to collect anonymous data on the application usage + */ + telemetry: any; } export interface Lifecycles { @@ -289,3 +345,29 @@ export interface Lifecycles { BOOTSTRAP: 'bootstrap'; DESTROY: 'destroy'; } + +export interface StrapiDirectories { + static: { + public: string; + }; + app: { + root: string; + src: string; + api: string; + components: string; + extensions: string; + policies: string; + middlewares: string; + config: string; + }; + dist: { + root: string; + src: string; + api: string; + components: string; + extensions: string; + policies: string; + middlewares: string; + config: string; + }; +} \ No newline at end of file