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

Function TSInterfaceDeclaration

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

Source from the content-addressed store, hash-verified

509export { TSClassImplements as TSInterfaceHeritage };
510
511export function TSInterfaceDeclaration(
512 this: Printer,
513 node: t.TSInterfaceDeclaration,
514) {
515 const { declare, id, typeParameters, extends: extendz, body } = node;
516 if (declare) {
517 this.word("declare");
518 this.space();
519 }
520 this.word("interface");
521 this.space();
522 this.print(id);
523 this.print(typeParameters);
524 if (extendz?.length) {
525 this.space();
526 this.word("extends");
527 this.space();
528 this.printList(extendz);
529 }
530 this.space();
531 this.print(body);
532}
533
534export function TSInterfaceBody(this: Printer, node: t.TSInterfaceBody) {
535 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