11import { FunctionsClient } from '@supabase/functions-js'
2- import { AuthChangeEvent } from '@supabase/auth-js'
2+ import { AuthChangeEvent , Subscription } from '@supabase/auth-js'
33import {
44 PostgrestClient ,
55 PostgrestFilterBuilder ,
@@ -278,7 +278,7 @@ export default class SupabaseClient<
278278 return this . realtime . removeAllChannels ( )
279279 }
280280
281- protected async _getAccessToken ( ) {
281+ protected async _getAccessToken ( ) : Promise < string | null > {
282282 if ( this . accessToken ) {
283283 return await this . accessToken ( )
284284 }
@@ -301,7 +301,7 @@ export default class SupabaseClient<
301301 } : SupabaseAuthClientOptions ,
302302 headers ?: Record < string , string > ,
303303 fetch ?: Fetch
304- ) {
304+ ) : SupabaseAuthClient {
305305 const authHeaders = {
306306 Authorization : `Bearer ${ this . supabaseKey } ` ,
307307 apikey : `${ this . supabaseKey } ` ,
@@ -324,14 +324,14 @@ export default class SupabaseClient<
324324 } )
325325 }
326326
327- protected _initRealtimeClient ( options : RealtimeClientOptions ) {
327+ protected _initRealtimeClient ( options : RealtimeClientOptions ) : RealtimeClient {
328328 return new RealtimeClient ( this . realtimeUrl . href , {
329329 ...options ,
330330 params : { ...{ apikey : this . supabaseKey } , ...options ?. params } ,
331331 } )
332332 }
333333
334- protected async _listenForAuthEvents ( ) {
334+ protected async _listenForAuthEvents ( ) : Promise < { data : { subscription : Subscription } } > {
335335 return await this . auth . onAuthStateChange ( ( event , session ) => {
336336 setTimeout (
337337 async ( ) => await this . _handleTokenChanged ( event , 'CLIENT' , session ?. access_token ) ,
0 commit comments