From aa228db700d46ef24a6daf0584a3c303cd19b132 Mon Sep 17 00:00:00 2001 From: Chris Thoburn Date: Fri, 25 Oct 2019 15:22:57 +0200 Subject: [PATCH] fix types --- packages/store/addon/-private/identifiers/utils/uuid-v4.ts | 2 +- packages/store/types/fastboot/index.d.ts | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) create mode 100644 packages/store/types/fastboot/index.d.ts diff --git a/packages/store/addon/-private/identifiers/utils/uuid-v4.ts b/packages/store/addon/-private/identifiers/utils/uuid-v4.ts index e9b883629b5..407fd007103 100644 --- a/packages/store/addon/-private/identifiers/utils/uuid-v4.ts +++ b/packages/store/addon/-private/identifiers/utils/uuid-v4.ts @@ -16,7 +16,7 @@ const CRYPTO = (() => { if (isFastBoot) { return { getRandomValues(buffer: Uint8Array) { - return FastBoot.require('crypto').randomFillSync(buffer); + return (FastBoot as FastBoot).require('crypto').randomFillSync(buffer); }, }; } else if (hasWindow && typeof window.crypto !== 'undefined') { diff --git a/packages/store/types/fastboot/index.d.ts b/packages/store/types/fastboot/index.d.ts new file mode 100644 index 00000000000..818a8a945a4 --- /dev/null +++ b/packages/store/types/fastboot/index.d.ts @@ -0,0 +1,4 @@ +interface FastBoot { + require(moduleName: string): any; +} +const FastBoot: undefined | FastBoot;