Converted to typescript.