MCPcopy Create free account
hub / github.com/angular/angular / TypeCtorOp

Class TypeCtorOp

packages/compiler-cli/src/ngtsc/typecheck/src/context.ts:773–791  ·  view source on GitHub ↗

* A type constructor operation which produces type constructor code for a particular directive.

Source from the content-addressed store, hash-verified

771 * A type constructor operation which produces type constructor code for a particular directive.
772 */
773class TypeCtorOp implements Op {
774 constructor(
775 readonly ref: Reference<ClassDeclaration<ts.ClassDeclaration>>,
776 readonly reflector: ReflectionHost,
777 readonly meta: TypeCtorMetadata,
778 ) {}
779
780 /**
781 * Type constructor operations are inserted immediately before the end of the directive class.
782 */
783 get splitPoint(): number {
784 return this.ref.node.end - 1;
785 }
786
787 execute(im: ImportManager, sf: ts.SourceFile, refEmitter: ReferenceEmitter): string {
788 const emitEnv = new ReferenceEmitEnvironment(im, refEmitter, sf);
789 return generateInlineTypeCtor(emitEnv, this.ref.node, this.meta);
790 }
791}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected