Skip to content

Commit

Permalink
Remove commented global augmentation code.
Browse files Browse the repository at this point in the history
Global augmentation in TypeScript is still troublesome. In particular, it's difficult to exclude (and therefore difficult to avoid compile errors) if it's available in a project or `node_modules`, even if not imported directly:

- microsoft/TypeScript#37053
- #148
  • Loading branch information
lgarron committed Jan 5, 2023
1 parent 49dd676 commit 34cbb32
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,4 @@ import { PromisePolyfillConstructor } from "../../promise/polyfill";

import "./overwrite-globals";

// declare global {
// // rome-ignore lint/suspicious/noShadowRestrictedNames: This is where we export `Promise`.
// var Promise: PromiseConstructor;
// }
(window as any).Promise = PromisePolyfillConstructor;
8 changes: 0 additions & 8 deletions src/clipboard-polyfill/entries/es5/overwrite-globals.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,6 @@ import { readText, writeText } from "../../implementations/text";
import { read, write } from "../../implementations/blob";
import { ClipboardItemPolyfill } from "../../ClipboardItem/ClipboardItemPolyfill";

// declare global {
// // const ClipboardItem: ClipboardItemConstructor;
// interface Window {
// ClipboardItem: ClipboardItemConstructor;
// }
// interface Clipboard extends ClipboardInterface {}
// }

// Create the `navigator.clipboard` object if it doesn't exist.
if (!navigator.clipboard) {
(navigator as any).clipboard = {};
Expand Down

0 comments on commit 34cbb32

Please sign in to comment.