1
0
Sv443 1 жил өмнө
parent
commit
19b2b2993e
3 өөрчлөгдсөн 6 нэмэгдсэн , 6 устгасан
  1. 1 1
      src/constants.ts
  2. 3 3
      src/interface.ts
  3. 2 2
      src/types.ts

+ 1 - 1
src/constants.ts

@@ -37,4 +37,4 @@ export const scriptInfo = {
   name: GM.info.script.name,
   version: GM.info.script.version,
   namespace: GM.info.script.namespace,
-};
+} as const;

+ 3 - 3
src/interface.ts

@@ -96,10 +96,10 @@ export function emitInterface<
 
 function getFeaturesInterface() {
   const features = getFeatures();
-  for(const [key] of Object.entries(features)) {
-    const info = featInfo[key as keyof typeof featInfo] as FeatureInfo[keyof FeatureInfo];
+  for(const ftKey of Object.keys(features)) {
+    const info = featInfo[ftKey as keyof typeof featInfo] as FeatureInfo[keyof FeatureInfo];
     if(info && info.valueHidden) // @ts-ignore
-      features[key as keyof typeof features] = undefined;
+      features[ftKey as keyof typeof features] = undefined;
   }
   return features as FeatureConfig;
 }

+ 2 - 2
src/types.ts

@@ -89,7 +89,7 @@ export type BytmObject =
   // information from the userscript header
   & typeof scriptInfo
   // certain variables from `src/constants.ts`
-  & Pick<typeof consts, "mode" | "branch">
+  & Pick<typeof consts, "mode" | "branch" | "host" | "buildNumber" | "compressionFormat">
   // global functions exposed through the interface in `src/interface.ts`
   & InterfaceFunctions
   // others
@@ -101,7 +101,7 @@ export type BytmObject =
 declare global {
   interface Window {
     // to see the expanded type, install the VS Code extension "MylesMurphy.prettify-ts"
-    // and hover over the "BytmObject" just below:
+    // and hover over the property just below:
     BYTM: BytmObject;
   }
 }