Verbatim from Tesla.com:
If the battery catches fire, is exposed to high heat, or is generating heat or gases, use large amounts of water to cool the battery. It can take between approximately 3,000-8,000 gallons (11,356-30,283 liters) of water,* applied directly to the battery, to fully extinguish and cool down a battery fire; always establish or request additional water supply early. If water is not immediately available, use CO2, dry chemicals, or another typical fire-extinguishing agent to fight the fire until water is available.
NOTE: Tesla does not recommend the use of foam on electric vehicles.
Apply water directly to the battery. If safety permits, lift or tilt the vehicle for more direct access to the battery (see chapter 2). Water may be applied onto the pack from a safe distance ONLY if a natural opening (such as a vent or opening from a collision) already exists. Do not open the battery for the purpose of cooling it.
Tesla does not recommend placing the vehicle in a large tank of water.
Sourced from: https://www.tesla.com/sites/default/files/downloads/2021_Model_S_Emergency_Response_Guide_en.pdf
* An estimate of 8000 gallons is wildly optimistic. Most reports in the news state that at least twice that much was used, sometimes as much as 35,000 gallons.
Interesting.