diff options
Diffstat (limited to 'tools/ts_library_builder/ast_util.ts')
-rw-r--r-- | tools/ts_library_builder/ast_util.ts | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/tools/ts_library_builder/ast_util.ts b/tools/ts_library_builder/ast_util.ts index f18daa398..b43145e75 100644 --- a/tools/ts_library_builder/ast_util.ts +++ b/tools/ts_library_builder/ast_util.ts @@ -73,6 +73,21 @@ export function addTypeAlias( }); } +/** Add a declaration of an interface to a node */ +export function addInterfaceDeclaration( + node: StatementedNode, + interfaceDeclaration: InterfaceDeclaration +) { + const interfaceStructure = interfaceDeclaration.getStructure(); + + return node.addInterface({ + name: interfaceStructure.name, + properties: interfaceStructure.properties, + docs: interfaceStructure.docs, + hasDeclareKeyword: true + }); +} + /** Add a declaration of a variable to a node */ export function addVariableDeclaration( node: StatementedNode, |