1 2 3 4 5 6 7 8 9 10 11 12 13 14
from component_name import exports state: int = 0 class Api(exports.Api): def add(self, value: int): global state print("add " + str(value)) state = state + value def get(self) -> int: global state print("get") return state