TLRecordAuthorizers
A map from record typeName to a TLRecordAuthorizer for that record type. Only listed types are authorized; every other record writes through untouched, so this stays off the hot path for the vast majority of writes (shape drags etc.).
Each authorizer is typed to its record — e.g. next in the comment entry is a TLComment — so renaming a field on the record makes the authorizer that reads it fail to compile, rather than silently stamp or guard the wrong field.
Presence records are never authorized (presence is per-session and ephemeral); registering the presence typeName is a construction-time error.
type TLRecordAuthorizers<R extends UnknownRecord, SessionMeta> = {
[K in R["typeName"]]?: TLRecordAuthorizer<
Extract<
R,
{
typeName: K;
}
>,
SessionMeta
>;
};Prev
TLRecordAuthorizerNext
TLSocketStatusChangeEvent