@spicetify/kit 0.2.0 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -831,12 +831,12 @@ declare namespace Spicetify {
831
831
  };
832
832
 
833
833
  /**
834
- * The client's internal platform APIs. Typed from the generated
835
- * PlatformAutoGen surface, exposing both the property form the client uses
836
- * (`Platform.LibraryAPI`) and the generated `getLibraryAPI()` methods:
837
- * every `getFooAPI(): R` yields a `FooAPI: R` property too.
834
+ * The client's internal platform APIs, typed from platform.d.ts, the
835
+ * committed snapshot scripts/platform-types.ts regenerates per Spotify
836
+ * build. The snapshot's root is the property form the client uses
837
+ * (`Platform.LibraryAPI`).
838
838
  */
839
- type PlatformAutoGen = import("/hooks/PlatformAutoGen").PlatformAutoGen;
839
+ type PlatformAutoGen = import("./platform").Platform;
840
840
  // One level of member names per API — enough to autocomplete which methods an
841
841
  // API exposes (Platform.LibraryAPI.getContents…), with every value left `any`.
842
842
  // The generated method signatures are unreliable (arg counts and nullability
@@ -848,22 +848,10 @@ declare namespace Spicetify {
848
848
  : T extends object
849
849
  ? { [M in keyof T]: any }
850
850
  : T;
851
- // Both forms the client offers: the getFooAPI() methods (permissive args,
852
- // shaped return) and each getFooAPI(): R also as a FooAPI: R property (the
853
- // form the client uses). The Record<string, any> tail keeps unknown keys open.
854
- type PlatformApis =
855
- & {
856
- [K in keyof PlatformAutoGen]: PlatformAutoGen[K] extends (...args: any[]) => infer R
857
- ? (...args: any[]) => Shape<R>
858
- : PlatformAutoGen[K];
859
- }
860
- & {
861
- [K in keyof PlatformAutoGen as K extends `get${infer Name}` ? Name : never]: PlatformAutoGen[K] extends (
862
- ...args: any[]
863
- ) => infer R
864
- ? Shape<R>
865
- : never;
866
- };
851
+ // The Record<string, any> tail keeps unknown keys open.
852
+ type PlatformApis = {
853
+ [K in keyof PlatformAutoGen]: Shape<PlatformAutoGen[K]>;
854
+ };
867
855
  const Platform: PlatformApis & Record<string, any>;
868
856
  /**
869
857
  * Queue object contains list of queuing tracks,
@@ -3,7 +3,7 @@
3
3
  "kind": "lib",
4
4
  "hidden": true,
5
5
  "preview": "./assets/PREVIEW.png",
6
- "version": "1.10.0",
6
+ "version": "1.10.1",
7
7
  "compat": ["0.3.0"],
8
8
  "authors": ["spicetify", "Delusoire"],
9
9
  "description": "The standard library",
@@ -17,7 +17,10 @@ function resolvePlatform(): any {
17
17
  return cached ?? undefined;
18
18
  }
19
19
 
20
- export const Platform: any = new Proxy(
20
+ // Typed as the generated Platform surface; the Proxy target is an empty
21
+ // shell whose members only exist at get time, so the assertion is the
22
+ // honest spelling.
23
+ export const Platform = new Proxy(
21
24
  {},
22
25
  {
23
26
  get: (_, key) => {
@@ -45,4 +48,4 @@ export const Platform: any = new Proxy(
45
48
  return false;
46
49
  },
47
50
  },
48
- );
51
+ ) as typeof Spicetify.Platform;