TypeScript complaining about passing a type from a custom scope to custom helper function - arktype