diff --git a/packages/core/src/core.ts b/packages/core/src/core.ts index ac379e2bb9..e49543bd34 100644 --- a/packages/core/src/core.ts +++ b/packages/core/src/core.ts @@ -29,7 +29,7 @@ export * from './platform_core_providers'; export {TRANSLATIONS, TRANSLATIONS_FORMAT, LOCALE_ID, MissingTranslationStrategy} from './i18n/tokens'; export {ApplicationModule} from './application_module'; export {wtfCreateScope, wtfLeave, wtfStartTimeRange, wtfEndTimeRange, WtfScopeFn} from './profile/profile'; -export {Type} from './interface/type'; +export {AbstractType, Type} from './interface/type'; export {EventEmitter} from './event_emitter'; export {ErrorHandler} from './error_handler'; export * from './core_private_export'; diff --git a/packages/core/src/interface/type.ts b/packages/core/src/interface/type.ts index f99a53df75..faec83d8a1 100644 --- a/packages/core/src/interface/type.ts +++ b/packages/core/src/interface/type.ts @@ -22,6 +22,16 @@ export function isType(v: any): v is Type { return typeof v === 'function'; } +/** + * @description + * + * Represents an abstract class `T`, if applied to a concrete class it would stop being + * instantiatable. + * + * @publicApi + */ +export interface AbstractType extends Function { prototype: T; } + export interface Type extends Function { new (...args: any[]): T; } export type Mutable = { diff --git a/tools/public_api_guard/core/core.d.ts b/tools/public_api_guard/core/core.d.ts index 905f9020d5..8e4d861e77 100644 --- a/tools/public_api_guard/core/core.d.ts +++ b/tools/public_api_guard/core/core.d.ts @@ -1,3 +1,7 @@ +export interface AbstractType extends Function { + prototype: T; +} + export interface AfterContentChecked { ngAfterContentChecked(): void; }