Skip to content

Commit

Permalink
fix: use typescript@^4.5 for "native" document.fonts typings
Browse files Browse the repository at this point in the history
  • Loading branch information
Westbrook committed Dec 10, 2021
1 parent 2a9a5ee commit a3e4aea
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 40 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@
"stylelint-config-prettier": "^9.0.3",
"stylelint-config-standard": "^24.0.0",
"tachometer": "^0.5.10",
"typescript": "^4.4.4",
"typescript": "^4.5.3",
"yargs": "^17.2.1"
},
"resolutions": {
Expand Down
8 changes: 0 additions & 8 deletions packages/overlay/src/ActiveOverlay.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,14 +41,6 @@ export interface PositionResult {
positionTop: number;
}

declare global {
interface Document {
fonts?: {
ready: Promise<void>;
};
}
}

type OverlayStateType =
| 'idle'
| 'active'
Expand Down
8 changes: 0 additions & 8 deletions packages/tabs/src/Tabs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,6 @@ const availableArrowsByDirection = {
horizontal: ['ArrowLeft', 'ArrowRight'],
};

declare global {
interface Document {
fonts?: {
ready: Promise<void>;
};
}
}

const noSelectionStyle = 'transform: translateX(0px) scaleX(0) scaleY(0)';

/**
Expand Down
19 changes: 1 addition & 18 deletions packages/top-nav/src/TopNav.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,6 @@ import { TopNavItem } from './TopNavItem.js';

import tabStyles from '@spectrum-web-components/tabs/src/tabs.css.js';

declare global {
interface Document {
fonts?: {
ready: Promise<void>;
};
}
}

const noSelectionStyle = 'transform: translateX(0px) scaleX(0) scaleY(0)';

/**
Expand Down Expand Up @@ -194,16 +186,7 @@ export class TopNav extends SizedMixin(SpectrumElement) {
super.connectedCallback();
window.addEventListener('resize', this.updateSelectionIndicator);
if ('fonts' in document) {
(
document as unknown as {
fonts: {
addEventListener: (
name: string,
callback: () => void
) => void;
};
}
).fonts.addEventListener(
document.fonts.addEventListener(
'loadingdone',
this.updateSelectionIndicator
);
Expand Down
5 changes: 0 additions & 5 deletions projects/story-decorator/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,4 @@ declare global {
defaultReduceMotion: boolean;
};
}
interface Document {
fonts?: {
ready: Promise<void>;
};
}
}
5 changes: 5 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -23173,6 +23173,11 @@ typescript@^3.8.3, typescript@^3.9.7:
resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.9.10.tgz#70f3910ac7a51ed6bef79da7800690b19bf778b8"
integrity sha512-w6fIxVE/H1PkLKcCPsFqKE7Kv7QUwhU8qQY2MueZXWx5cPZdwFupLgKK3vntcK98BtNHZtAF4LA/yl2a7k8R6Q==

typescript@^4.5.3:
version "4.5.3"
resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.5.3.tgz#afaa858e68c7103317d89eb90c5d8906268d353c"
integrity sha512-eVYaEHALSt+s9LbvgEv4Ef+Tdq7hBiIZgii12xXJnukryt3pMgJf6aKhoCZ3FWQsu6sydEnkg11fYXLzhLBjeQ==

typescript@~4.3.2:
version "4.3.5"
resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.3.5.tgz#4d1c37cc16e893973c45a06886b7113234f119f4"
Expand Down

0 comments on commit a3e4aea

Please # to comment.