import type { AuthKey } from "../crypto/AuthKey" ; import type { EntityLike } from "../define" ; import { Api } from "../tl" ; export abstract class Session { param toInstance { Session | null } returns { Session } param dcId { number } param serverAddress { string } param port { number } abstract setDC ( dcId , serverAddress , port ) ; /**
     * Returns the currently-used data center ID.
     */ abstract get dcId ( ) : number ; /**
     * Returns the server address where the library should connect to.
     */ abstract get serverAddress ( ) : string ; /**
     * Returns the port to which the library should connect to.
     */ abstract get port ( ) : number ; /**
     * Returns an ``AuthKey`` instance associated with the saved
     * data center, or `undefined` if a new one should be generated.
     */ abstract get authKey ( ) : AuthKey | undefined ; param value abstract set authKey ( value ) ; /**
     * Called before using the session
     */ abstract load ( ) ; /**
     *  sets auth key for a dc
     */ abstract setAuthKey ( authKey ? , dcId ? ) ; /**
     *  gets auth key for a dc
     */ abstract getAuthKey ( dcId ? ) ; /**
     * Turns the given key into an ``InputPeer`` (e.g. ``InputPeerUser``).
     * The library uses this method whenever an ``InputPeer`` is needed
     * to suit several purposes (e.g. user only provided its ID or wishes
     * to use a cached username to avoid extra RPC).
     */ abstract getInputEntity ( key ) ; /**
     * Returns an ID of the takeout process initialized for this session,
     * or `None` if there's no were any unfinished takeout requests.
     */ param value param entityId param entityId param state /**
     * Called on client disconnection. Should be used to
     * free any used resources. Can be left empty if none.
     */ abstract close ( ) ; /**
     * called whenever important properties change. It should
     * make persist the relevant session information to disk.
     */ abstract save ( ) ; /**
     * Called upon client.log_out(). Should delete the stored
     * information from disk since it's not valid anymore.
     */ abstract delete ( ) ; param tlo abstract processEntities ( tlo ) ; }