diff options
author | Bartek IwaĆczuk <biwanczuk@gmail.com> | 2019-03-25 05:23:24 +0100 |
---|---|---|
committer | Ryan Dahl <ry@tinyclouds.org> | 2019-03-25 00:23:24 -0400 |
commit | 5ae78eb1de378f04d0b9d54842bcb898053467d6 (patch) | |
tree | 4d0d6a97e6af1f3c3a0a70f1ebe34bdd9d32ac3e /tools/ts_library_builder/ast_util.ts | |
parent | 3cc90d9bcf4be58bf88b433ae410f42fa4ad69c7 (diff) |
Update ts_library_builder (#1920)
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, |