made javascript to be typescript