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

Class TypeCtorOp

packages/compiler-cli/src/ngtsc/typecheck/src/context.ts:756–774  ·  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

754 * A type constructor operation which produces type constructor code for a particular directive.
755 */
756class TypeCtorOp implements Op {
757 constructor(
758 readonly ref: Reference<ClassDeclaration<ts.ClassDeclaration>>,
759 readonly reflector: ReflectionHost,
760 readonly meta: TypeCtorMetadata,
761 ) {}
762
763 /**
764 * Type constructor operations are inserted immediately before the end of the directive class.
765 */
766 get splitPoint(): number {
767 return this.ref.node.end - 1;
768 }
769
770 execute(im: ImportManager, sf: ts.SourceFile, refEmitter: ReferenceEmitter): string {
771 const emitEnv = new ReferenceEmitEnvironment(im, refEmitter, sf);
772 return generateInlineTypeCtor(emitEnv, this.ref.node, this.meta);
773 }
774}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected