Browse Source

feat: add utility type for inferred Type & TemplateRef

pull/3544/head
Arman Ozak 6 years ago
parent
commit
e202c944bb
  1. 1
      npm/ng-packs/packages/core/src/lib/models/index.ts
  2. 4
      npm/ng-packs/packages/core/src/lib/models/utility.ts

1
npm/ng-packs/packages/core/src/lib/models/index.ts

@ -6,3 +6,4 @@ export * from './profile';
export * from './replaceable-components';
export * from './rest';
export * from './session';
export * from './utility';

4
npm/ng-packs/packages/core/src/lib/models/utility.ts

@ -0,0 +1,4 @@
import { TemplateRef, Type } from '@angular/core';
export type InferedInstanceOf<T> = T extends Type<infer U> ? U : never;
export type InferedContextOf<T> = T extends TemplateRef<infer U> ? U : never;
Loading…
Cancel
Save