Move web_api.js and js/modules/crypto.js to TypeScript

This commit is contained in:
Scott Nonnenberg 2020-03-31 13:03:38 -07:00
parent 71436d18e2
commit 9ab54b9b83
29 changed files with 770 additions and 427 deletions

View file

@ -1,21 +1,9 @@
interface ShimmedWindow extends Window {
getExpiration: () => string;
log: {
info: (...args: any) => void;
error: (...args: any) => void;
};
}
const unknownWindow = window as unknown;
const shimmedWindow = unknownWindow as ShimmedWindow;
// @ts-ignore
const env = window.getEnvironment();
const NINETY_ONE_DAYS = 86400 * 91 * 1000;
export function hasExpired() {
const { getExpiration, log } = shimmedWindow;
const { getExpiration, log } = window;
let buildExpiration = 0;