Typescript Nested Functions In Arduino Code