@mtkruto/node 0.147.0 → 0.150.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/esm/0_deps.d.ts +8 -8
- package/esm/0_deps.js +8 -8
- package/esm/3_types.d.ts +3 -0
- package/esm/3_types.d.ts.map +1 -1
- package/esm/3_types.js +3 -0
- package/esm/client/0_params.d.ts +8 -0
- package/esm/client/0_params.d.ts.map +1 -1
- package/esm/client/0_utilities.d.ts +1 -1
- package/esm/client/0_utilities.d.ts.map +1 -1
- package/esm/client/1_client_generic.d.ts +20 -2
- package/esm/client/1_client_generic.d.ts.map +1 -1
- package/esm/client/3_filters.d.ts.map +1 -1
- package/esm/client/3_filters.js +4 -1
- package/esm/client/3_message_manager.d.ts +4 -2
- package/esm/client/3_message_manager.d.ts.map +1 -1
- package/esm/client/3_message_manager.js +85 -1
- package/esm/client/6_client.d.ts +20 -2
- package/esm/client/6_client.d.ts.map +1 -1
- package/esm/client/6_client.js +22 -0
- package/esm/client/6_client_dispatcher.d.ts +20 -2
- package/esm/client/6_client_dispatcher.d.ts.map +1 -1
- package/esm/client/6_client_dispatcher.js +22 -0
- package/{script/deps/jsr.io/@std/async/1.3.0 → esm/deps/jsr.io/@std/async/1.4.0}/delay.d.ts.map +1 -1
- package/esm/deps/jsr.io/@std/async/{1.3.0 → 1.4.0}/pool.d.ts.map +1 -1
- package/esm/deps/jsr.io/@std/path/{1.1.4 → 1.1.5}/_common/assert_path.d.ts.map +1 -1
- package/esm/deps/jsr.io/@std/path/{1.1.4 → 1.1.5}/_common/assert_path.js +1 -1
- package/esm/deps/jsr.io/@std/path/{1.1.4 → 1.1.5}/_common/basename.d.ts.map +1 -1
- package/esm/deps/jsr.io/@std/path/{1.1.4 → 1.1.5}/_common/basename.js +1 -1
- package/esm/deps/jsr.io/@std/path/{1.1.4 → 1.1.5}/_common/constants.d.ts.map +1 -1
- package/esm/deps/jsr.io/@std/path/{1.1.4 → 1.1.5}/_common/constants.js +1 -1
- package/esm/deps/jsr.io/@std/path/{1.1.4 → 1.1.5}/_common/from_file_url.d.ts.map +1 -1
- package/esm/deps/jsr.io/@std/path/{1.1.4 → 1.1.5}/_common/from_file_url.js +1 -1
- package/esm/deps/jsr.io/@std/path/{1.1.4 → 1.1.5}/_common/normalize.d.ts.map +1 -1
- package/esm/deps/jsr.io/@std/path/{1.1.4 → 1.1.5}/_common/normalize.js +1 -1
- package/esm/deps/jsr.io/@std/path/{1.1.4 → 1.1.5}/_common/normalize_string.d.ts.map +1 -1
- package/esm/deps/jsr.io/@std/path/{1.1.4 → 1.1.5}/_common/normalize_string.js +1 -1
- package/esm/deps/jsr.io/@std/path/{1.1.4 → 1.1.5}/_common/strip_trailing_separators.d.ts.map +1 -1
- package/esm/deps/jsr.io/@std/path/{1.1.4 → 1.1.5}/_common/strip_trailing_separators.js +1 -1
- package/esm/deps/jsr.io/@std/path/{1.1.4 → 1.1.5}/_common/to_file_url.d.ts.map +1 -1
- package/esm/deps/jsr.io/@std/path/{1.1.4 → 1.1.5}/_common/to_file_url.js +1 -1
- package/esm/deps/jsr.io/@std/path/{1.1.4 → 1.1.5}/basename.d.ts +4 -1
- package/esm/deps/jsr.io/@std/path/1.1.5/basename.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/path/{1.1.4 → 1.1.5}/basename.js +5 -2
- package/esm/deps/jsr.io/@std/path/{1.1.4 → 1.1.5}/extname.d.ts +4 -1
- package/esm/deps/jsr.io/@std/path/1.1.5/extname.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/path/{1.1.4 → 1.1.5}/extname.js +5 -2
- package/esm/deps/jsr.io/@std/path/{1.1.4 → 1.1.5}/is_absolute.d.ts.map +1 -1
- package/esm/deps/jsr.io/@std/path/{1.1.4 → 1.1.5}/is_absolute.js +1 -1
- package/esm/deps/jsr.io/@std/path/{1.1.4 → 1.1.5}/join.d.ts.map +1 -1
- package/esm/deps/jsr.io/@std/path/{1.1.4 → 1.1.5}/join.js +1 -1
- package/esm/deps/jsr.io/@std/path/{1.1.4 → 1.1.5}/posix/_util.d.ts.map +1 -1
- package/esm/deps/jsr.io/@std/path/{1.1.4 → 1.1.5}/posix/_util.js +1 -1
- package/{script/deps/jsr.io/@std/path/1.1.4 → esm/deps/jsr.io/@std/path/1.1.5}/posix/basename.d.ts +5 -0
- package/esm/deps/jsr.io/@std/path/1.1.5/posix/basename.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/path/{1.1.4 → 1.1.5}/posix/basename.js +6 -1
- package/{script/deps/jsr.io/@std/path/1.1.4 → esm/deps/jsr.io/@std/path/1.1.5}/posix/extname.d.ts +5 -0
- package/esm/deps/jsr.io/@std/path/1.1.5/posix/extname.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/path/{1.1.4 → 1.1.5}/posix/extname.js +6 -1
- package/esm/deps/jsr.io/@std/path/{1.1.4 → 1.1.5}/posix/from_file_url.d.ts.map +1 -1
- package/esm/deps/jsr.io/@std/path/{1.1.4 → 1.1.5}/posix/from_file_url.js +1 -1
- package/esm/deps/jsr.io/@std/path/{1.1.4 → 1.1.5}/posix/is_absolute.d.ts.map +1 -1
- package/esm/deps/jsr.io/@std/path/{1.1.4 → 1.1.5}/posix/is_absolute.js +1 -1
- package/{script/deps/jsr.io/@std/path/1.1.4 → esm/deps/jsr.io/@std/path/1.1.5}/posix/join.d.ts.map +1 -1
- package/esm/deps/jsr.io/@std/path/{1.1.4 → 1.1.5}/posix/join.js +1 -1
- package/{script/deps/jsr.io/@std/path/1.1.4 → esm/deps/jsr.io/@std/path/1.1.5}/posix/normalize.d.ts.map +1 -1
- package/esm/deps/jsr.io/@std/path/{1.1.4 → 1.1.5}/posix/normalize.js +1 -1
- package/{script/deps/jsr.io/@std/path/1.1.4 → esm/deps/jsr.io/@std/path/1.1.5}/posix/to_file_url.d.ts.map +1 -1
- package/esm/deps/jsr.io/@std/path/{1.1.4 → 1.1.5}/posix/to_file_url.js +1 -1
- package/{script/deps/jsr.io/@std/path/1.1.4 → esm/deps/jsr.io/@std/path/1.1.5}/to_file_url.d.ts.map +1 -1
- package/esm/deps/jsr.io/@std/path/{1.1.4 → 1.1.5}/to_file_url.js +1 -1
- package/esm/deps/jsr.io/@std/path/{1.1.4 → 1.1.5}/windows/_util.d.ts.map +1 -1
- package/esm/deps/jsr.io/@std/path/{1.1.4 → 1.1.5}/windows/_util.js +1 -1
- package/esm/deps/jsr.io/@std/path/{1.1.4 → 1.1.5}/windows/basename.d.ts +1 -0
- package/esm/deps/jsr.io/@std/path/1.1.5/windows/basename.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/path/{1.1.4 → 1.1.5}/windows/basename.js +2 -1
- package/{script/deps/jsr.io/@std/path/1.1.4 → esm/deps/jsr.io/@std/path/1.1.5}/windows/extname.d.ts +1 -0
- package/esm/deps/jsr.io/@std/path/1.1.5/windows/extname.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/path/{1.1.4 → 1.1.5}/windows/extname.js +2 -1
- package/{script/deps/jsr.io/@std/path/1.1.4 → esm/deps/jsr.io/@std/path/1.1.5}/windows/from_file_url.d.ts.map +1 -1
- package/esm/deps/jsr.io/@std/path/{1.1.4 → 1.1.5}/windows/from_file_url.js +1 -1
- package/{script/deps/jsr.io/@std/path/1.1.4 → esm/deps/jsr.io/@std/path/1.1.5}/windows/is_absolute.d.ts.map +1 -1
- package/esm/deps/jsr.io/@std/path/{1.1.4 → 1.1.5}/windows/is_absolute.js +1 -1
- package/{script/deps/jsr.io/@std/path/1.1.4 → esm/deps/jsr.io/@std/path/1.1.5}/windows/join.d.ts.map +1 -1
- package/esm/deps/jsr.io/@std/path/{1.1.4 → 1.1.5}/windows/join.js +1 -1
- package/{script/deps/jsr.io/@std/path/1.1.4 → esm/deps/jsr.io/@std/path/1.1.5}/windows/normalize.d.ts.map +1 -1
- package/esm/deps/jsr.io/@std/path/{1.1.4 → 1.1.5}/windows/normalize.js +1 -1
- package/{script/deps/jsr.io/@std/path/1.1.4 → esm/deps/jsr.io/@std/path/1.1.5}/windows/to_file_url.d.ts.map +1 -1
- package/esm/deps/jsr.io/@std/path/{1.1.4 → 1.1.5}/windows/to_file_url.js +1 -1
- package/esm/deps/jsr.io/@std/streams/{1.1.0 → 1.1.1}/to_array_buffer.d.ts.map +1 -1
- package/esm/tl/1_telegram_api.d.ts +444 -11
- package/esm/tl/1_telegram_api.d.ts.map +1 -1
- package/esm/tl/1_telegram_api.js +554 -33
- package/esm/types/2_message_entity.d.ts +16 -0
- package/esm/types/2_message_entity.d.ts.map +1 -1
- package/esm/types/2_message_entity.js +51 -45
- package/esm/types/3_rich_text_component.d.ts +268 -0
- package/esm/types/3_rich_text_component.d.ts.map +1 -0
- package/esm/types/3_rich_text_component.js +161 -0
- package/esm/types/4_page_block.d.ts +479 -0
- package/esm/types/4_page_block.d.ts.map +1 -0
- package/esm/types/4_page_block.js +552 -0
- package/esm/types/5_input_rich_text.d.ts +38 -0
- package/esm/types/5_input_rich_text.d.ts.map +1 -0
- package/esm/types/5_input_rich_text.js +20 -0
- package/esm/types/6_message.d.ts +20 -1
- package/esm/types/6_message.d.ts.map +1 -1
- package/esm/types/6_message.js +32 -2
- package/package.json +1 -1
- package/script/0_deps.d.ts +8 -8
- package/script/0_deps.js +8 -8
- package/script/3_types.d.ts +3 -0
- package/script/3_types.d.ts.map +1 -1
- package/script/3_types.js +3 -0
- package/script/client/0_params.d.ts +8 -0
- package/script/client/0_params.d.ts.map +1 -1
- package/script/client/0_utilities.d.ts +1 -1
- package/script/client/0_utilities.d.ts.map +1 -1
- package/script/client/1_client_generic.d.ts +20 -2
- package/script/client/1_client_generic.d.ts.map +1 -1
- package/script/client/3_filters.d.ts.map +1 -1
- package/script/client/3_filters.js +4 -1
- package/script/client/3_message_manager.d.ts +4 -2
- package/script/client/3_message_manager.d.ts.map +1 -1
- package/script/client/3_message_manager.js +84 -0
- package/script/client/6_client.d.ts +20 -2
- package/script/client/6_client.d.ts.map +1 -1
- package/script/client/6_client.js +22 -0
- package/script/client/6_client_dispatcher.d.ts +20 -2
- package/script/client/6_client_dispatcher.d.ts.map +1 -1
- package/script/client/6_client_dispatcher.js +22 -0
- package/{esm/deps/jsr.io/@std/async/1.3.0 → script/deps/jsr.io/@std/async/1.4.0}/delay.d.ts.map +1 -1
- package/script/deps/jsr.io/@std/async/{1.3.0 → 1.4.0}/pool.d.ts.map +1 -1
- package/script/deps/jsr.io/@std/path/{1.1.4 → 1.1.5}/_common/assert_path.d.ts.map +1 -1
- package/script/deps/jsr.io/@std/path/{1.1.4 → 1.1.5}/_common/assert_path.js +1 -1
- package/script/deps/jsr.io/@std/path/{1.1.4 → 1.1.5}/_common/basename.d.ts.map +1 -1
- package/script/deps/jsr.io/@std/path/{1.1.4 → 1.1.5}/_common/basename.js +1 -1
- package/script/deps/jsr.io/@std/path/{1.1.4 → 1.1.5}/_common/constants.d.ts.map +1 -1
- package/script/deps/jsr.io/@std/path/{1.1.4 → 1.1.5}/_common/constants.js +1 -1
- package/script/deps/jsr.io/@std/path/{1.1.4 → 1.1.5}/_common/from_file_url.d.ts.map +1 -1
- package/script/deps/jsr.io/@std/path/{1.1.4 → 1.1.5}/_common/from_file_url.js +1 -1
- package/script/deps/jsr.io/@std/path/{1.1.4 → 1.1.5}/_common/normalize.d.ts.map +1 -1
- package/script/deps/jsr.io/@std/path/{1.1.4 → 1.1.5}/_common/normalize.js +1 -1
- package/script/deps/jsr.io/@std/path/{1.1.4 → 1.1.5}/_common/normalize_string.d.ts.map +1 -1
- package/script/deps/jsr.io/@std/path/{1.1.4 → 1.1.5}/_common/normalize_string.js +1 -1
- package/script/deps/jsr.io/@std/path/{1.1.4 → 1.1.5}/_common/strip_trailing_separators.d.ts.map +1 -1
- package/script/deps/jsr.io/@std/path/{1.1.4 → 1.1.5}/_common/strip_trailing_separators.js +1 -1
- package/script/deps/jsr.io/@std/path/{1.1.4 → 1.1.5}/_common/to_file_url.d.ts.map +1 -1
- package/script/deps/jsr.io/@std/path/{1.1.4 → 1.1.5}/_common/to_file_url.js +1 -1
- package/script/deps/jsr.io/@std/path/{1.1.4 → 1.1.5}/basename.d.ts +4 -1
- package/script/deps/jsr.io/@std/path/1.1.5/basename.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/path/{1.1.4 → 1.1.5}/basename.js +5 -2
- package/script/deps/jsr.io/@std/path/{1.1.4 → 1.1.5}/extname.d.ts +4 -1
- package/script/deps/jsr.io/@std/path/1.1.5/extname.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/path/{1.1.4 → 1.1.5}/extname.js +5 -2
- package/script/deps/jsr.io/@std/path/{1.1.4 → 1.1.5}/is_absolute.d.ts.map +1 -1
- package/script/deps/jsr.io/@std/path/{1.1.4 → 1.1.5}/is_absolute.js +1 -1
- package/script/deps/jsr.io/@std/path/{1.1.4 → 1.1.5}/join.d.ts.map +1 -1
- package/script/deps/jsr.io/@std/path/{1.1.4 → 1.1.5}/join.js +1 -1
- package/script/deps/jsr.io/@std/path/{1.1.4 → 1.1.5}/posix/_util.d.ts.map +1 -1
- package/script/deps/jsr.io/@std/path/{1.1.4 → 1.1.5}/posix/_util.js +1 -1
- package/{esm/deps/jsr.io/@std/path/1.1.4 → script/deps/jsr.io/@std/path/1.1.5}/posix/basename.d.ts +5 -0
- package/script/deps/jsr.io/@std/path/1.1.5/posix/basename.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/path/{1.1.4 → 1.1.5}/posix/basename.js +6 -1
- package/{esm/deps/jsr.io/@std/path/1.1.4 → script/deps/jsr.io/@std/path/1.1.5}/posix/extname.d.ts +5 -0
- package/script/deps/jsr.io/@std/path/1.1.5/posix/extname.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/path/{1.1.4 → 1.1.5}/posix/extname.js +6 -1
- package/script/deps/jsr.io/@std/path/{1.1.4 → 1.1.5}/posix/from_file_url.d.ts.map +1 -1
- package/script/deps/jsr.io/@std/path/{1.1.4 → 1.1.5}/posix/from_file_url.js +1 -1
- package/script/deps/jsr.io/@std/path/{1.1.4 → 1.1.5}/posix/is_absolute.d.ts.map +1 -1
- package/script/deps/jsr.io/@std/path/{1.1.4 → 1.1.5}/posix/is_absolute.js +1 -1
- package/{esm/deps/jsr.io/@std/path/1.1.4 → script/deps/jsr.io/@std/path/1.1.5}/posix/join.d.ts.map +1 -1
- package/script/deps/jsr.io/@std/path/{1.1.4 → 1.1.5}/posix/join.js +1 -1
- package/{esm/deps/jsr.io/@std/path/1.1.4 → script/deps/jsr.io/@std/path/1.1.5}/posix/normalize.d.ts.map +1 -1
- package/script/deps/jsr.io/@std/path/{1.1.4 → 1.1.5}/posix/normalize.js +1 -1
- package/{esm/deps/jsr.io/@std/path/1.1.4 → script/deps/jsr.io/@std/path/1.1.5}/posix/to_file_url.d.ts.map +1 -1
- package/script/deps/jsr.io/@std/path/{1.1.4 → 1.1.5}/posix/to_file_url.js +1 -1
- package/{esm/deps/jsr.io/@std/path/1.1.4 → script/deps/jsr.io/@std/path/1.1.5}/to_file_url.d.ts.map +1 -1
- package/script/deps/jsr.io/@std/path/{1.1.4 → 1.1.5}/to_file_url.js +1 -1
- package/script/deps/jsr.io/@std/path/{1.1.4 → 1.1.5}/windows/_util.d.ts.map +1 -1
- package/script/deps/jsr.io/@std/path/{1.1.4 → 1.1.5}/windows/_util.js +1 -1
- package/script/deps/jsr.io/@std/path/{1.1.4 → 1.1.5}/windows/basename.d.ts +1 -0
- package/script/deps/jsr.io/@std/path/1.1.5/windows/basename.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/path/{1.1.4 → 1.1.5}/windows/basename.js +2 -1
- package/{esm/deps/jsr.io/@std/path/1.1.4 → script/deps/jsr.io/@std/path/1.1.5}/windows/extname.d.ts +1 -0
- package/script/deps/jsr.io/@std/path/1.1.5/windows/extname.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/path/{1.1.4 → 1.1.5}/windows/extname.js +2 -1
- package/{esm/deps/jsr.io/@std/path/1.1.4 → script/deps/jsr.io/@std/path/1.1.5}/windows/from_file_url.d.ts.map +1 -1
- package/script/deps/jsr.io/@std/path/{1.1.4 → 1.1.5}/windows/from_file_url.js +1 -1
- package/{esm/deps/jsr.io/@std/path/1.1.4 → script/deps/jsr.io/@std/path/1.1.5}/windows/is_absolute.d.ts.map +1 -1
- package/script/deps/jsr.io/@std/path/{1.1.4 → 1.1.5}/windows/is_absolute.js +1 -1
- package/{esm/deps/jsr.io/@std/path/1.1.4 → script/deps/jsr.io/@std/path/1.1.5}/windows/join.d.ts.map +1 -1
- package/script/deps/jsr.io/@std/path/{1.1.4 → 1.1.5}/windows/join.js +1 -1
- package/{esm/deps/jsr.io/@std/path/1.1.4 → script/deps/jsr.io/@std/path/1.1.5}/windows/normalize.d.ts.map +1 -1
- package/script/deps/jsr.io/@std/path/{1.1.4 → 1.1.5}/windows/normalize.js +1 -1
- package/{esm/deps/jsr.io/@std/path/1.1.4 → script/deps/jsr.io/@std/path/1.1.5}/windows/to_file_url.d.ts.map +1 -1
- package/script/deps/jsr.io/@std/path/{1.1.4 → 1.1.5}/windows/to_file_url.js +1 -1
- package/script/deps/jsr.io/@std/streams/{1.1.0 → 1.1.1}/to_array_buffer.d.ts.map +1 -1
- package/script/tl/1_telegram_api.d.ts +444 -11
- package/script/tl/1_telegram_api.d.ts.map +1 -1
- package/script/tl/1_telegram_api.js +554 -33
- package/script/types/2_message_entity.d.ts +16 -0
- package/script/types/2_message_entity.d.ts.map +1 -1
- package/script/types/2_message_entity.js +53 -45
- package/script/types/3_rich_text_component.d.ts +268 -0
- package/script/types/3_rich_text_component.d.ts.map +1 -0
- package/script/types/3_rich_text_component.js +165 -0
- package/script/types/4_page_block.d.ts +479 -0
- package/script/types/4_page_block.d.ts.map +1 -0
- package/script/types/4_page_block.js +569 -0
- package/script/types/5_input_rich_text.d.ts +38 -0
- package/script/types/5_input_rich_text.d.ts.map +1 -0
- package/script/types/5_input_rich_text.js +21 -0
- package/script/types/6_message.d.ts +20 -1
- package/script/types/6_message.d.ts.map +1 -1
- package/script/types/6_message.js +32 -2
- package/esm/deps/jsr.io/@std/path/1.1.4/basename.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/path/1.1.4/extname.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/path/1.1.4/posix/basename.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/path/1.1.4/posix/extname.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/path/1.1.4/windows/basename.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/path/1.1.4/windows/extname.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/path/1.1.4/basename.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/path/1.1.4/extname.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/path/1.1.4/posix/basename.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/path/1.1.4/posix/extname.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/path/1.1.4/windows/basename.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/path/1.1.4/windows/extname.d.ts.map +0 -1
- /package/esm/deps/jsr.io/@std/async/{1.3.0 → 1.4.0}/delay.d.ts +0 -0
- /package/esm/deps/jsr.io/@std/async/{1.3.0 → 1.4.0}/delay.js +0 -0
- /package/esm/deps/jsr.io/@std/async/{1.3.0 → 1.4.0}/pool.d.ts +0 -0
- /package/esm/deps/jsr.io/@std/async/{1.3.0 → 1.4.0}/pool.js +0 -0
- /package/esm/deps/jsr.io/@std/path/{1.1.4 → 1.1.5}/_common/assert_path.d.ts +0 -0
- /package/esm/deps/jsr.io/@std/path/{1.1.4 → 1.1.5}/_common/basename.d.ts +0 -0
- /package/esm/deps/jsr.io/@std/path/{1.1.4 → 1.1.5}/_common/constants.d.ts +0 -0
- /package/esm/deps/jsr.io/@std/path/{1.1.4 → 1.1.5}/_common/from_file_url.d.ts +0 -0
- /package/esm/deps/jsr.io/@std/path/{1.1.4 → 1.1.5}/_common/normalize.d.ts +0 -0
- /package/esm/deps/jsr.io/@std/path/{1.1.4 → 1.1.5}/_common/normalize_string.d.ts +0 -0
- /package/esm/deps/jsr.io/@std/path/{1.1.4 → 1.1.5}/_common/strip_trailing_separators.d.ts +0 -0
- /package/esm/deps/jsr.io/@std/path/{1.1.4 → 1.1.5}/_common/to_file_url.d.ts +0 -0
- /package/esm/deps/jsr.io/@std/path/{1.1.4 → 1.1.5}/is_absolute.d.ts +0 -0
- /package/esm/deps/jsr.io/@std/path/{1.1.4 → 1.1.5}/join.d.ts +0 -0
- /package/esm/deps/jsr.io/@std/path/{1.1.4 → 1.1.5}/posix/_util.d.ts +0 -0
- /package/esm/deps/jsr.io/@std/path/{1.1.4 → 1.1.5}/posix/from_file_url.d.ts +0 -0
- /package/esm/deps/jsr.io/@std/path/{1.1.4 → 1.1.5}/posix/is_absolute.d.ts +0 -0
- /package/esm/deps/jsr.io/@std/path/{1.1.4 → 1.1.5}/posix/join.d.ts +0 -0
- /package/esm/deps/jsr.io/@std/path/{1.1.4 → 1.1.5}/posix/normalize.d.ts +0 -0
- /package/esm/deps/jsr.io/@std/path/{1.1.4 → 1.1.5}/posix/to_file_url.d.ts +0 -0
- /package/esm/deps/jsr.io/@std/path/{1.1.4 → 1.1.5}/to_file_url.d.ts +0 -0
- /package/esm/deps/jsr.io/@std/path/{1.1.4 → 1.1.5}/windows/_util.d.ts +0 -0
- /package/esm/deps/jsr.io/@std/path/{1.1.4 → 1.1.5}/windows/from_file_url.d.ts +0 -0
- /package/esm/deps/jsr.io/@std/path/{1.1.4 → 1.1.5}/windows/is_absolute.d.ts +0 -0
- /package/esm/deps/jsr.io/@std/path/{1.1.4 → 1.1.5}/windows/join.d.ts +0 -0
- /package/esm/deps/jsr.io/@std/path/{1.1.4 → 1.1.5}/windows/normalize.d.ts +0 -0
- /package/esm/deps/jsr.io/@std/path/{1.1.4 → 1.1.5}/windows/to_file_url.d.ts +0 -0
- /package/esm/deps/jsr.io/@std/streams/{1.1.0 → 1.1.1}/to_array_buffer.d.ts +0 -0
- /package/esm/deps/jsr.io/@std/streams/{1.1.0 → 1.1.1}/to_array_buffer.js +0 -0
- /package/script/deps/jsr.io/@std/async/{1.3.0 → 1.4.0}/delay.d.ts +0 -0
- /package/script/deps/jsr.io/@std/async/{1.3.0 → 1.4.0}/delay.js +0 -0
- /package/script/deps/jsr.io/@std/async/{1.3.0 → 1.4.0}/pool.d.ts +0 -0
- /package/script/deps/jsr.io/@std/async/{1.3.0 → 1.4.0}/pool.js +0 -0
- /package/script/deps/jsr.io/@std/path/{1.1.4 → 1.1.5}/_common/assert_path.d.ts +0 -0
- /package/script/deps/jsr.io/@std/path/{1.1.4 → 1.1.5}/_common/basename.d.ts +0 -0
- /package/script/deps/jsr.io/@std/path/{1.1.4 → 1.1.5}/_common/constants.d.ts +0 -0
- /package/script/deps/jsr.io/@std/path/{1.1.4 → 1.1.5}/_common/from_file_url.d.ts +0 -0
- /package/script/deps/jsr.io/@std/path/{1.1.4 → 1.1.5}/_common/normalize.d.ts +0 -0
- /package/script/deps/jsr.io/@std/path/{1.1.4 → 1.1.5}/_common/normalize_string.d.ts +0 -0
- /package/script/deps/jsr.io/@std/path/{1.1.4 → 1.1.5}/_common/strip_trailing_separators.d.ts +0 -0
- /package/script/deps/jsr.io/@std/path/{1.1.4 → 1.1.5}/_common/to_file_url.d.ts +0 -0
- /package/script/deps/jsr.io/@std/path/{1.1.4 → 1.1.5}/is_absolute.d.ts +0 -0
- /package/script/deps/jsr.io/@std/path/{1.1.4 → 1.1.5}/join.d.ts +0 -0
- /package/script/deps/jsr.io/@std/path/{1.1.4 → 1.1.5}/posix/_util.d.ts +0 -0
- /package/script/deps/jsr.io/@std/path/{1.1.4 → 1.1.5}/posix/from_file_url.d.ts +0 -0
- /package/script/deps/jsr.io/@std/path/{1.1.4 → 1.1.5}/posix/is_absolute.d.ts +0 -0
- /package/script/deps/jsr.io/@std/path/{1.1.4 → 1.1.5}/posix/join.d.ts +0 -0
- /package/script/deps/jsr.io/@std/path/{1.1.4 → 1.1.5}/posix/normalize.d.ts +0 -0
- /package/script/deps/jsr.io/@std/path/{1.1.4 → 1.1.5}/posix/to_file_url.d.ts +0 -0
- /package/script/deps/jsr.io/@std/path/{1.1.4 → 1.1.5}/to_file_url.d.ts +0 -0
- /package/script/deps/jsr.io/@std/path/{1.1.4 → 1.1.5}/windows/_util.d.ts +0 -0
- /package/script/deps/jsr.io/@std/path/{1.1.4 → 1.1.5}/windows/from_file_url.d.ts +0 -0
- /package/script/deps/jsr.io/@std/path/{1.1.4 → 1.1.5}/windows/is_absolute.d.ts +0 -0
- /package/script/deps/jsr.io/@std/path/{1.1.4 → 1.1.5}/windows/join.d.ts +0 -0
- /package/script/deps/jsr.io/@std/path/{1.1.4 → 1.1.5}/windows/normalize.d.ts +0 -0
- /package/script/deps/jsr.io/@std/path/{1.1.4 → 1.1.5}/windows/to_file_url.d.ts +0 -0
- /package/script/deps/jsr.io/@std/streams/{1.1.0 → 1.1.1}/to_array_buffer.d.ts +0 -0
- /package/script/deps/jsr.io/@std/streams/{1.1.0 → 1.1.1}/to_array_buffer.js +0 -0
|
@@ -122,6 +122,22 @@ export interface MessageEntityDateTime extends _MessageEntityBase {
|
|
|
122
122
|
}
|
|
123
123
|
/** A single entity of a message's text or caption. */
|
|
124
124
|
export type MessageEntity = MessageEntityMention | MessageEntityHashtag | MessageEntityBotCommand | MessageEntityURL | MessageEntityEmailAddress | MessageEntityBold | MessageEntityItalic | MessageEntityCode | MessageEntityPre | MessageEntityTextLink | MessageEntityTextMention | MessageEntityCashtag | MessageEntityPhoneNumber | MessageEntityUnderline | MessageEntityStrikethrough | MessageEntityBlockquote | MessageEntityBankCard | MessageEntitySpoiler | MessageEntityCustomEmoji | MessageEntityDateTime;
|
|
125
|
+
export declare function constructDateTimeFormat(obj: {
|
|
126
|
+
relative?: true;
|
|
127
|
+
day_of_week?: true;
|
|
128
|
+
short_date?: true;
|
|
129
|
+
long_date?: true;
|
|
130
|
+
short_time?: true;
|
|
131
|
+
long_time?: true;
|
|
132
|
+
}): string;
|
|
133
|
+
export declare function timeFormatToTlObject(format: string, obj: {
|
|
134
|
+
relative?: true;
|
|
135
|
+
day_of_week?: true;
|
|
136
|
+
short_date?: true;
|
|
137
|
+
long_date?: true;
|
|
138
|
+
short_time?: true;
|
|
139
|
+
long_time?: true;
|
|
140
|
+
}): void;
|
|
125
141
|
export declare function constructMessageEntity(obj: Api.MessageEntity): MessageEntity | null;
|
|
126
142
|
export declare function messageEntityToTlObject(entity: MessageEntity, getPeer: PeerGetter): Api.MessageEntity;
|
|
127
143
|
export declare function sortMessageEntities(entities: MessageEntity[]): MessageEntity[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"2_message_entity.d.ts","sourceRoot":"","sources":["../../src/types/2_message_entity.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAIH,OAAO,EAAE,GAAG,EAAE,MAAM,YAAY,CAAC;AACjC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAEhD,gBAAgB;AAChB,MAAM,MAAM,iBAAiB,GACzB,SAAS,GACT,SAAS,GACT,YAAY,GACZ,KAAK,GACL,OAAO,GACP,MAAM,GACN,QAAQ,GACR,MAAM,GACN,KAAK,GACL,UAAU,GACV,aAAa,GACb,SAAS,GACT,aAAa,GACb,WAAW,GACX,eAAe,GACf,YAAY,GACZ,UAAU,GACV,SAAS,GACT,aAAa,GACb,UAAU,CAAC;AAEf,gBAAgB;AAChB,MAAM,WAAW,kBAAkB;IACjC,IAAI,EAAE,iBAAiB,CAAC;IACxB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,gBAAgB;AAChB,MAAM,WAAW,oBAAqB,SAAQ,kBAAkB;IAC9D,IAAI,EAAE,SAAS,CAAC;CACjB;AAED,gBAAgB;AAChB,MAAM,WAAW,oBAAqB,SAAQ,kBAAkB;IAC9D,IAAI,EAAE,SAAS,CAAC;CACjB;AAED,gBAAgB;AAChB,MAAM,WAAW,uBAAwB,SAAQ,kBAA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,kBAAkB;IACpE,IAAI,EAAE,eAAe,CAAC;CACvB;AAED,gBAAgB;AAChB,MAAM,WAAW,uBAAwB,SAAQ,kBAAkB;IACjE,IAAI,EAAE,YAAY,CAAC;IACnB,WAAW,CAAC,EAAE,IAAI,CAAC;CACpB;AAED,gBAAgB;AAChB,MAAM,WAAW,qBAAsB,SAAQ,kBAAkB;IAC/D,IAAI,EAAE,UAAU,CAAC;CAClB;AAED,gBAAgB;AAChB,MAAM,WAAW,oBAAqB,SAAQ,kBAAkB;IAC9D,IAAI,EAAE,SAAS,CAAC;CACjB;AAED,gBAAgB;AAChB,MAAM,WAAW,wBAAyB,SAAQ,kBAAkB;IAClE,IAAI,EAAE,aAAa,CAAC;IACpB,0CAA0C;IAC1C,aAAa,EAAE,MAAM,CAAC;CACvB;AAED,gBAAgB;AAChB,MAAM,WAAW,qBAAsB,SAAQ,kBAAkB;IAC/D,IAAI,EAAE,UAAU,CAAC;IACjB,mCAAmC;IACnC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,uBAAuB;IACvB,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,sDAAsD;AACtD,MAAM,MAAM,aAAa,GACrB,oBAAoB,GACpB,oBAAoB,GACpB,uBAAuB,GACvB,gBAAgB,GAChB,yBAAyB,GACzB,iBAAiB,GACjB,mBAAmB,GACnB,iBAAiB,GACjB,gBAAgB,GAChB,qBAAqB,GACrB,wBAAwB,GACxB,oBAAoB,GACpB,wBAAwB,GACxB,sBAAsB,GACtB,0BAA0B,GAC1B,uBAAuB,GACvB,qBAAqB,GACrB,oBAAoB,GACpB,wBAAwB,GACxB,qBAAqB,CAAC;AAE1B,wBAAgB,sBAAsB,CAAC,GAAG,EAAE,GAAG,CAAC,aAAa,GAAG,aAAa,GAAG,IAAI,
|
|
1
|
+
{"version":3,"file":"2_message_entity.d.ts","sourceRoot":"","sources":["../../src/types/2_message_entity.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAIH,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,EAAE,aAAa,EAAE,OAAO,EAAE,UAAU,GAAG,GAAG,CAAC,aAAa,CAsErG;AAwBD,wBAAgB,mBAAmB,CAAC,QAAQ,EAAE,aAAa,EAAE,GAAG,aAAa,EAAE,CAY9E"}
|
|
@@ -19,12 +19,63 @@
|
|
|
19
19
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
20
20
|
*/
|
|
21
21
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
22
|
+
exports.constructDateTimeFormat = constructDateTimeFormat;
|
|
23
|
+
exports.timeFormatToTlObject = timeFormatToTlObject;
|
|
22
24
|
exports.constructMessageEntity = constructMessageEntity;
|
|
23
25
|
exports.messageEntityToTlObject = messageEntityToTlObject;
|
|
24
26
|
exports.sortMessageEntities = sortMessageEntities;
|
|
25
27
|
const _0_deps_js_1 = require("../0_deps.js");
|
|
26
28
|
const _1_utilities_js_1 = require("../1_utilities.js");
|
|
27
29
|
const _2_tl_js_1 = require("../2_tl.js");
|
|
30
|
+
function constructDateTimeFormat(obj) {
|
|
31
|
+
let format = "";
|
|
32
|
+
if (obj.relative) {
|
|
33
|
+
format += "r";
|
|
34
|
+
}
|
|
35
|
+
if (obj.day_of_week) {
|
|
36
|
+
format += "w";
|
|
37
|
+
}
|
|
38
|
+
if (obj.short_date) {
|
|
39
|
+
format += "d";
|
|
40
|
+
}
|
|
41
|
+
else if (obj.long_date) {
|
|
42
|
+
format += "D";
|
|
43
|
+
}
|
|
44
|
+
if (obj.short_time) {
|
|
45
|
+
format += "t";
|
|
46
|
+
}
|
|
47
|
+
else if (obj.long_time) {
|
|
48
|
+
format += "T";
|
|
49
|
+
}
|
|
50
|
+
return format;
|
|
51
|
+
}
|
|
52
|
+
function timeFormatToTlObject(format, obj) {
|
|
53
|
+
if (format === "r" || format === "R") {
|
|
54
|
+
obj.relative = true;
|
|
55
|
+
}
|
|
56
|
+
else {
|
|
57
|
+
for (const character of format) {
|
|
58
|
+
switch (character) {
|
|
59
|
+
case "t":
|
|
60
|
+
obj.short_time = true;
|
|
61
|
+
break;
|
|
62
|
+
case "T":
|
|
63
|
+
obj.long_time = true;
|
|
64
|
+
break;
|
|
65
|
+
case "d":
|
|
66
|
+
obj.short_date = true;
|
|
67
|
+
break;
|
|
68
|
+
case "D":
|
|
69
|
+
obj.long_date = true;
|
|
70
|
+
break;
|
|
71
|
+
case "w":
|
|
72
|
+
case "W":
|
|
73
|
+
obj.day_of_week = true;
|
|
74
|
+
break;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
}
|
|
28
79
|
function constructMessageEntity(obj) {
|
|
29
80
|
if (_2_tl_js_1.Api.is("messageEntityMention", obj)) {
|
|
30
81
|
return { type: "mention", offset: obj.offset, length: obj.length };
|
|
@@ -84,30 +135,11 @@ function constructMessageEntity(obj) {
|
|
|
84
135
|
return { type: "customEmoji", offset: obj.offset, length: obj.length, customEmojiId: String(obj.document_id) };
|
|
85
136
|
}
|
|
86
137
|
else if (_2_tl_js_1.Api.is("messageEntityFormattedDate", obj)) {
|
|
87
|
-
let format = "";
|
|
88
|
-
if (obj.relative) {
|
|
89
|
-
format += "r";
|
|
90
|
-
}
|
|
91
|
-
if (obj.day_of_week) {
|
|
92
|
-
format += "w";
|
|
93
|
-
}
|
|
94
|
-
if (obj.short_date) {
|
|
95
|
-
format += "d";
|
|
96
|
-
}
|
|
97
|
-
else if (obj.long_date) {
|
|
98
|
-
format += "D";
|
|
99
|
-
}
|
|
100
|
-
if (obj.short_time) {
|
|
101
|
-
format += "t";
|
|
102
|
-
}
|
|
103
|
-
else if (obj.long_time) {
|
|
104
|
-
format += "T";
|
|
105
|
-
}
|
|
106
138
|
return (0, _1_utilities_js_1.cleanObject)({
|
|
107
139
|
type: "dateTime",
|
|
108
140
|
offset: obj.offset,
|
|
109
141
|
length: obj.length,
|
|
110
|
-
format:
|
|
142
|
+
format: constructDateTimeFormat(obj) || undefined,
|
|
111
143
|
dateTime: obj.date,
|
|
112
144
|
});
|
|
113
145
|
}
|
|
@@ -181,31 +213,7 @@ function messageEntityToTlObject(entity, getPeer) {
|
|
|
181
213
|
case "dateTime": {
|
|
182
214
|
const entity_ = { _: "messageEntityFormattedDate", offset, length, date: entity.dateTime };
|
|
183
215
|
if (entity.format) {
|
|
184
|
-
|
|
185
|
-
entity_.relative = true;
|
|
186
|
-
}
|
|
187
|
-
else {
|
|
188
|
-
for (const character of entity.format) {
|
|
189
|
-
switch (character) {
|
|
190
|
-
case "t":
|
|
191
|
-
entity_.short_time = true;
|
|
192
|
-
break;
|
|
193
|
-
case "T":
|
|
194
|
-
entity_.long_time = true;
|
|
195
|
-
break;
|
|
196
|
-
case "d":
|
|
197
|
-
entity_.short_date = true;
|
|
198
|
-
break;
|
|
199
|
-
case "D":
|
|
200
|
-
entity_.long_date = true;
|
|
201
|
-
break;
|
|
202
|
-
case "w":
|
|
203
|
-
case "W":
|
|
204
|
-
entity_.day_of_week = true;
|
|
205
|
-
break;
|
|
206
|
-
}
|
|
207
|
-
}
|
|
208
|
-
}
|
|
216
|
+
timeFormatToTlObject(entity.format, entity_);
|
|
209
217
|
}
|
|
210
218
|
return entity_;
|
|
211
219
|
}
|
|
@@ -0,0 +1,268 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* MTKruto - Cross-runtime JavaScript library for building Telegram clients
|
|
3
|
+
* Copyright (C) 2023-2026 Roj <https://roj.im/>
|
|
4
|
+
*
|
|
5
|
+
* This file is part of MTKruto.
|
|
6
|
+
*
|
|
7
|
+
* This program is free software: you can redistribute it and/or modify
|
|
8
|
+
* it under the terms of the GNU Lesser General Public License as published by
|
|
9
|
+
* the Free Software Foundation, either version 3 of the License, or
|
|
10
|
+
* (at your option) any later version.
|
|
11
|
+
*
|
|
12
|
+
* This program is distributed in the hope that it will be useful,
|
|
13
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
14
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
15
|
+
* GNU Lesser General Public License for more details.
|
|
16
|
+
*
|
|
17
|
+
* You should have received a copy of the GNU Lesser General Public License
|
|
18
|
+
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
19
|
+
*/
|
|
20
|
+
import { Api } from "../2_tl.js";
|
|
21
|
+
/**
|
|
22
|
+
* An empty rich text component.
|
|
23
|
+
* @unlisted
|
|
24
|
+
*/
|
|
25
|
+
export interface RichTextComponentEmpty {
|
|
26
|
+
type: "empty";
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* An plain rich text component.
|
|
30
|
+
* @unlisted
|
|
31
|
+
*/
|
|
32
|
+
export interface RichTextComponentPlain {
|
|
33
|
+
type: "plain";
|
|
34
|
+
text: string;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* A rich text component that has its child bold.
|
|
38
|
+
* @unlisted
|
|
39
|
+
*/
|
|
40
|
+
export interface RichTextComponentBold {
|
|
41
|
+
type: "bold";
|
|
42
|
+
text: RichTextComponent;
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* A rich text component that has its child italic.
|
|
46
|
+
* @unlisted
|
|
47
|
+
*/
|
|
48
|
+
export interface RichTextComponentItalic {
|
|
49
|
+
type: "italic";
|
|
50
|
+
text: RichTextComponent;
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* A rich text component that has its child underlined.
|
|
54
|
+
* @unlisted
|
|
55
|
+
*/
|
|
56
|
+
export interface RichTextComponentUnderline {
|
|
57
|
+
type: "underline";
|
|
58
|
+
text: RichTextComponent;
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* A rich text component that has its child striked through.
|
|
62
|
+
* @unlisted
|
|
63
|
+
*/
|
|
64
|
+
export interface RichTextComponentStrikethrough {
|
|
65
|
+
type: "strikethrough";
|
|
66
|
+
text: RichTextComponent;
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* A fixed rich text component.
|
|
70
|
+
* @unlisted
|
|
71
|
+
*/
|
|
72
|
+
export interface RichTextComponentFixed {
|
|
73
|
+
type: "fixed";
|
|
74
|
+
text: RichTextComponent;
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* A rich text component that opens a URL when clicked.
|
|
78
|
+
* @unlisted
|
|
79
|
+
*/
|
|
80
|
+
export interface RichTextComponentLink {
|
|
81
|
+
type: "link";
|
|
82
|
+
url: string;
|
|
83
|
+
linkPreviewId: string;
|
|
84
|
+
text: RichTextComponent;
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* A rich text component that opens the email address represented by its child when clicked.
|
|
88
|
+
* @unlisted
|
|
89
|
+
*/
|
|
90
|
+
export interface RichTextComponentEmail {
|
|
91
|
+
type: "email";
|
|
92
|
+
text: RichTextComponent;
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* A rich text component for concatenating other rich text components.
|
|
96
|
+
* @unlisted
|
|
97
|
+
*/
|
|
98
|
+
export interface RichTextComponentConcatenate {
|
|
99
|
+
type: "concatenate";
|
|
100
|
+
components: RichTextComponent[];
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* A rich text component that has its child in the subscript.
|
|
104
|
+
* @unlisted
|
|
105
|
+
*/
|
|
106
|
+
export interface RichTextComponentSubscript {
|
|
107
|
+
type: "subscript";
|
|
108
|
+
text: RichTextComponent;
|
|
109
|
+
}
|
|
110
|
+
/**
|
|
111
|
+
* A rich text component that has its child in the superscript.
|
|
112
|
+
* @unlisted
|
|
113
|
+
*/
|
|
114
|
+
export interface RichTextComponentSuperscript {
|
|
115
|
+
type: "superscript";
|
|
116
|
+
text: RichTextComponent;
|
|
117
|
+
}
|
|
118
|
+
/**
|
|
119
|
+
* A rich text component that has its child marked.
|
|
120
|
+
* @unlisted
|
|
121
|
+
*/
|
|
122
|
+
export interface RichTextComponentMarked {
|
|
123
|
+
type: "marked";
|
|
124
|
+
text: RichTextComponent;
|
|
125
|
+
}
|
|
126
|
+
/**
|
|
127
|
+
* A rich text component that links to a phone number.
|
|
128
|
+
* @unlisted
|
|
129
|
+
*/
|
|
130
|
+
export interface RichTextComponentPhoneNumberLink {
|
|
131
|
+
type: "phoneNumberLink";
|
|
132
|
+
phoneNumber: string;
|
|
133
|
+
text: RichTextComponent;
|
|
134
|
+
}
|
|
135
|
+
/**
|
|
136
|
+
* A rich text component that displays an inline photo.
|
|
137
|
+
* @unlisted
|
|
138
|
+
*/
|
|
139
|
+
export interface RichTextComponentPhoto {
|
|
140
|
+
type: "photo";
|
|
141
|
+
fileId: string;
|
|
142
|
+
width: number;
|
|
143
|
+
height: number;
|
|
144
|
+
}
|
|
145
|
+
/**
|
|
146
|
+
* An anchor rich text component.
|
|
147
|
+
* @unlisted
|
|
148
|
+
*/
|
|
149
|
+
export interface RichTextComponentAnchor {
|
|
150
|
+
type: "anchor";
|
|
151
|
+
name: string;
|
|
152
|
+
text: RichTextComponent;
|
|
153
|
+
}
|
|
154
|
+
/**
|
|
155
|
+
* An rich text component that displays a mathematical expression.
|
|
156
|
+
* @unlisted
|
|
157
|
+
*/
|
|
158
|
+
export interface RichTextComponentMath {
|
|
159
|
+
type: "math";
|
|
160
|
+
code: string;
|
|
161
|
+
}
|
|
162
|
+
/**
|
|
163
|
+
* An rich text component that displays a custom emoji.
|
|
164
|
+
* @unlisted
|
|
165
|
+
*/
|
|
166
|
+
export interface RichTextComponentCustomEmoji {
|
|
167
|
+
type: "customEmoji";
|
|
168
|
+
customEmojiId: string;
|
|
169
|
+
alt: string;
|
|
170
|
+
}
|
|
171
|
+
/**
|
|
172
|
+
* An rich text component that displays a spoiler.
|
|
173
|
+
* @unlisted
|
|
174
|
+
*/
|
|
175
|
+
export interface RichTextComponentSpoiler {
|
|
176
|
+
type: "spoiler";
|
|
177
|
+
text: RichTextComponent;
|
|
178
|
+
}
|
|
179
|
+
/**
|
|
180
|
+
* An rich text component that mentions a username.
|
|
181
|
+
* @unlisted
|
|
182
|
+
*/
|
|
183
|
+
export interface RichTextComponentMention {
|
|
184
|
+
type: "mention";
|
|
185
|
+
text: RichTextComponent;
|
|
186
|
+
}
|
|
187
|
+
/**
|
|
188
|
+
* A hashtag rich text component.
|
|
189
|
+
* @unlisted
|
|
190
|
+
*/
|
|
191
|
+
export interface RichTextComponentHashtag {
|
|
192
|
+
type: "hashtag";
|
|
193
|
+
text: RichTextComponent;
|
|
194
|
+
}
|
|
195
|
+
/**
|
|
196
|
+
* A bot command rich text component.
|
|
197
|
+
* @unlisted
|
|
198
|
+
*/
|
|
199
|
+
export interface RichTextComponentBotCommand {
|
|
200
|
+
type: "botCommand";
|
|
201
|
+
text: RichTextComponent;
|
|
202
|
+
}
|
|
203
|
+
/**
|
|
204
|
+
* A cashtag rich text component.
|
|
205
|
+
* @unlisted
|
|
206
|
+
*/
|
|
207
|
+
export interface RichTextComponentCashtag {
|
|
208
|
+
type: "cashtag";
|
|
209
|
+
text: RichTextComponent;
|
|
210
|
+
}
|
|
211
|
+
/**
|
|
212
|
+
* A rich text component that opens the URL represented by its child when clicked.
|
|
213
|
+
* @unlisted
|
|
214
|
+
*/
|
|
215
|
+
export interface RichTextComponentUrl {
|
|
216
|
+
type: "url";
|
|
217
|
+
text: RichTextComponent;
|
|
218
|
+
}
|
|
219
|
+
/**
|
|
220
|
+
* A rich text component that links to an email address.
|
|
221
|
+
* @unlisted
|
|
222
|
+
*/
|
|
223
|
+
export interface RichTextComponentEmailLink {
|
|
224
|
+
type: "emailLink";
|
|
225
|
+
email: string;
|
|
226
|
+
text: RichTextComponent;
|
|
227
|
+
}
|
|
228
|
+
/**
|
|
229
|
+
* A rich text component that opens the phone number represented by its child when clicked.
|
|
230
|
+
* @unlisted
|
|
231
|
+
*/
|
|
232
|
+
export interface RichTextComponentPhone {
|
|
233
|
+
type: "phoneNumber";
|
|
234
|
+
text: RichTextComponent;
|
|
235
|
+
}
|
|
236
|
+
/**
|
|
237
|
+
* A bank card rich text component.
|
|
238
|
+
* @unlisted
|
|
239
|
+
*/
|
|
240
|
+
export interface RichTextComponentBankCard {
|
|
241
|
+
type: "bankCard";
|
|
242
|
+
text: RichTextComponent;
|
|
243
|
+
}
|
|
244
|
+
/**
|
|
245
|
+
* A rich text component that mentions a user with a custom text.
|
|
246
|
+
* @unlisted
|
|
247
|
+
*/
|
|
248
|
+
export interface RichTextComponentTextMention {
|
|
249
|
+
type: "textMention";
|
|
250
|
+
userId: number;
|
|
251
|
+
text: RichTextComponent;
|
|
252
|
+
}
|
|
253
|
+
/**
|
|
254
|
+
* A datetime text component.
|
|
255
|
+
* @unlisted
|
|
256
|
+
*/
|
|
257
|
+
export interface RichTextComponentDateTime {
|
|
258
|
+
type: "dateTime";
|
|
259
|
+
isRelative: boolean;
|
|
260
|
+
format?: string;
|
|
261
|
+
date: number;
|
|
262
|
+
text: RichTextComponent;
|
|
263
|
+
}
|
|
264
|
+
/** Any type of rich text component. */
|
|
265
|
+
export type RichTextComponent = RichTextComponentEmpty | RichTextComponentPlain | RichTextComponentBold | RichTextComponentItalic | RichTextComponentUnderline | RichTextComponentStrikethrough | RichTextComponentFixed | RichTextComponentLink | RichTextComponentEmailLink | RichTextComponentConcatenate | RichTextComponentSubscript | RichTextComponentSuperscript | RichTextComponentMarked | RichTextComponentPhoneNumberLink | RichTextComponentPhoto | RichTextComponentAnchor | RichTextComponentMath | RichTextComponentCustomEmoji | RichTextComponentSpoiler | RichTextComponentMention | RichTextComponentHashtag | RichTextComponentBotCommand | RichTextComponentCashtag | RichTextComponentUrl | RichTextComponentEmail | RichTextComponentPhone | RichTextComponentBankCard | RichTextComponentTextMention | RichTextComponentDateTime;
|
|
266
|
+
export declare function constructRichTextComponent(rt: Api.RichText, photos: Api.Photo[]): RichTextComponent;
|
|
267
|
+
export declare function richTextComponentToTlObject(rtc: RichTextComponent): Api.RichText;
|
|
268
|
+
//# sourceMappingURL=3_rich_text_component.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"3_rich_text_component.d.ts","sourceRoot":"","sources":["../../src/types/3_rich_text_component.ts"],"names":[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BAA4B,GAAG,0BAA0B,GAAG,4BAA4B,GAAG,uBAAuB,GAAG,gCAAgC,GAAG,sBAAsB,GAAG,uBAAuB,GAAG,qBAAqB,GAAG,4BAA4B,GAAG,wBAAwB,GAAG,wBAAwB,GAAG,wBAAwB,GAAG,2BAA2B,GAAG,wBAAwB,GAAG,oBAAoB,GAAG,sBAAsB,GAAG,sBAAsB,GAAG,yBAAyB,GAAG,4BAA4B,GAAG,yBAAyB,CAAC;AAE1zB,wBAAgB,0BAA0B,CAAC,EAAE,EAAE,GAAG,CAAC,QAAQ,EAAE,MAAM,EAAE,GAAG,CAAC,KAAK,EAAE,GAAG,iBAAiB,CAkEnG;AAED,wBAAgB,2BAA2B,CAAC,GAAG,EAAE,iBAAiB,GAAG,GAAG,CAAC,QAAQ,CAqEhF"}
|
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* MTKruto - Cross-runtime JavaScript library for building Telegram clients
|
|
4
|
+
* Copyright (C) 2023-2026 Roj <https://roj.im/>
|
|
5
|
+
*
|
|
6
|
+
* This file is part of MTKruto.
|
|
7
|
+
*
|
|
8
|
+
* This program is free software: you can redistribute it and/or modify
|
|
9
|
+
* it under the terms of the GNU Lesser General Public License as published by
|
|
10
|
+
* the Free Software Foundation, either version 3 of the License, or
|
|
11
|
+
* (at your option) any later version.
|
|
12
|
+
*
|
|
13
|
+
* This program is distributed in the hope that it will be useful,
|
|
14
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
15
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
16
|
+
* GNU Lesser General Public License for more details.
|
|
17
|
+
*
|
|
18
|
+
* You should have received a copy of the GNU Lesser General Public License
|
|
19
|
+
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
20
|
+
*/
|
|
21
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
22
|
+
exports.constructRichTextComponent = constructRichTextComponent;
|
|
23
|
+
exports.richTextComponentToTlObject = richTextComponentToTlObject;
|
|
24
|
+
const _0_deps_js_1 = require("../0_deps.js");
|
|
25
|
+
const _1_utilities_js_1 = require("../1_utilities.js");
|
|
26
|
+
const _2_tl_js_1 = require("../2_tl.js");
|
|
27
|
+
const _file_id_js_1 = require("./_file_id.js");
|
|
28
|
+
const _1_photo_js_1 = require("./1_photo.js");
|
|
29
|
+
const _2_message_entity_js_1 = require("./2_message_entity.js");
|
|
30
|
+
function constructRichTextComponent(rt, photos) {
|
|
31
|
+
switch (rt._) {
|
|
32
|
+
case "textMention":
|
|
33
|
+
return { type: "mention", text: constructRichTextComponent(rt.text, photos) };
|
|
34
|
+
case "textEmpty":
|
|
35
|
+
return { type: "empty" };
|
|
36
|
+
case "textPlain":
|
|
37
|
+
return { type: "plain", text: rt.text };
|
|
38
|
+
case "textBold":
|
|
39
|
+
return { type: "bold", text: constructRichTextComponent(rt.text, photos) };
|
|
40
|
+
case "textItalic":
|
|
41
|
+
return { type: "italic", text: constructRichTextComponent(rt.text, photos) };
|
|
42
|
+
case "textUnderline":
|
|
43
|
+
return { type: "underline", text: constructRichTextComponent(rt.text, photos) };
|
|
44
|
+
case "textStrike":
|
|
45
|
+
return { type: "strikethrough", text: constructRichTextComponent(rt.text, photos) };
|
|
46
|
+
case "textFixed":
|
|
47
|
+
return { type: "fixed", text: constructRichTextComponent(rt.text, photos) };
|
|
48
|
+
case "textUrl":
|
|
49
|
+
return { type: "link", url: rt.url, linkPreviewId: String(rt.webpage_id), text: constructRichTextComponent(rt.text, photos) };
|
|
50
|
+
case "textEmail":
|
|
51
|
+
return { type: "emailLink", email: rt.email, text: constructRichTextComponent(rt.text, photos) };
|
|
52
|
+
case "textConcat":
|
|
53
|
+
return { type: "concatenate", components: rt.texts.map((v) => constructRichTextComponent(v, photos)) };
|
|
54
|
+
case "textSubscript":
|
|
55
|
+
return { type: "subscript", text: constructRichTextComponent(rt.text, photos) };
|
|
56
|
+
case "textSuperscript":
|
|
57
|
+
return { type: "superscript", text: constructRichTextComponent(rt.text, photos) };
|
|
58
|
+
case "textMarked":
|
|
59
|
+
return { type: "marked", text: constructRichTextComponent(rt.text, photos) };
|
|
60
|
+
case "textPhone":
|
|
61
|
+
return { type: "phoneNumberLink", phoneNumber: rt.phone, text: constructRichTextComponent(rt.text, photos) };
|
|
62
|
+
case "textImage": {
|
|
63
|
+
const photo = _2_tl_js_1.Api.as("photo", photos.find((v) => v.id === rt.document_id));
|
|
64
|
+
const fileId = (0, _1_photo_js_1.constructPhoto)(photo).fileId;
|
|
65
|
+
return { type: "photo", fileId, width: rt.w, height: rt.h };
|
|
66
|
+
}
|
|
67
|
+
case "textAnchor":
|
|
68
|
+
return { type: "anchor", name: rt.name, text: constructRichTextComponent(rt.text, photos) };
|
|
69
|
+
case "textMath":
|
|
70
|
+
return { type: "math", code: rt.source };
|
|
71
|
+
case "textCustomEmoji":
|
|
72
|
+
return { type: "customEmoji", customEmojiId: String(rt.document_id), alt: rt.alt };
|
|
73
|
+
case "textSpoiler":
|
|
74
|
+
return { type: "spoiler", text: constructRichTextComponent(rt.text, photos) };
|
|
75
|
+
case "textHashtag":
|
|
76
|
+
return { type: "hashtag", text: constructRichTextComponent(rt.text, photos) };
|
|
77
|
+
case "textBotCommand":
|
|
78
|
+
return { type: "botCommand", text: constructRichTextComponent(rt.text, photos) };
|
|
79
|
+
case "textCashtag":
|
|
80
|
+
return { type: "cashtag", text: constructRichTextComponent(rt.text, photos) };
|
|
81
|
+
case "textAutoUrl":
|
|
82
|
+
return { type: "url", text: constructRichTextComponent(rt.text, photos) };
|
|
83
|
+
case "textAutoEmail":
|
|
84
|
+
return { type: "email", text: constructRichTextComponent(rt.text, photos) };
|
|
85
|
+
case "textAutoPhone":
|
|
86
|
+
return { type: "phoneNumber", text: constructRichTextComponent(rt.text, photos) };
|
|
87
|
+
case "textBankCard":
|
|
88
|
+
return { type: "bankCard", text: constructRichTextComponent(rt.text, photos) };
|
|
89
|
+
case "textMentionName":
|
|
90
|
+
return { type: "textMention", userId: Number(rt.user_id), text: constructRichTextComponent(rt.text, photos) };
|
|
91
|
+
case "textDate":
|
|
92
|
+
return (0, _1_utilities_js_1.cleanObject)({ type: "dateTime", isRelative: !!rt.relative, format: (0, _2_message_entity_js_1.constructDateTimeFormat)(rt) || undefined, date: rt.date, text: constructRichTextComponent(rt.text, photos) });
|
|
93
|
+
}
|
|
94
|
+
(0, _0_deps_js_1.unreachable)();
|
|
95
|
+
}
|
|
96
|
+
function richTextComponentToTlObject(rtc) {
|
|
97
|
+
switch (rtc.type) {
|
|
98
|
+
case "empty":
|
|
99
|
+
return { _: "textEmpty" };
|
|
100
|
+
case "plain":
|
|
101
|
+
return { _: "textPlain", text: rtc.text };
|
|
102
|
+
case "bold":
|
|
103
|
+
return { _: "textBold", text: richTextComponentToTlObject(rtc.text) };
|
|
104
|
+
case "italic":
|
|
105
|
+
return { _: "textItalic", text: richTextComponentToTlObject(rtc.text) };
|
|
106
|
+
case "underline":
|
|
107
|
+
return { _: "textUnderline", text: richTextComponentToTlObject(rtc.text) };
|
|
108
|
+
case "strikethrough":
|
|
109
|
+
return { _: "textStrike", text: richTextComponentToTlObject(rtc.text) };
|
|
110
|
+
case "fixed":
|
|
111
|
+
return { _: "textFixed", text: richTextComponentToTlObject(rtc.text) };
|
|
112
|
+
case "link":
|
|
113
|
+
return { _: "textUrl", url: rtc.url, webpage_id: BigInt(rtc.linkPreviewId), text: richTextComponentToTlObject(rtc.text) };
|
|
114
|
+
case "emailLink":
|
|
115
|
+
return { _: "textEmail", email: rtc.email, text: richTextComponentToTlObject(rtc.text) };
|
|
116
|
+
case "concatenate":
|
|
117
|
+
return { _: "textConcat", texts: rtc.components.map(richTextComponentToTlObject) };
|
|
118
|
+
case "subscript":
|
|
119
|
+
return { _: "textSubscript", text: richTextComponentToTlObject(rtc.text) };
|
|
120
|
+
case "superscript":
|
|
121
|
+
return { _: "textSuperscript", text: richTextComponentToTlObject(rtc.text) };
|
|
122
|
+
case "marked":
|
|
123
|
+
return { _: "textMarked", text: richTextComponentToTlObject(rtc.text) };
|
|
124
|
+
case "phoneNumberLink":
|
|
125
|
+
return { _: "textPhone", phone: rtc.phoneNumber, text: richTextComponentToTlObject(rtc.text) };
|
|
126
|
+
case "photo": {
|
|
127
|
+
const fileId = (0, _file_id_js_1.deserializeFileId)(rtc.fileId);
|
|
128
|
+
if (!("id" in fileId.location)) {
|
|
129
|
+
(0, _0_deps_js_1.unreachable)();
|
|
130
|
+
}
|
|
131
|
+
return { _: "textImage", document_id: fileId.location.id, w: rtc.width, h: rtc.height };
|
|
132
|
+
}
|
|
133
|
+
case "anchor":
|
|
134
|
+
return { _: "textAnchor", name: rtc.name, text: richTextComponentToTlObject(rtc.text) };
|
|
135
|
+
case "math":
|
|
136
|
+
return { _: "textMath", source: rtc.code };
|
|
137
|
+
case "customEmoji":
|
|
138
|
+
return { _: "textCustomEmoji", document_id: BigInt(rtc.customEmojiId), alt: rtc.alt };
|
|
139
|
+
case "spoiler":
|
|
140
|
+
return { _: "textSpoiler", text: richTextComponentToTlObject(rtc.text) };
|
|
141
|
+
case "mention":
|
|
142
|
+
return { _: "textMention", text: richTextComponentToTlObject(rtc.text) };
|
|
143
|
+
case "hashtag":
|
|
144
|
+
return { _: "textHashtag", text: richTextComponentToTlObject(rtc.text) };
|
|
145
|
+
case "botCommand":
|
|
146
|
+
return { _: "textBotCommand", text: richTextComponentToTlObject(rtc.text) };
|
|
147
|
+
case "cashtag":
|
|
148
|
+
return { _: "textCashtag", text: richTextComponentToTlObject(rtc.text) };
|
|
149
|
+
case "url":
|
|
150
|
+
return { _: "textAutoUrl", text: richTextComponentToTlObject(rtc.text) };
|
|
151
|
+
case "email":
|
|
152
|
+
return { _: "textAutoEmail", text: richTextComponentToTlObject(rtc.text) };
|
|
153
|
+
case "phoneNumber":
|
|
154
|
+
return { _: "textAutoPhone", text: richTextComponentToTlObject(rtc.text) };
|
|
155
|
+
case "bankCard":
|
|
156
|
+
return { _: "textBankCard", text: richTextComponentToTlObject(rtc.text) };
|
|
157
|
+
case "textMention":
|
|
158
|
+
return { _: "textMentionName", text: richTextComponentToTlObject(rtc.text), user_id: BigInt(rtc.userId) };
|
|
159
|
+
case "dateTime": {
|
|
160
|
+
const obj = { _: "textDate", text: richTextComponentToTlObject(rtc.text), date: rtc.date };
|
|
161
|
+
(0, _2_message_entity_js_1.timeFormatToTlObject)(rtc.format ?? "", obj);
|
|
162
|
+
return obj;
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
}
|