Preparing search index...
The search index is not available
Documentation - v0.19.5
Documentation
@mtcute/bun
index
ITelegramClient
Interface ITelegramClient
interface
ITelegramClient
{
appConfig
:
PublicPart
<
AppConfigManager
>
;
log
:
Logger
;
onConnectionState
:
Emitter
<
ConnectionState
>
;
onError
:
Emitter
<
Error
>
;
onRawUpdate
:
Emitter
<
RawUpdateInfo
>
;
onServerUpdate
:
Emitter
<
TypeUpdates
>
;
platform
:
ICorePlatform
;
stopSignal
:
AbortSignal
;
storage
:
PublicPart
<
TelegramStorageManager
>
;
timers
:
Pick
<
TimersManager
,
"cancel"
|
"create"
|
"exists"
>
;
call
<
T
extends
RpcMethod
>
(
message
:
MustEqual
<
T
,
RpcMethod
>
,
params
?:
RpcCallOptions
,
)
:
Promise
<
RpcCallReturn
[
T
[
"_"
]
]
>
;
changePrimaryDc
(
newDc
:
number
)
:
Promise
<
void
>
;
close
()
:
Promise
<
void
>
;
computeNewPasswordHash
(
algo
:
TypePasswordKdfAlgo
,
password
:
string
,
)
:
Promise
<
Uint8Array
>
;
computeSrpParams
(
request
:
RawPassword
,
password
:
string
,
)
:
Promise
<
RawInputCheckPasswordSRP
>
;
connect
()
:
Promise
<
void
>
;
exportSession
()
:
Promise
<
string
>
;
getApiCredentials
()
:
Promise
<
{
hash
:
string
;
id
:
number
}
>
;
getMtprotoMessageId
()
:
Promise
<
Long
>
;
getPoolSize
(
kind
:
ConnectionKind
,
dcId
?:
number
)
:
Promise
<
number
>
;
getPrimaryDcId
()
:
Promise
<
number
>
;
handleClientUpdate
(
updates
:
TypeUpdates
,
noDispatch
?:
boolean
)
:
void
;
importSession
(
session
:
string
|
InputStringSessionData
,
force
?:
boolean
,
)
:
Promise
<
void
>
;
notifyChannelClosed
(
channelId
:
number
)
:
Promise
<
boolean
>
;
notifyChannelOpened
(
channelId
:
number
,
pts
?:
number
)
:
Promise
<
boolean
>
;
notifyLoggedIn
(
auth
:
RawUser
|
TypeAuthorization
)
:
Promise
<
RawUser
>
;
notifyLoggedOut
()
:
Promise
<
void
>
;
prepare
()
:
Promise
<
void
>
;
recreateDc
(
dcId
:
number
)
:
Promise
<
void
>
;
startUpdatesLoop
()
:
Promise
<
void
>
;
stopUpdatesLoop
()
:
Promise
<
void
>
;
}
Index
Properties
app
Config
log
on
Connection
State
on
Error
on
Raw
Update
on
Server
Update
platform
stop
Signal
storage
timers
Methods
call
change
Primary
Dc
close
compute
New
Password
Hash
compute
Srp
Params
connect
export
Session
get
Api
Credentials
get
Mtproto
Message
Id
get
Pool
Size
get
Primary
Dc
Id
handle
Client
Update
import
Session
notify
Channel
Closed
notify
Channel
Opened
notify
Logged
In
notify
Logged
Out
prepare
recreate
Dc
start
Updates
Loop
stop
Updates
Loop
Properties
Readonly
app
Config
appConfig
:
PublicPart
<
AppConfigManager
>
Readonly
log
log
:
Logger
on
Connection
State
onConnectionState
:
Emitter
<
ConnectionState
>
on
Error
onError
:
Emitter
<
Error
>
on
Raw
Update
onRawUpdate
:
Emitter
<
RawUpdateInfo
>
on
Server
Update
onServerUpdate
:
Emitter
<
TypeUpdates
>
Readonly
platform
platform
:
ICorePlatform
Readonly
stop
Signal
stopSignal
:
AbortSignal
Readonly
storage
storage
:
PublicPart
<
TelegramStorageManager
>
Readonly
timers
timers
:
Pick
<
TimersManager
,
"cancel"
|
"create"
|
"exists"
>
Methods
call
call
<
T
extends
RpcMethod
>
(
message
:
MustEqual
<
T
,
RpcMethod
>
,
params
?:
RpcCallOptions
,
)
:
Promise
<
RpcCallReturn
[
T
[
"_"
]
]
>
Type Parameters
T
extends
RpcMethod
Parameters
message
:
MustEqual
<
T
,
RpcMethod
>
Optional
params
:
RpcCallOptions
Returns
Promise
<
RpcCallReturn
[
T
[
"_"
]
]
>
change
Primary
Dc
changePrimaryDc
(
newDc
:
number
)
:
Promise
<
void
>
Parameters
newDc
:
number
Returns
Promise
<
void
>
close
close
()
:
Promise
<
void
>
Returns
Promise
<
void
>
compute
New
Password
Hash
computeNewPasswordHash
(
algo
:
TypePasswordKdfAlgo
,
password
:
string
,
)
:
Promise
<
Uint8Array
>
Parameters
algo
:
TypePasswordKdfAlgo
password
:
string
Returns
Promise
<
Uint8Array
>
compute
Srp
Params
computeSrpParams
(
request
:
RawPassword
,
password
:
string
,
)
:
Promise
<
RawInputCheckPasswordSRP
>
Parameters
request
:
RawPassword
password
:
string
Returns
Promise
<
RawInputCheckPasswordSRP
>
connect
connect
()
:
Promise
<
void
>
Returns
Promise
<
void
>
export
Session
exportSession
()
:
Promise
<
string
>
Returns
Promise
<
string
>
get
Api
Credentials
getApiCredentials
()
:
Promise
<
{
hash
:
string
;
id
:
number
}
>
Returns
Promise
<
{
hash
:
string
;
id
:
number
}
>
get
Mtproto
Message
Id
getMtprotoMessageId
()
:
Promise
<
Long
>
Returns
Promise
<
Long
>
get
Pool
Size
getPoolSize
(
kind
:
ConnectionKind
,
dcId
?:
number
)
:
Promise
<
number
>
Parameters
kind
:
ConnectionKind
Optional
dcId
:
number
Returns
Promise
<
number
>
get
Primary
Dc
Id
getPrimaryDcId
()
:
Promise
<
number
>
Returns
Promise
<
number
>
handle
Client
Update
handleClientUpdate
(
updates
:
TypeUpdates
,
noDispatch
?:
boolean
)
:
void
Parameters
updates
:
TypeUpdates
Optional
noDispatch
:
boolean
Returns
void
import
Session
importSession
(
session
:
string
|
InputStringSessionData
,
force
?:
boolean
,
)
:
Promise
<
void
>
Parameters
session
:
string
|
InputStringSessionData
Optional
force
:
boolean
Returns
Promise
<
void
>
notify
Channel
Closed
notifyChannelClosed
(
channelId
:
number
)
:
Promise
<
boolean
>
Parameters
channelId
:
number
Returns
Promise
<
boolean
>
notify
Channel
Opened
notifyChannelOpened
(
channelId
:
number
,
pts
?:
number
)
:
Promise
<
boolean
>
Parameters
channelId
:
number
Optional
pts
:
number
Returns
Promise
<
boolean
>
notify
Logged
In
notifyLoggedIn
(
auth
:
RawUser
|
TypeAuthorization
)
:
Promise
<
RawUser
>
Parameters
auth
:
RawUser
|
TypeAuthorization
Returns
Promise
<
RawUser
>
notify
Logged
Out
notifyLoggedOut
()
:
Promise
<
void
>
Returns
Promise
<
void
>
prepare
prepare
()
:
Promise
<
void
>
Returns
Promise
<
void
>
recreate
Dc
recreateDc
(
dcId
:
number
)
:
Promise
<
void
>
Parameters
dcId
:
number
Returns
Promise
<
void
>
start
Updates
Loop
startUpdatesLoop
()
:
Promise
<
void
>
Returns
Promise
<
void
>
stop
Updates
Loop
stopUpdatesLoop
()
:
Promise
<
void
>
Returns
Promise
<
void
>
Settings
Member Visibility
Protected
Inherited
Theme
OS
Light
Dark
On This Page
Properties
app
Config
log
on
Connection
State
on
Error
on
Raw
Update
on
Server
Update
platform
stop
Signal
storage
timers
Methods
call
change
Primary
Dc
close
compute
New
Password
Hash
compute
Srp
Params
connect
export
Session
get
Api
Credentials
get
Mtproto
Message
Id
get
Pool
Size
get
Primary
Dc
Id
handle
Client
Update
import
Session
notify
Channel
Closed
notify
Channel
Opened
notify
Logged
In
notify
Logged
Out
prepare
recreate
Dc
start
Updates
Loop
stop
Updates
Loop
Documentation - v0.19.5
Loading...