11import { Millennium , IconsModule , definePlugin , callable } from '@steambrew/client' ;
2+ import type { MilleniumWindowContext } from './types/millennium' ;
23
34const fetchPrices = callable < [ { steam_app_id : string } ] , string > ( 'fetch_prices' ) ;
45const getApiKey = callable < [ ] , string > ( 'get_api_key' ) ;
@@ -75,7 +76,7 @@ interface Response { success: boolean; data: Record<string, Game|null>; error?:
7576
7677function detectAppId ( ) : number | null {
7778 try {
78- const p = ( window as any ) . MainWindowBrowserManager ?. m_lastLocation ?. pathname ;
79+ const p = window . MainWindowBrowserManager ?. m_lastLocation ?. pathname ;
7980 if ( p ) { const m = p . match ( / \/ a p p \/ ( \d + ) / ) ; if ( m ) return parseInt ( m [ 1 ] , 10 ) ; }
8081 } catch { }
8182 return null ;
@@ -253,7 +254,7 @@ function Settings() {
253254 R . createElement ( 'div' , { style : { marginBottom : 16 } } ,
254255 R . createElement ( 'label' , { style : { fontSize : 12 , fontWeight : 600 , display : 'block' , marginBottom : 6 } } , 'GG.deals API Key' ) ,
255256 R . createElement ( 'input' , {
256- type : 'password' , value : key , onChange : ( e : any ) => setKey ( e . target . value ) ,
257+ type : 'password' , value : key , onChange : ( e :{ target : { value : string } } ) => setKey ( e . target . value ) ,
257258 placeholder : 'Paste your API key here...' ,
258259 style : { width : '100%' , padding : '8px 12px' , fontSize : 13 , background : 'rgba(0,0,0,0.3)' , border : '1px solid rgba(255,255,255,0.1)' , borderRadius : 4 , color : '#fff' , outline : 'none' , boxSizing : 'border-box' as const } ,
259260 } ) ,
@@ -278,7 +279,7 @@ function Settings() {
278279
279280export default definePlugin ( ( ) => {
280281 checkKey ( ) ;
281- Millennium . AddWindowCreateHook ?.( ( ctx : any ) => {
282+ Millennium . AddWindowCreateHook ?.( ( ctx : MilleniumWindowContext ) => {
282283 if ( ! ctx ?. m_strName ?. startsWith ( 'SP ' ) ) return ;
283284 const doc = ctx . m_popup ?. document ;
284285 if ( ! doc ?. body ) return ;
@@ -289,6 +290,4 @@ export default definePlugin(() => {
289290 icon : window . SP_REACT . createElement ( IconsModule . Settings , null ) ,
290291 content : window . SP_REACT . createElement ( Settings , null ) ,
291292 } ;
292- } ) ;
293-
294- declare global { interface Window { SP_REACT : any ; MainWindowBrowserManager : any ; } }
293+ } ) ;
0 commit comments