# Disable binary data APIs (`ts-compat/no-binary`) 💼 This rule is enabled in the ✅ `recommended` config. `ArrayBuffer`, `DataView`, the typed arrays, `Blob`, `File`, `FormData` and `HTMLInputElement.files` are the APIs that move bytes instead of text. Every one of them is IE 10 or later, so IE 9 and below have none, and none of them can be polyfilled: the buffers are engine builtins, while `Blob`, `File` and `FileList` values are handed out by the host, so a shim cannot produce a value a native API accepts. Keeping the payload in a plain `string` avoids all of them, which is why this rule is enabled in `recommended` without a browserslist gate. ## Rule Details This rule bans the global names themselves, so a construction, a static call such as `ArrayBuffer.isView`, an `instanceof` operand and a name read as a value are all reported. Type annotations and instance members are not checked, and a local definition of one of these names is not reported. `files` is reported only when it is read on an `HTMLInputElement`. Examples of **incorrect** code for this rule: ```ts var blob = new Blob(["abc"], { type: "text/plain" }); var buffer = new ArrayBuffer(8); var input: HTMLInputElement; input.files; ``` Examples of **correct** code for this rule: ```ts var text = "abc"; var input: HTMLInputElement; input.value; ``` ## When Not To Use It * The code has to upload or read files, and the oldest target is IE 10 or newer. * Binary data is already handled behind a wrapper and no call site touches these names. ## Further Reading * [MDN ArrayBuffer](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer) * [MDN Blob](https://developer.mozilla.org/en-US/docs/Web/API/Blob) * [ts-compat/no-atomics](no-atomics.md)