diff --git a/src/core/singletons/index.ts b/src/core/singletons/index.ts index 6999ef29c..d6628b992 100644 --- a/src/core/singletons/index.ts +++ b/src/core/singletons/index.ts @@ -64,10 +64,17 @@ const OBJECT_PROTOTYPE = Object.getPrototypeOf(Object); let singletonsInjector: Injector | null = null; /** - * Helper to get service class methods. + * Helper to get service class properties that are methods. */ type GetMethods = { - [K in keyof T]: T[K] extends (...args: unknown[]) => unknown ? K : never; + [K in keyof T]: T[K] extends (...args: unknown[]) => unknown ? K : never +}[keyof T]; + +/** + * Helper to get service class properties that are not methods. + */ +type GetNonMethods = { + [K in keyof T]: T[K] extends (...args: unknown[]) => unknown ? never : K }[keyof T]; /** @@ -76,7 +83,7 @@ type GetMethods = { * @see makeSingleton */ export type CoreSingletonProxy = - Pick> & + Pick, GetNonMethods>> & Pick & { instance: Service;