From f008c50bbd843e9152ea07ba248d3e1b73f57d50 Mon Sep 17 00:00:00 2001 From: Brad Decker Date: Tue, 16 Aug 2022 10:15:29 -0500 Subject: [PATCH] Add initial Typescript Files (#15596) --- shared/constants/{permissions.js => permissions.ts} | 8 ++++---- shared/constants/{time.js => time.ts} | 0 test/setup.js | 1 + 3 files changed, 5 insertions(+), 4 deletions(-) rename shared/constants/{permissions.js => permissions.ts} (89%) rename shared/constants/{time.js => time.ts} (100%) diff --git a/shared/constants/permissions.js b/shared/constants/permissions.ts similarity index 89% rename from shared/constants/permissions.js rename to shared/constants/permissions.ts index 77df6431f..f4f961cd6 100644 --- a/shared/constants/permissions.js +++ b/shared/constants/permissions.ts @@ -1,5 +1,5 @@ export const CaveatTypes = Object.freeze({ - restrictReturnedAccounts: 'restrictReturnedAccounts', + restrictReturnedAccounts: 'restrictReturnedAccounts' as const, }); export const RestrictedMethods = Object.freeze({ @@ -11,18 +11,18 @@ export const RestrictedMethods = Object.freeze({ 'snap_getBip44Entropy_*': 'snap_getBip44Entropy_*', 'wallet_snap_*': 'wallet_snap_*', ///: END:ONLY_INCLUDE_IN -}); +} as const); ///: BEGIN:ONLY_INCLUDE_IN(flask) export const PermissionNamespaces = Object.freeze({ snap_getBip44Entropy_: 'snap_getBip44Entropy_*', wallet_snap_: 'wallet_snap_*', -}); +} as const); export const EndowmentPermissions = Object.freeze({ 'endowment:network-access': 'endowment:network-access', 'endowment:long-running': 'endowment:long-running', -}); +} as const); // Methods / permissions in external packages that we are temporarily excluding. export const ExcludedSnapPermissions = new Set([]); diff --git a/shared/constants/time.js b/shared/constants/time.ts similarity index 100% rename from shared/constants/time.js rename to shared/constants/time.ts diff --git a/test/setup.js b/test/setup.js index 57e79a557..68a0b152c 100644 --- a/test/setup.js +++ b/test/setup.js @@ -1,4 +1,5 @@ require('@babel/register'); +require('ts-node/register'); require('./helpers/setup-helper');