@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
|
|
835
|
-
*
|
|
836
|
-
*
|
|
837
|
-
*
|
|
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("
|
|
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
|
-
//
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
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,
|
|
@@ -17,7 +17,10 @@ function resolvePlatform(): any {
|
|
|
17
17
|
return cached ?? undefined;
|
|
18
18
|
}
|
|
19
19
|
|
|
20
|
-
|
|
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;
|