Skip to content

Latest commit

 

History

History
135 lines (75 loc) · 4 KB

README.md

File metadata and controls

135 lines (75 loc) · 4 KB

@telegram-auth/server

@telegram-auth/server

Table of contents

Classes

Interfaces

Type Aliases

Functions

Type Aliases

AuthDataMap

Ƭ AuthDataMap: Map<string, string | number>

Shape of the data to be passed AuthDataValidator.validate().

Defined in

utils/types.ts:4

Functions

hexStringToArrayBuffer

hexStringToArrayBuffer(hexString): Uint8Array

It takes a hex string and returns an array buffer

Parameters

Name Type Description
hexString string The hex string to convert to an array buffer.

Returns

Uint8Array

A Uint8Array of the hexString.

Defined in

utils/hexStringToArrayBuffer.ts:7


searchParamsToAuthDataMap

searchParamsToAuthDataMap(searchParams): AuthDataMap

It takes a URLSearchParams object and returns auth data Map. It's useful for parsing the URLSearchParams received from Telegram.

Parameters

Name Type Description
searchParams URLSearchParams URLSearchParams

Returns

AuthDataMap

A new Map object with the entries from the searchParams object.

Defined in

utils/searchParamsToAuthDataMap.ts:10


objectToAuthDataMap

objectToAuthDataMap(data): AuthDataMap

It takes an object and returns auth data Map

Parameters

Name Type Description
data Record<string, string | number> The object to convert to a Map

Returns

AuthDataMap

A new Map object with the entries of the object passed in.

Defined in

utils/objectToAuthDataMap.ts:9


urlStrToAuthDataMap

urlStrToAuthDataMap(urlStr): Map<string, string>

It takes a URL string and returns auth data Map from the URL's query parameters. It's useful for parsing the URL received from Telegram.

Parameters

Name Type Description
urlStr string The URL string to parse.

Returns

Map<string, string>

A Map object with the key/value pairs from the URL's query string.

Defined in

utils/urlStrToAuthDataMap.ts:8