MCPcopy Create free account
hub / github.com/babel/babel / TSInterfaceDeclaration

Function TSInterfaceDeclaration

packages/babel-generator/src/generators/typescript.ts:505–526  ·  view source on GitHub ↗
(
  this: Printer,
  node: t.TSInterfaceDeclaration,
)

Source from the content-addressed store, hash-verified

503export { TSClassImplements as TSInterfaceHeritage };
504
505export function TSInterfaceDeclaration(
506 this: Printer,
507 node: t.TSInterfaceDeclaration,
508) {
509 const { declare, id, typeParameters, extends: extendz, body } = node;
510 if (declare) {
511 this.word("declare");
512 this.space();
513 }
514 this.word("interface");
515 this.space();
516 this.print(id);
517 this.print(typeParameters);
518 if (extendz?.length) {
519 this.space();
520 this.word("extends");
521 this.space();
522 this.printList(extendz);
523 }
524 this.space();
525 this.print(body);
526}
527
528export function TSInterfaceBody(this: Printer, node: t.TSInterfaceBody) {
529 printBraced(this, node, () =>

Callers

nothing calls this directly

Calls 4

wordMethod · 0.45
spaceMethod · 0.45
printMethod · 0.45
printListMethod · 0.45

Tested by

no test coverage detected