Property does not exist on type JQueryStatic
but I would prefer making a $._data a valid method call.
The types intentionally don't allow internal API calls as the jquery team doesn't want you to use these methods. If you want to write unsafe code like this you are free to use $ as any
as you have figured out.
If you want such unsafe access to be done safely you can extend the JQuery
interface with new functionality
interface JQuery {
_data: any; // Replace with your types
}