@mtkruto/node 0.1.200 → 0.1.289
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/COPYING +674 -0
- package/esm/0_deps.d.ts +20 -1
- package/esm/0_deps.js +21 -1
- package/esm/0_errors.d.ts +19 -0
- package/esm/0_errors.js +19 -0
- package/esm/1_utilities.d.ts +20 -1
- package/esm/1_utilities.js +20 -1
- package/esm/2_connection.d.ts +19 -0
- package/esm/2_connection.js +19 -0
- package/esm/2_tl.d.ts +19 -0
- package/esm/2_tl.js +19 -0
- package/esm/3_errors.d.ts +19 -0
- package/esm/3_errors.js +19 -0
- package/esm/3_storage.d.ts +19 -0
- package/esm/3_storage.js +19 -0
- package/esm/3_transport.d.ts +19 -0
- package/esm/3_transport.js +19 -0
- package/esm/3_types.d.ts +19 -0
- package/esm/3_types.js +19 -0
- package/esm/4_constants.js +19 -0
- package/esm/4_errors.d.ts +19 -0
- package/esm/4_errors.js +22 -3
- package/esm/5_client.d.ts +19 -0
- package/esm/5_client.js +19 -0
- package/esm/client/0_client_abstract.d.ts +19 -0
- package/esm/client/0_client_abstract.js +19 -0
- package/esm/client/0_filters.d.ts +19 -0
- package/esm/client/0_filters.js +19 -0
- package/esm/client/0_html.d.ts +19 -0
- package/esm/client/0_html.js +19 -0
- package/esm/client/0_markdown.js +5 -5
- package/esm/client/0_message.d.ts +19 -0
- package/esm/client/0_message.js +19 -0
- package/esm/client/0_params.d.ts +19 -0
- package/esm/client/0_params.js +19 -0
- package/esm/client/0_password.js +19 -0
- package/esm/client/0_types.d.ts +19 -0
- package/esm/client/0_types.js +19 -0
- package/esm/client/0_utilities.d.ts +7 -0
- package/esm/client/0_utilities.js +66 -4
- package/esm/client/1_account_manager.d.ts +19 -0
- package/esm/client/1_account_manager.js +23 -4
- package/esm/client/1_bot_info_manager.d.ts +19 -0
- package/esm/client/1_bot_info_manager.js +19 -0
- package/esm/client/1_business_connection_manager.d.ts +19 -0
- package/esm/client/1_business_connection_manager.js +19 -0
- package/esm/client/1_client_encrypted.d.ts +19 -0
- package/esm/client/1_client_encrypted.js +23 -4
- package/esm/client/1_client_plain.d.ts +19 -0
- package/esm/client/1_client_plain.js +22 -3
- package/esm/client/1_composer.d.ts +19 -0
- package/esm/client/1_composer.js +19 -0
- package/esm/client/1_file_manager.d.ts +19 -0
- package/esm/client/1_file_manager.js +25 -5
- package/esm/client/1_network_statistics_manager.d.ts +19 -0
- package/esm/client/1_network_statistics_manager.js +19 -0
- package/esm/client/1_reaction_manager.d.ts +19 -0
- package/esm/client/1_reaction_manager.js +21 -2
- package/esm/client/1_update_manager.d.ts +19 -0
- package/esm/client/1_update_manager.js +28 -8
- package/esm/client/2_message_manager.d.ts +19 -0
- package/esm/client/2_message_manager.js +66 -24
- package/esm/client/3_callback_query_manager.d.ts +19 -0
- package/esm/client/3_callback_query_manager.js +21 -0
- package/esm/client/3_chat_list_manager.d.ts +19 -0
- package/esm/client/3_chat_list_manager.js +32 -12
- package/esm/client/3_inline_query_manager.d.ts +19 -0
- package/esm/client/3_inline_query_manager.js +23 -2
- package/esm/client/3_story_manager.d.ts +19 -0
- package/esm/client/3_story_manager.js +26 -5
- package/esm/client/4_client.d.ts +24 -8
- package/esm/client/4_client.js +40 -29
- package/esm/connection/0_connection.d.ts +19 -0
- package/esm/connection/0_connection.js +19 -0
- package/esm/connection/1_connection_web_socket.js +22 -2
- package/esm/deps/deno.land/x/{tgcrypto@0.3.3 → tgcrypto@0.4.0}/mod.d.ts +0 -1
- package/esm/deps/deno.land/x/{tgcrypto@0.3.3 → tgcrypto@0.4.0}/mod.js +0 -11
- package/esm/deps/deno.land/x/tgcrypto@0.4.0/tgcrypto.js +308 -0
- package/esm/mod.d.ts +20 -1
- package/esm/mod.js +20 -1
- package/esm/storage/0_storage.d.ts +19 -0
- package/esm/storage/0_storage.js +25 -5
- package/esm/storage/1_utilities.d.ts +19 -1
- package/esm/storage/1_utilities.js +21 -3
- package/esm/storage/2_storage_indexed_db.d.ts +19 -0
- package/esm/storage/2_storage_indexed_db.js +19 -0
- package/esm/storage/2_storage_local_storage.d.ts +19 -0
- package/esm/storage/2_storage_local_storage.js +20 -4
- package/esm/storage/2_storage_memory.d.ts +19 -0
- package/esm/storage/2_storage_memory.js +19 -0
- package/esm/storage/2_storage_session_storage.d.ts +19 -0
- package/esm/storage/2_storage_session_storage.js +20 -4
- package/esm/tl/0_tl_raw_reader.d.ts +19 -0
- package/esm/tl/0_tl_raw_reader.js +19 -0
- package/esm/tl/0_tl_raw_writer.d.ts +19 -0
- package/esm/tl/0_tl_raw_writer.js +19 -0
- package/esm/tl/1_tl_object.d.ts +19 -0
- package/esm/tl/1_tl_object.js +19 -0
- package/esm/tl/2_types.d.ts +19 -0
- package/esm/tl/2_types.js +19 -0
- package/esm/tl/3_deserialize.d.ts +19 -0
- package/esm/tl/3_deserialize.js +19 -0
- package/esm/tl/3_functions.d.ts +19 -0
- package/esm/tl/3_functions.js +19 -0
- package/esm/tl/3_utilities.d.ts +19 -0
- package/esm/tl/3_utilities.js +24 -4
- package/esm/tl/4_tl_reader.d.ts +19 -0
- package/esm/tl/4_tl_reader.js +19 -0
- package/esm/tl/5_tl_writer.d.ts +19 -0
- package/esm/tl/5_tl_writer.js +19 -0
- package/esm/tl/6_rpc_result.d.ts +19 -0
- package/esm/tl/6_rpc_result.js +19 -0
- package/esm/tl/7_message.d.ts +19 -0
- package/esm/tl/7_message.js +19 -0
- package/esm/tl/8_message_container.d.ts +19 -0
- package/esm/tl/8_message_container.js +19 -0
- package/esm/transport/0_obfuscation.js +19 -0
- package/esm/transport/0_transport.d.ts +19 -0
- package/esm/transport/0_transport.js +19 -0
- package/esm/transport/1_transport_abridged.d.ts +19 -0
- package/esm/transport/1_transport_abridged.js +19 -0
- package/esm/transport/1_transport_intermediate.d.ts +19 -0
- package/esm/transport/1_transport_intermediate.js +19 -0
- package/esm/transport/2_transport_provider.d.ts +19 -0
- package/esm/transport/2_transport_provider.js +23 -4
- package/esm/transport/3_transport_provider_web_socket.d.ts +19 -0
- package/esm/transport/3_transport_provider_web_socket.js +19 -0
- package/esm/types/0_authorization_state.d.ts +19 -0
- package/esm/types/0_authorization_state.js +19 -0
- package/esm/types/0_bot_command.d.ts +19 -0
- package/esm/types/0_bot_command.js +19 -0
- package/esm/types/0_chat_action.d.ts +19 -0
- package/esm/types/0_chat_action.js +19 -0
- package/esm/types/0_chat_administrator_rights.d.ts +19 -0
- package/esm/types/0_chat_administrator_rights.js +19 -0
- package/esm/types/0_chat_member_rights.d.ts +19 -0
- package/esm/types/0_chat_member_rights.js +19 -0
- package/esm/types/0_chat_photo.d.ts +19 -1
- package/esm/types/0_chat_photo.js +19 -2
- package/esm/types/0_connection_state.d.ts +19 -0
- package/esm/types/0_connection_state.js +19 -0
- package/esm/types/0_contact.d.ts +19 -0
- package/esm/types/0_contact.js +19 -0
- package/esm/types/0_dice.d.ts +19 -0
- package/esm/types/0_dice.js +19 -0
- package/esm/types/0_file_source.d.ts +19 -0
- package/esm/types/0_file_source.js +19 -0
- package/esm/types/0_giveaway_parameters.d.ts +19 -0
- package/esm/types/0_giveaway_parameters.js +19 -0
- package/esm/types/0_id.d.ts +19 -0
- package/esm/types/0_id.js +19 -0
- package/esm/types/0_keyboard_button_poll_type.d.ts +19 -0
- package/esm/types/0_keyboard_button_poll_type.js +19 -0
- package/esm/types/0_link_preview.d.ts +19 -0
- package/esm/types/0_link_preview.js +19 -0
- package/esm/types/0_location.d.ts +19 -0
- package/esm/types/0_location.js +19 -0
- package/esm/types/0_login_url.d.ts +19 -0
- package/esm/types/0_login_url.js +19 -0
- package/esm/types/0_mask_position.d.ts +19 -0
- package/esm/types/0_mask_position.js +19 -0
- package/esm/types/0_message_entity.d.ts +19 -0
- package/esm/types/0_message_entity.js +22 -3
- package/esm/types/0_message_reference.d.ts +19 -0
- package/esm/types/0_message_reference.js +19 -0
- package/esm/types/0_message_search_filter.d.ts +19 -0
- package/esm/types/0_message_search_filter.js +21 -2
- package/esm/types/0_mini_app_info.d.ts +19 -0
- package/esm/types/0_mini_app_info.js +19 -0
- package/esm/types/0_network_statistics_entry.d.ts +19 -0
- package/esm/types/0_network_statistics_entry.js +19 -0
- package/esm/types/0_parse_mode.d.ts +19 -0
- package/esm/types/0_parse_mode.js +19 -0
- package/esm/types/0_poll_option.d.ts +19 -0
- package/esm/types/0_poll_option.js +19 -0
- package/esm/types/0_price_tag.d.ts +19 -0
- package/esm/types/0_price_tag.js +19 -0
- package/esm/types/0_reaction.d.ts +19 -0
- package/esm/types/0_reaction.js +21 -2
- package/esm/types/0_restriction_reason.d.ts +19 -0
- package/esm/types/0_restriction_reason.js +19 -0
- package/esm/types/0_story_reference.d.ts +19 -0
- package/esm/types/0_story_reference.js +19 -0
- package/esm/types/0_thumbnail.d.ts +19 -0
- package/esm/types/0_thumbnail.js +19 -0
- package/esm/types/0_voice.d.ts +19 -0
- package/esm/types/0_voice.js +19 -0
- package/esm/types/1_animation.d.ts +19 -0
- package/esm/types/1_animation.js +19 -0
- package/esm/types/1_audio.d.ts +19 -0
- package/esm/types/1_audio.js +19 -0
- package/esm/types/1_bot_command_scope.d.ts +19 -0
- package/esm/types/1_bot_command_scope.js +22 -3
- package/esm/types/1_chat_p.d.ts +19 -0
- package/esm/types/1_chat_p.js +22 -2
- package/esm/types/1_document.d.ts +19 -0
- package/esm/types/1_document.js +19 -0
- package/esm/types/1_giveaway.d.ts +19 -0
- package/esm/types/1_giveaway.js +19 -0
- package/esm/types/1_inline_query_result_button.d.ts +19 -0
- package/esm/types/1_inline_query_result_button.js +19 -0
- package/esm/types/1_input_message_content.d.ts +19 -0
- package/esm/types/1_input_message_content.js +19 -0
- package/esm/types/1_input_story_content.d.ts +19 -0
- package/esm/types/1_input_story_content.js +19 -0
- package/esm/types/1_keyboard_button.d.ts +19 -0
- package/esm/types/1_keyboard_button.js +22 -3
- package/esm/types/1_message_reaction.d.ts +19 -0
- package/esm/types/1_message_reaction.js +21 -2
- package/esm/types/1_network_statistics.d.ts +19 -0
- package/esm/types/1_network_statistics.js +19 -0
- package/esm/types/1_photo.d.ts +19 -0
- package/esm/types/1_photo.js +19 -0
- package/esm/types/1_poll.d.ts +19 -0
- package/esm/types/1_poll.js +19 -0
- package/esm/types/1_reaction_count.d.ts +19 -0
- package/esm/types/1_reaction_count.js +19 -0
- package/esm/types/1_reply_quote.d.ts +19 -0
- package/esm/types/1_reply_quote.js +19 -0
- package/esm/types/1_sticker.d.ts +19 -0
- package/esm/types/1_sticker.js +19 -0
- package/esm/types/1_story_privacy.d.ts +19 -0
- package/esm/types/1_story_privacy.js +22 -3
- package/esm/types/1_story_reaction.d.ts +19 -0
- package/esm/types/1_story_reaction.js +19 -0
- package/esm/types/1_user.d.ts +19 -0
- package/esm/types/1_user.js +19 -0
- package/esm/types/1_venue.d.ts +19 -0
- package/esm/types/1_venue.js +19 -0
- package/esm/types/1_video.d.ts +19 -0
- package/esm/types/1_video.js +19 -0
- package/esm/types/1_video_note.d.ts +19 -0
- package/esm/types/1_video_note.js +19 -0
- package/esm/types/2_business_connection.d.ts +19 -0
- package/esm/types/2_business_connection.js +19 -0
- package/esm/types/2_chat_member.d.ts +19 -0
- package/esm/types/2_chat_member.js +25 -5
- package/esm/types/2_chosen_inline_result.d.ts +19 -0
- package/esm/types/2_chosen_inline_result.js +22 -2
- package/esm/types/2_game.d.ts +19 -0
- package/esm/types/2_game.js +19 -0
- package/esm/types/2_inactive_chat.d.ts +19 -0
- package/esm/types/2_inactive_chat.js +22 -2
- package/esm/types/2_inline_keyboard_button.d.ts +19 -0
- package/esm/types/2_inline_keyboard_button.js +22 -3
- package/esm/types/2_inline_query.d.ts +19 -0
- package/esm/types/2_inline_query.js +22 -3
- package/esm/types/2_invite_link.d.ts +19 -0
- package/esm/types/2_invite_link.js +22 -2
- package/esm/types/2_message_interactions.d.ts +19 -0
- package/esm/types/2_message_interactions.js +19 -0
- package/esm/types/2_message_reaction_count.d.ts +19 -0
- package/esm/types/2_message_reaction_count.js +19 -0
- package/esm/types/2_message_reactions.d.ts +19 -0
- package/esm/types/2_message_reactions.js +19 -0
- package/esm/types/2_story_content.d.ts +19 -0
- package/esm/types/2_story_content.js +24 -5
- package/esm/types/2_story_interactions.d.ts +19 -0
- package/esm/types/2_story_interactions.js +19 -0
- package/esm/types/2_story_interactive_area.d.ts +19 -0
- package/esm/types/2_story_interactive_area.js +24 -5
- package/esm/types/3_chat_member_updated.d.ts +19 -0
- package/esm/types/3_chat_member_updated.js +23 -3
- package/esm/types/3_reply_markup.d.ts +19 -0
- package/esm/types/3_reply_markup.js +23 -3
- package/esm/types/3_story.d.ts +19 -0
- package/esm/types/3_story.js +22 -2
- package/esm/types/4_inline_query_result.d.ts +19 -0
- package/esm/types/4_inline_query_result.js +24 -5
- package/esm/types/4_message.d.ts +19 -0
- package/esm/types/4_message.js +36 -16
- package/esm/types/5_callback_query.d.ts +19 -0
- package/esm/types/5_callback_query.js +23 -3
- package/esm/types/5_chat.d.ts +19 -0
- package/esm/types/5_chat.js +27 -7
- package/esm/types/6_update.d.ts +19 -0
- package/esm/types/6_update.js +19 -0
- package/esm/types/_file_id.d.ts +19 -0
- package/esm/types/_file_id.js +28 -8
- package/esm/types/_getters.d.ts +19 -0
- package/esm/types/_getters.js +19 -0
- package/esm/utilities/0_bigint.d.ts +1 -0
- package/esm/utilities/0_bigint.js +44 -0
- package/esm/utilities/0_buffer.d.ts +19 -0
- package/esm/utilities/0_buffer.js +19 -0
- package/esm/utilities/0_cache_map.d.ts +19 -0
- package/esm/utilities/0_cache_map.js +19 -0
- package/esm/utilities/0_color.d.ts +19 -0
- package/esm/utilities/0_color.js +19 -0
- package/esm/utilities/0_crypto.d.ts +19 -0
- package/esm/utilities/0_crypto.js +19 -0
- package/esm/utilities/0_hash.js +19 -0
- package/esm/utilities/0_logger.d.ts +27 -0
- package/esm/utilities/0_logger.js +28 -5
- package/esm/utilities/0_mutex.d.ts +19 -0
- package/esm/utilities/0_mutex.js +19 -0
- package/esm/utilities/0_object.d.ts +19 -0
- package/esm/utilities/0_object.js +19 -0
- package/esm/utilities/0_rle.d.ts +19 -0
- package/esm/utilities/0_rle.js +19 -0
- package/esm/utilities/0_types.d.ts +19 -0
- package/esm/utilities/0_types.js +19 -0
- package/esm/utilities/1_auth.js +19 -0
- package/esm/utilities/1_base64.d.ts +19 -0
- package/esm/utilities/1_base64.js +19 -0
- package/esm/utilities/1_math.d.ts +20 -0
- package/esm/utilities/1_math.js +70 -0
- package/esm/utilities/1_misc.d.ts +19 -0
- package/esm/utilities/1_misc.js +21 -2
- package/esm/utilities/1_queue.d.ts +19 -0
- package/esm/utilities/1_queue.js +19 -0
- package/package.json +1 -1
- package/script/0_deps.d.ts +20 -1
- package/script/0_deps.js +22 -3
- package/script/0_errors.d.ts +19 -0
- package/script/0_errors.js +19 -0
- package/script/1_utilities.d.ts +20 -1
- package/script/1_utilities.js +20 -1
- package/script/2_connection.d.ts +19 -0
- package/script/2_connection.js +19 -0
- package/script/2_tl.d.ts +19 -0
- package/script/2_tl.js +19 -0
- package/script/3_errors.d.ts +19 -0
- package/script/3_errors.js +19 -0
- package/script/3_storage.d.ts +19 -0
- package/script/3_storage.js +19 -0
- package/script/3_transport.d.ts +19 -0
- package/script/3_transport.js +19 -0
- package/script/3_types.d.ts +19 -0
- package/script/3_types.js +19 -0
- package/script/4_constants.js +19 -0
- package/script/4_errors.d.ts +19 -0
- package/script/4_errors.js +22 -3
- package/script/5_client.d.ts +19 -0
- package/script/5_client.js +19 -0
- package/script/client/0_client_abstract.d.ts +19 -0
- package/script/client/0_client_abstract.js +19 -0
- package/script/client/0_filters.d.ts +19 -0
- package/script/client/0_filters.js +19 -0
- package/script/client/0_html.d.ts +19 -0
- package/script/client/0_html.js +19 -0
- package/script/client/0_markdown.js +5 -5
- package/script/client/0_message.d.ts +19 -0
- package/script/client/0_message.js +19 -0
- package/script/client/0_params.d.ts +19 -0
- package/script/client/0_params.js +19 -0
- package/script/client/0_password.js +19 -0
- package/script/client/0_types.d.ts +19 -0
- package/script/client/0_types.js +19 -0
- package/script/client/0_utilities.d.ts +7 -0
- package/script/client/0_utilities.js +73 -4
- package/script/client/1_account_manager.d.ts +19 -0
- package/script/client/1_account_manager.js +23 -4
- package/script/client/1_bot_info_manager.d.ts +19 -0
- package/script/client/1_bot_info_manager.js +19 -0
- package/script/client/1_business_connection_manager.d.ts +19 -0
- package/script/client/1_business_connection_manager.js +19 -0
- package/script/client/1_client_encrypted.d.ts +19 -0
- package/script/client/1_client_encrypted.js +21 -2
- package/script/client/1_client_plain.d.ts +19 -0
- package/script/client/1_client_plain.js +21 -2
- package/script/client/1_composer.d.ts +19 -0
- package/script/client/1_composer.js +19 -0
- package/script/client/1_file_manager.d.ts +19 -0
- package/script/client/1_file_manager.js +24 -4
- package/script/client/1_network_statistics_manager.d.ts +19 -0
- package/script/client/1_network_statistics_manager.js +19 -0
- package/script/client/1_reaction_manager.d.ts +19 -0
- package/script/client/1_reaction_manager.js +21 -2
- package/script/client/1_update_manager.d.ts +19 -0
- package/script/client/1_update_manager.js +27 -7
- package/script/client/2_message_manager.d.ts +19 -0
- package/script/client/2_message_manager.js +70 -28
- package/script/client/3_callback_query_manager.d.ts +19 -0
- package/script/client/3_callback_query_manager.js +21 -0
- package/script/client/3_chat_list_manager.d.ts +19 -0
- package/script/client/3_chat_list_manager.js +31 -11
- package/script/client/3_inline_query_manager.d.ts +19 -0
- package/script/client/3_inline_query_manager.js +23 -2
- package/script/client/3_story_manager.d.ts +19 -0
- package/script/client/3_story_manager.js +23 -2
- package/script/client/4_client.d.ts +24 -8
- package/script/client/4_client.js +38 -27
- package/script/connection/0_connection.d.ts +19 -0
- package/script/connection/0_connection.js +19 -0
- package/script/connection/1_connection_web_socket.js +21 -1
- package/script/deps/deno.land/x/{tgcrypto@0.3.3 → tgcrypto@0.4.0}/mod.d.ts +0 -1
- package/script/deps/deno.land/x/{tgcrypto@0.3.3 → tgcrypto@0.4.0}/mod.js +1 -13
- package/script/deps/deno.land/x/tgcrypto@0.4.0/tgcrypto.js +310 -0
- package/script/mod.d.ts +20 -1
- package/script/mod.js +21 -1
- package/script/storage/0_storage.d.ts +19 -0
- package/script/storage/0_storage.js +24 -4
- package/script/storage/1_utilities.d.ts +19 -1
- package/script/storage/1_utilities.js +22 -4
- package/script/storage/2_storage_indexed_db.d.ts +19 -0
- package/script/storage/2_storage_indexed_db.js +19 -0
- package/script/storage/2_storage_local_storage.d.ts +19 -0
- package/script/storage/2_storage_local_storage.js +19 -3
- package/script/storage/2_storage_memory.d.ts +19 -0
- package/script/storage/2_storage_memory.js +19 -0
- package/script/storage/2_storage_session_storage.d.ts +19 -0
- package/script/storage/2_storage_session_storage.js +19 -3
- package/script/tl/0_tl_raw_reader.d.ts +19 -0
- package/script/tl/0_tl_raw_reader.js +19 -0
- package/script/tl/0_tl_raw_writer.d.ts +19 -0
- package/script/tl/0_tl_raw_writer.js +19 -0
- package/script/tl/1_tl_object.d.ts +19 -0
- package/script/tl/1_tl_object.js +19 -0
- package/script/tl/2_types.d.ts +19 -0
- package/script/tl/2_types.js +19 -0
- package/script/tl/3_deserialize.d.ts +19 -0
- package/script/tl/3_deserialize.js +19 -0
- package/script/tl/3_functions.d.ts +19 -0
- package/script/tl/3_functions.js +19 -0
- package/script/tl/3_utilities.d.ts +19 -0
- package/script/tl/3_utilities.js +23 -3
- package/script/tl/4_tl_reader.d.ts +19 -0
- package/script/tl/4_tl_reader.js +19 -0
- package/script/tl/5_tl_writer.d.ts +19 -0
- package/script/tl/5_tl_writer.js +19 -0
- package/script/tl/6_rpc_result.d.ts +19 -0
- package/script/tl/6_rpc_result.js +19 -0
- package/script/tl/7_message.d.ts +19 -0
- package/script/tl/7_message.js +19 -0
- package/script/tl/8_message_container.d.ts +19 -0
- package/script/tl/8_message_container.js +19 -0
- package/script/transport/0_obfuscation.js +19 -0
- package/script/transport/0_transport.d.ts +19 -0
- package/script/transport/0_transport.js +19 -0
- package/script/transport/1_transport_abridged.d.ts +19 -0
- package/script/transport/1_transport_abridged.js +19 -0
- package/script/transport/1_transport_intermediate.d.ts +19 -0
- package/script/transport/1_transport_intermediate.js +19 -0
- package/script/transport/2_transport_provider.d.ts +19 -0
- package/script/transport/2_transport_provider.js +23 -4
- package/script/transport/3_transport_provider_web_socket.d.ts +19 -0
- package/script/transport/3_transport_provider_web_socket.js +19 -0
- package/script/types/0_authorization_state.d.ts +19 -0
- package/script/types/0_authorization_state.js +19 -0
- package/script/types/0_bot_command.d.ts +19 -0
- package/script/types/0_bot_command.js +19 -0
- package/script/types/0_chat_action.d.ts +19 -0
- package/script/types/0_chat_action.js +19 -0
- package/script/types/0_chat_administrator_rights.d.ts +19 -0
- package/script/types/0_chat_administrator_rights.js +19 -0
- package/script/types/0_chat_member_rights.d.ts +19 -0
- package/script/types/0_chat_member_rights.js +19 -0
- package/script/types/0_chat_photo.d.ts +19 -1
- package/script/types/0_chat_photo.js +19 -2
- package/script/types/0_connection_state.d.ts +19 -0
- package/script/types/0_connection_state.js +19 -0
- package/script/types/0_contact.d.ts +19 -0
- package/script/types/0_contact.js +19 -0
- package/script/types/0_dice.d.ts +19 -0
- package/script/types/0_dice.js +19 -0
- package/script/types/0_file_source.d.ts +19 -0
- package/script/types/0_file_source.js +19 -0
- package/script/types/0_giveaway_parameters.d.ts +19 -0
- package/script/types/0_giveaway_parameters.js +19 -0
- package/script/types/0_id.d.ts +19 -0
- package/script/types/0_id.js +19 -0
- package/script/types/0_keyboard_button_poll_type.d.ts +19 -0
- package/script/types/0_keyboard_button_poll_type.js +19 -0
- package/script/types/0_link_preview.d.ts +19 -0
- package/script/types/0_link_preview.js +19 -0
- package/script/types/0_location.d.ts +19 -0
- package/script/types/0_location.js +19 -0
- package/script/types/0_login_url.d.ts +19 -0
- package/script/types/0_login_url.js +19 -0
- package/script/types/0_mask_position.d.ts +19 -0
- package/script/types/0_mask_position.js +19 -0
- package/script/types/0_message_entity.d.ts +19 -0
- package/script/types/0_message_entity.js +22 -3
- package/script/types/0_message_reference.d.ts +19 -0
- package/script/types/0_message_reference.js +19 -0
- package/script/types/0_message_search_filter.d.ts +19 -0
- package/script/types/0_message_search_filter.js +21 -2
- package/script/types/0_mini_app_info.d.ts +19 -0
- package/script/types/0_mini_app_info.js +19 -0
- package/script/types/0_network_statistics_entry.d.ts +19 -0
- package/script/types/0_network_statistics_entry.js +19 -0
- package/script/types/0_parse_mode.d.ts +19 -0
- package/script/types/0_parse_mode.js +19 -0
- package/script/types/0_poll_option.d.ts +19 -0
- package/script/types/0_poll_option.js +19 -0
- package/script/types/0_price_tag.d.ts +19 -0
- package/script/types/0_price_tag.js +19 -0
- package/script/types/0_reaction.d.ts +19 -0
- package/script/types/0_reaction.js +21 -2
- package/script/types/0_restriction_reason.d.ts +19 -0
- package/script/types/0_restriction_reason.js +19 -0
- package/script/types/0_story_reference.d.ts +19 -0
- package/script/types/0_story_reference.js +19 -0
- package/script/types/0_thumbnail.d.ts +19 -0
- package/script/types/0_thumbnail.js +19 -0
- package/script/types/0_voice.d.ts +19 -0
- package/script/types/0_voice.js +19 -0
- package/script/types/1_animation.d.ts +19 -0
- package/script/types/1_animation.js +19 -0
- package/script/types/1_audio.d.ts +19 -0
- package/script/types/1_audio.js +19 -0
- package/script/types/1_bot_command_scope.d.ts +19 -0
- package/script/types/1_bot_command_scope.js +22 -3
- package/script/types/1_chat_p.d.ts +19 -0
- package/script/types/1_chat_p.js +21 -1
- package/script/types/1_document.d.ts +19 -0
- package/script/types/1_document.js +19 -0
- package/script/types/1_giveaway.d.ts +19 -0
- package/script/types/1_giveaway.js +19 -0
- package/script/types/1_inline_query_result_button.d.ts +19 -0
- package/script/types/1_inline_query_result_button.js +19 -0
- package/script/types/1_input_message_content.d.ts +19 -0
- package/script/types/1_input_message_content.js +19 -0
- package/script/types/1_input_story_content.d.ts +19 -0
- package/script/types/1_input_story_content.js +19 -0
- package/script/types/1_keyboard_button.d.ts +19 -0
- package/script/types/1_keyboard_button.js +22 -3
- package/script/types/1_message_reaction.d.ts +19 -0
- package/script/types/1_message_reaction.js +21 -2
- package/script/types/1_network_statistics.d.ts +19 -0
- package/script/types/1_network_statistics.js +19 -0
- package/script/types/1_photo.d.ts +19 -0
- package/script/types/1_photo.js +19 -0
- package/script/types/1_poll.d.ts +19 -0
- package/script/types/1_poll.js +19 -0
- package/script/types/1_reaction_count.d.ts +19 -0
- package/script/types/1_reaction_count.js +19 -0
- package/script/types/1_reply_quote.d.ts +19 -0
- package/script/types/1_reply_quote.js +19 -0
- package/script/types/1_sticker.d.ts +19 -0
- package/script/types/1_sticker.js +19 -0
- package/script/types/1_story_privacy.d.ts +19 -0
- package/script/types/1_story_privacy.js +22 -3
- package/script/types/1_story_reaction.d.ts +19 -0
- package/script/types/1_story_reaction.js +19 -0
- package/script/types/1_user.d.ts +19 -0
- package/script/types/1_user.js +19 -0
- package/script/types/1_venue.d.ts +19 -0
- package/script/types/1_venue.js +19 -0
- package/script/types/1_video.d.ts +19 -0
- package/script/types/1_video.js +19 -0
- package/script/types/1_video_note.d.ts +19 -0
- package/script/types/1_video_note.js +19 -0
- package/script/types/2_business_connection.d.ts +19 -0
- package/script/types/2_business_connection.js +19 -0
- package/script/types/2_chat_member.d.ts +19 -0
- package/script/types/2_chat_member.js +24 -4
- package/script/types/2_chosen_inline_result.d.ts +19 -0
- package/script/types/2_chosen_inline_result.js +21 -1
- package/script/types/2_game.d.ts +19 -0
- package/script/types/2_game.js +19 -0
- package/script/types/2_inactive_chat.d.ts +19 -0
- package/script/types/2_inactive_chat.js +21 -1
- package/script/types/2_inline_keyboard_button.d.ts +19 -0
- package/script/types/2_inline_keyboard_button.js +22 -3
- package/script/types/2_inline_query.d.ts +19 -0
- package/script/types/2_inline_query.js +22 -3
- package/script/types/2_invite_link.d.ts +19 -0
- package/script/types/2_invite_link.js +21 -1
- package/script/types/2_message_interactions.d.ts +19 -0
- package/script/types/2_message_interactions.js +19 -0
- package/script/types/2_message_reaction_count.d.ts +19 -0
- package/script/types/2_message_reaction_count.js +19 -0
- package/script/types/2_message_reactions.d.ts +19 -0
- package/script/types/2_message_reactions.js +19 -0
- package/script/types/2_story_content.d.ts +19 -0
- package/script/types/2_story_content.js +24 -5
- package/script/types/2_story_interactions.d.ts +19 -0
- package/script/types/2_story_interactions.js +19 -0
- package/script/types/2_story_interactive_area.d.ts +19 -0
- package/script/types/2_story_interactive_area.js +24 -5
- package/script/types/3_chat_member_updated.d.ts +19 -0
- package/script/types/3_chat_member_updated.js +22 -2
- package/script/types/3_reply_markup.d.ts +19 -0
- package/script/types/3_reply_markup.js +22 -2
- package/script/types/3_story.d.ts +19 -0
- package/script/types/3_story.js +21 -1
- package/script/types/4_inline_query_result.d.ts +19 -0
- package/script/types/4_inline_query_result.js +24 -5
- package/script/types/4_message.d.ts +19 -0
- package/script/types/4_message.js +35 -15
- package/script/types/5_callback_query.d.ts +19 -0
- package/script/types/5_callback_query.js +22 -2
- package/script/types/5_chat.d.ts +19 -0
- package/script/types/5_chat.js +26 -6
- package/script/types/6_update.d.ts +19 -0
- package/script/types/6_update.js +19 -0
- package/script/types/_file_id.d.ts +19 -0
- package/script/types/_file_id.js +27 -7
- package/script/types/_getters.d.ts +19 -0
- package/script/types/_getters.js +19 -0
- package/script/utilities/0_bigint.d.ts +1 -0
- package/script/utilities/0_bigint.js +46 -1
- package/script/utilities/0_buffer.d.ts +19 -0
- package/script/utilities/0_buffer.js +19 -0
- package/script/utilities/0_cache_map.d.ts +19 -0
- package/script/utilities/0_cache_map.js +19 -0
- package/script/utilities/0_color.d.ts +19 -0
- package/script/utilities/0_color.js +19 -0
- package/script/utilities/0_crypto.d.ts +19 -0
- package/script/utilities/0_crypto.js +19 -0
- package/script/utilities/0_hash.js +19 -0
- package/script/utilities/0_logger.d.ts +27 -0
- package/script/utilities/0_logger.js +30 -6
- package/script/utilities/0_mutex.d.ts +19 -0
- package/script/utilities/0_mutex.js +19 -0
- package/script/utilities/0_object.d.ts +19 -0
- package/script/utilities/0_object.js +19 -0
- package/script/utilities/0_rle.d.ts +19 -0
- package/script/utilities/0_rle.js +19 -0
- package/script/utilities/0_types.d.ts +19 -0
- package/script/utilities/0_types.js +19 -0
- package/script/utilities/1_auth.js +19 -0
- package/script/utilities/1_base64.d.ts +19 -0
- package/script/utilities/1_base64.js +19 -0
- package/script/utilities/1_math.d.ts +20 -0
- package/script/utilities/1_math.js +74 -0
- package/script/utilities/1_misc.d.ts +19 -0
- package/script/utilities/1_misc.js +21 -2
- package/script/utilities/1_queue.d.ts +19 -0
- package/script/utilities/1_queue.js +19 -0
- package/esm/deps/deno.land/x/html_parser@v0.1.3/src/DomHandler.d.ts +0 -83
- package/esm/deps/deno.land/x/html_parser@v0.1.3/src/DomHandler.js +0 -203
- package/esm/deps/deno.land/x/html_parser@v0.1.3/src/DomSerializer.d.ts +0 -50
- package/esm/deps/deno.land/x/html_parser@v0.1.3/src/DomSerializer.js +0 -274
- package/esm/deps/deno.land/x/html_parser@v0.1.3/src/ElementType.d.ts +0 -47
- package/esm/deps/deno.land/x/html_parser@v0.1.3/src/ElementType.js +0 -51
- package/esm/deps/deno.land/x/html_parser@v0.1.3/src/FeedHandler.d.ts +0 -66
- package/esm/deps/deno.land/x/html_parser@v0.1.3/src/FeedHandler.js +0 -191
- package/esm/deps/deno.land/x/html_parser@v0.1.3/src/Node.d.ts +0 -168
- package/esm/deps/deno.land/x/html_parser@v0.1.3/src/Node.js +0 -385
- package/esm/deps/deno.land/x/html_parser@v0.1.3/src/Parser.d.ts +0 -159
- package/esm/deps/deno.land/x/html_parser@v0.1.3/src/Parser.js +0 -431
- package/esm/deps/deno.land/x/html_parser@v0.1.3/src/Tokenizer.d.ts +0 -181
- package/esm/deps/deno.land/x/html_parser@v0.1.3/src/Tokenizer.js +0 -1046
- package/esm/deps/deno.land/x/html_parser@v0.1.3/src/mod.d.ts +0 -42
- package/esm/deps/deno.land/x/html_parser@v0.1.3/src/mod.js +0 -52
- package/esm/deps/deno.land/x/html_parser@v0.1.3/src/utils/entities/decode.d.ts +0 -11
- package/esm/deps/deno.land/x/html_parser@v0.1.3/src/utils/entities/decode.js +0 -122
- package/esm/deps/deno.land/x/html_parser@v0.1.3/src/utils/entities/decode_codepoint.d.ts +0 -1
- package/esm/deps/deno.land/x/html_parser@v0.1.3/src/utils/entities/decode_codepoint.js +0 -24
- package/esm/deps/deno.land/x/html_parser@v0.1.3/src/utils/entities/encode.d.ts +0 -46
- package/esm/deps/deno.land/x/html_parser@v0.1.3/src/utils/entities/encode.js +0 -121
- package/esm/deps/deno.land/x/html_parser@v0.1.3/src/utils/entities/maps/decode.d.ts +0 -31
- package/esm/deps/deno.land/x/html_parser@v0.1.3/src/utils/entities/maps/decode.js +0 -30
- package/esm/deps/deno.land/x/html_parser@v0.1.3/src/utils/entities/maps/entities.d.ts +0 -2128
- package/esm/deps/deno.land/x/html_parser@v0.1.3/src/utils/entities/maps/entities.js +0 -2127
- package/esm/deps/deno.land/x/html_parser@v0.1.3/src/utils/entities/maps/legacy.d.ts +0 -109
- package/esm/deps/deno.land/x/html_parser@v0.1.3/src/utils/entities/maps/legacy.js +0 -108
- package/esm/deps/deno.land/x/html_parser@v0.1.3/src/utils/entities/maps/xml.d.ts +0 -8
- package/esm/deps/deno.land/x/html_parser@v0.1.3/src/utils/entities/maps/xml.js +0 -1
- package/esm/deps/deno.land/x/html_parser@v0.1.3/src/utils/entities/mod.d.ts +0 -90
- package/esm/deps/deno.land/x/html_parser@v0.1.3/src/utils/entities/mod.js +0 -95
- package/esm/deps/deno.land/x/html_parser@v0.1.3/src/utils/helpers.d.ts +0 -50
- package/esm/deps/deno.land/x/html_parser@v0.1.3/src/utils/helpers.js +0 -128
- package/esm/deps/deno.land/x/html_parser@v0.1.3/src/utils/legacy.d.ts +0 -46
- package/esm/deps/deno.land/x/html_parser@v0.1.3/src/utils/legacy.js +0 -110
- package/esm/deps/deno.land/x/html_parser@v0.1.3/src/utils/manipulation.d.ts +0 -42
- package/esm/deps/deno.land/x/html_parser@v0.1.3/src/utils/manipulation.js +0 -120
- package/esm/deps/deno.land/x/html_parser@v0.1.3/src/utils/mod.d.ts +0 -6
- package/esm/deps/deno.land/x/html_parser@v0.1.3/src/utils/mod.js +0 -6
- package/esm/deps/deno.land/x/html_parser@v0.1.3/src/utils/querying.d.ts +0 -54
- package/esm/deps/deno.land/x/html_parser@v0.1.3/src/utils/querying.js +0 -110
- package/esm/deps/deno.land/x/html_parser@v0.1.3/src/utils/stringify.d.ts +0 -40
- package/esm/deps/deno.land/x/html_parser@v0.1.3/src/utils/stringify.js +0 -75
- package/esm/deps/deno.land/x/html_parser@v0.1.3/src/utils/traversal.d.ts +0 -58
- package/esm/deps/deno.land/x/html_parser@v0.1.3/src/utils/traversal.js +0 -101
- package/esm/deps/deno.land/x/tgcrypto@0.3.3/tgcrypto.js +0 -324
- package/esm/utilities/0_control.d.ts +0 -1
- package/esm/utilities/0_control.js +0 -3
- package/script/deps/deno.land/x/html_parser@v0.1.3/src/DomHandler.d.ts +0 -83
- package/script/deps/deno.land/x/html_parser@v0.1.3/src/DomHandler.js +0 -207
- package/script/deps/deno.land/x/html_parser@v0.1.3/src/DomSerializer.d.ts +0 -50
- package/script/deps/deno.land/x/html_parser@v0.1.3/src/DomSerializer.js +0 -301
- package/script/deps/deno.land/x/html_parser@v0.1.3/src/ElementType.d.ts +0 -47
- package/script/deps/deno.land/x/html_parser@v0.1.3/src/ElementType.js +0 -55
- package/script/deps/deno.land/x/html_parser@v0.1.3/src/FeedHandler.d.ts +0 -66
- package/script/deps/deno.land/x/html_parser@v0.1.3/src/FeedHandler.js +0 -222
- package/script/deps/deno.land/x/html_parser@v0.1.3/src/Node.d.ts +0 -168
- package/script/deps/deno.land/x/html_parser@v0.1.3/src/Node.js +0 -404
- package/script/deps/deno.land/x/html_parser@v0.1.3/src/Parser.d.ts +0 -159
- package/script/deps/deno.land/x/html_parser@v0.1.3/src/Parser.js +0 -438
- package/script/deps/deno.land/x/html_parser@v0.1.3/src/Tokenizer.d.ts +0 -181
- package/script/deps/deno.land/x/html_parser@v0.1.3/src/Tokenizer.js +0 -1052
- package/script/deps/deno.land/x/html_parser@v0.1.3/src/mod.d.ts +0 -42
- package/script/deps/deno.land/x/html_parser@v0.1.3/src/mod.js +0 -88
- package/script/deps/deno.land/x/html_parser@v0.1.3/src/utils/entities/decode.d.ts +0 -11
- package/script/deps/deno.land/x/html_parser@v0.1.3/src/utils/entities/decode.js +0 -128
- package/script/deps/deno.land/x/html_parser@v0.1.3/src/utils/entities/decode_codepoint.d.ts +0 -1
- package/script/deps/deno.land/x/html_parser@v0.1.3/src/utils/entities/decode_codepoint.js +0 -30
- package/script/deps/deno.land/x/html_parser@v0.1.3/src/utils/entities/encode.d.ts +0 -46
- package/script/deps/deno.land/x/html_parser@v0.1.3/src/utils/entities/encode.js +0 -129
- package/script/deps/deno.land/x/html_parser@v0.1.3/src/utils/entities/maps/decode.d.ts +0 -31
- package/script/deps/deno.land/x/html_parser@v0.1.3/src/utils/entities/maps/decode.js +0 -32
- package/script/deps/deno.land/x/html_parser@v0.1.3/src/utils/entities/maps/entities.d.ts +0 -2128
- package/script/deps/deno.land/x/html_parser@v0.1.3/src/utils/entities/maps/entities.js +0 -2129
- package/script/deps/deno.land/x/html_parser@v0.1.3/src/utils/entities/maps/legacy.d.ts +0 -109
- package/script/deps/deno.land/x/html_parser@v0.1.3/src/utils/entities/maps/legacy.js +0 -110
- package/script/deps/deno.land/x/html_parser@v0.1.3/src/utils/entities/maps/xml.d.ts +0 -8
- package/script/deps/deno.land/x/html_parser@v0.1.3/src/utils/entities/maps/xml.js +0 -3
- package/script/deps/deno.land/x/html_parser@v0.1.3/src/utils/entities/mod.d.ts +0 -90
- package/script/deps/deno.land/x/html_parser@v0.1.3/src/utils/entities/mod.js +0 -114
- package/script/deps/deno.land/x/html_parser@v0.1.3/src/utils/helpers.d.ts +0 -50
- package/script/deps/deno.land/x/html_parser@v0.1.3/src/utils/helpers.js +0 -134
- package/script/deps/deno.land/x/html_parser@v0.1.3/src/utils/legacy.d.ts +0 -46
- package/script/deps/deno.land/x/html_parser@v0.1.3/src/utils/legacy.js +0 -118
- package/script/deps/deno.land/x/html_parser@v0.1.3/src/utils/manipulation.d.ts +0 -42
- package/script/deps/deno.land/x/html_parser@v0.1.3/src/utils/manipulation.js +0 -129
- package/script/deps/deno.land/x/html_parser@v0.1.3/src/utils/mod.d.ts +0 -6
- package/script/deps/deno.land/x/html_parser@v0.1.3/src/utils/mod.js +0 -22
- package/script/deps/deno.land/x/html_parser@v0.1.3/src/utils/querying.d.ts +0 -54
- package/script/deps/deno.land/x/html_parser@v0.1.3/src/utils/querying.js +0 -119
- package/script/deps/deno.land/x/html_parser@v0.1.3/src/utils/stringify.d.ts +0 -40
- package/script/deps/deno.land/x/html_parser@v0.1.3/src/utils/stringify.js +0 -86
- package/script/deps/deno.land/x/html_parser@v0.1.3/src/utils/traversal.d.ts +0 -58
- package/script/deps/deno.land/x/html_parser@v0.1.3/src/utils/traversal.js +0 -112
- package/script/deps/deno.land/x/tgcrypto@0.3.3/tgcrypto.js +0 -326
- package/script/utilities/0_control.d.ts +0 -1
- package/script/utilities/0_control.js +0 -7
- /package/{LICENSE → COPYING.LESSER} +0 -0
- /package/esm/deps/deno.land/x/{tgcrypto@0.3.3 → tgcrypto@0.4.0}/tgcrypto.d.ts +0 -0
- /package/script/deps/deno.land/x/{tgcrypto@0.3.3 → tgcrypto@0.4.0}/tgcrypto.d.ts +0 -0
|
@@ -1,207 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.DomHandler = void 0;
|
|
4
|
-
const Node_js_1 = require("./Node.js");
|
|
5
|
-
const ElementType_js_1 = require("./ElementType.js");
|
|
6
|
-
const reWhitespace = /\s+/g;
|
|
7
|
-
// Default options
|
|
8
|
-
const defaultOpts = {
|
|
9
|
-
normalizeWhitespace: false,
|
|
10
|
-
withStartIndices: false,
|
|
11
|
-
withEndIndices: false,
|
|
12
|
-
};
|
|
13
|
-
class DomHandler {
|
|
14
|
-
/**
|
|
15
|
-
* @param callback Called once parsing has completed.
|
|
16
|
-
* @param options Settings for the handler.
|
|
17
|
-
* @param elementCB Callback whenever a tag is closed.
|
|
18
|
-
*/
|
|
19
|
-
constructor(callback, options, elementCB) {
|
|
20
|
-
/** The elements of the DOM */
|
|
21
|
-
Object.defineProperty(this, "dom", {
|
|
22
|
-
enumerable: true,
|
|
23
|
-
configurable: true,
|
|
24
|
-
writable: true,
|
|
25
|
-
value: []
|
|
26
|
-
});
|
|
27
|
-
/** The root element for the DOM */
|
|
28
|
-
Object.defineProperty(this, "root", {
|
|
29
|
-
enumerable: true,
|
|
30
|
-
configurable: true,
|
|
31
|
-
writable: true,
|
|
32
|
-
value: new Node_js_1.Document(this.dom)
|
|
33
|
-
});
|
|
34
|
-
/** Called once parsing has completed. */
|
|
35
|
-
Object.defineProperty(this, "callback", {
|
|
36
|
-
enumerable: true,
|
|
37
|
-
configurable: true,
|
|
38
|
-
writable: true,
|
|
39
|
-
value: void 0
|
|
40
|
-
});
|
|
41
|
-
/** Settings for the handler. */
|
|
42
|
-
Object.defineProperty(this, "options", {
|
|
43
|
-
enumerable: true,
|
|
44
|
-
configurable: true,
|
|
45
|
-
writable: true,
|
|
46
|
-
value: void 0
|
|
47
|
-
});
|
|
48
|
-
/** Callback whenever a tag is closed. */
|
|
49
|
-
Object.defineProperty(this, "elementCB", {
|
|
50
|
-
enumerable: true,
|
|
51
|
-
configurable: true,
|
|
52
|
-
writable: true,
|
|
53
|
-
value: void 0
|
|
54
|
-
});
|
|
55
|
-
/** Indicated whether parsing has been completed. */
|
|
56
|
-
Object.defineProperty(this, "done", {
|
|
57
|
-
enumerable: true,
|
|
58
|
-
configurable: true,
|
|
59
|
-
writable: true,
|
|
60
|
-
value: false
|
|
61
|
-
});
|
|
62
|
-
/** Stack of open tags. */
|
|
63
|
-
Object.defineProperty(this, "tagStack", {
|
|
64
|
-
enumerable: true,
|
|
65
|
-
configurable: true,
|
|
66
|
-
writable: true,
|
|
67
|
-
value: [this.root]
|
|
68
|
-
});
|
|
69
|
-
/** A data node that is still being written to. */
|
|
70
|
-
Object.defineProperty(this, "lastNode", {
|
|
71
|
-
enumerable: true,
|
|
72
|
-
configurable: true,
|
|
73
|
-
writable: true,
|
|
74
|
-
value: null
|
|
75
|
-
});
|
|
76
|
-
/** Reference to the parser instance. Used for location information. */
|
|
77
|
-
Object.defineProperty(this, "parser", {
|
|
78
|
-
enumerable: true,
|
|
79
|
-
configurable: true,
|
|
80
|
-
writable: true,
|
|
81
|
-
value: null
|
|
82
|
-
});
|
|
83
|
-
// Make it possible to skip arguments, for backwards-compatibility
|
|
84
|
-
if (typeof options === 'function') {
|
|
85
|
-
elementCB = options;
|
|
86
|
-
options = defaultOpts;
|
|
87
|
-
}
|
|
88
|
-
if (typeof callback === 'object') {
|
|
89
|
-
options = callback;
|
|
90
|
-
callback = undefined;
|
|
91
|
-
}
|
|
92
|
-
this.callback = callback ?? null;
|
|
93
|
-
this.options = options ?? defaultOpts;
|
|
94
|
-
this.elementCB = elementCB ?? null;
|
|
95
|
-
}
|
|
96
|
-
onparserinit(parser) {
|
|
97
|
-
this.parser = parser;
|
|
98
|
-
}
|
|
99
|
-
// Resets the handler back to starting state
|
|
100
|
-
onreset() {
|
|
101
|
-
this.dom = [];
|
|
102
|
-
this.root = new Node_js_1.Document(this.dom);
|
|
103
|
-
this.done = false;
|
|
104
|
-
this.tagStack = [this.root];
|
|
105
|
-
this.lastNode = null;
|
|
106
|
-
this.parser = this.parser ?? null;
|
|
107
|
-
}
|
|
108
|
-
// Signals the handler that parsing is done
|
|
109
|
-
onend() {
|
|
110
|
-
if (this.done)
|
|
111
|
-
return;
|
|
112
|
-
this.done = true;
|
|
113
|
-
this.parser = null;
|
|
114
|
-
this.handleCallback(null);
|
|
115
|
-
}
|
|
116
|
-
onerror(error) {
|
|
117
|
-
this.handleCallback(error);
|
|
118
|
-
}
|
|
119
|
-
onclosetag() {
|
|
120
|
-
this.lastNode = null;
|
|
121
|
-
const elem = this.tagStack.pop();
|
|
122
|
-
if (this.options.withEndIndices) {
|
|
123
|
-
elem.endIndex = this.parser.endIndex;
|
|
124
|
-
}
|
|
125
|
-
if (this.elementCB)
|
|
126
|
-
this.elementCB(elem);
|
|
127
|
-
}
|
|
128
|
-
onopentag(name, attribs) {
|
|
129
|
-
const type = this.options.xmlMode ? ElementType_js_1.ElementType.Tag : undefined;
|
|
130
|
-
const element = new Node_js_1.Element(name, attribs, undefined, type);
|
|
131
|
-
this.addNode(element);
|
|
132
|
-
this.tagStack.push(element);
|
|
133
|
-
}
|
|
134
|
-
ontext(data) {
|
|
135
|
-
const { normalizeWhitespace } = this.options;
|
|
136
|
-
const { lastNode } = this;
|
|
137
|
-
if (lastNode && lastNode.type === ElementType_js_1.ElementType.Text) {
|
|
138
|
-
if (normalizeWhitespace) {
|
|
139
|
-
lastNode.data = (lastNode.data + data).replace(reWhitespace, ' ');
|
|
140
|
-
}
|
|
141
|
-
else {
|
|
142
|
-
lastNode.data += data;
|
|
143
|
-
}
|
|
144
|
-
}
|
|
145
|
-
else {
|
|
146
|
-
if (normalizeWhitespace) {
|
|
147
|
-
data = data.replace(reWhitespace, ' ');
|
|
148
|
-
}
|
|
149
|
-
const node = new Node_js_1.Text(data);
|
|
150
|
-
this.addNode(node);
|
|
151
|
-
this.lastNode = node;
|
|
152
|
-
}
|
|
153
|
-
}
|
|
154
|
-
oncomment(data) {
|
|
155
|
-
if (this.lastNode && this.lastNode.type === ElementType_js_1.ElementType.Comment) {
|
|
156
|
-
this.lastNode.data += data;
|
|
157
|
-
return;
|
|
158
|
-
}
|
|
159
|
-
const node = new Node_js_1.Comment(data);
|
|
160
|
-
this.addNode(node);
|
|
161
|
-
this.lastNode = node;
|
|
162
|
-
}
|
|
163
|
-
oncommentend() {
|
|
164
|
-
this.lastNode = null;
|
|
165
|
-
}
|
|
166
|
-
oncdatastart() {
|
|
167
|
-
const text = new Node_js_1.Text('');
|
|
168
|
-
const node = new Node_js_1.NodeWithChildren(ElementType_js_1.ElementType.CDATA, [text]);
|
|
169
|
-
this.addNode(node);
|
|
170
|
-
text.parent = node;
|
|
171
|
-
this.lastNode = text;
|
|
172
|
-
}
|
|
173
|
-
oncdataend() {
|
|
174
|
-
this.lastNode = null;
|
|
175
|
-
}
|
|
176
|
-
onprocessinginstruction(name, data) {
|
|
177
|
-
const node = new Node_js_1.ProcessingInstruction(name, data);
|
|
178
|
-
this.addNode(node);
|
|
179
|
-
}
|
|
180
|
-
handleCallback(error) {
|
|
181
|
-
if (typeof this.callback === 'function') {
|
|
182
|
-
this.callback(error, this.dom);
|
|
183
|
-
}
|
|
184
|
-
else if (error) {
|
|
185
|
-
throw error;
|
|
186
|
-
}
|
|
187
|
-
}
|
|
188
|
-
addNode(node) {
|
|
189
|
-
const parent = this.tagStack[this.tagStack.length - 1];
|
|
190
|
-
const previousSibling = parent.children[parent.children.length - 1];
|
|
191
|
-
if (this.options.withStartIndices) {
|
|
192
|
-
node.startIndex = this.parser.startIndex;
|
|
193
|
-
}
|
|
194
|
-
if (this.options.withEndIndices) {
|
|
195
|
-
node.endIndex = this.parser.endIndex;
|
|
196
|
-
}
|
|
197
|
-
parent.children.push(node);
|
|
198
|
-
if (previousSibling) {
|
|
199
|
-
node.prev = previousSibling;
|
|
200
|
-
previousSibling.next = node;
|
|
201
|
-
}
|
|
202
|
-
node.parent = parent;
|
|
203
|
-
this.lastNode = null;
|
|
204
|
-
}
|
|
205
|
-
}
|
|
206
|
-
exports.DomHandler = DomHandler;
|
|
207
|
-
exports.default = DomHandler;
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
import type { Node } from './Node.js';
|
|
2
|
-
/**
|
|
3
|
-
* Mixed-case SVG and MathML tags & attributes
|
|
4
|
-
* recognized by the HTML parser.
|
|
5
|
-
*
|
|
6
|
-
* @see https://html.spec.whatwg.org/multipage/parsing.html#parsing-main-inforeign
|
|
7
|
-
*/
|
|
8
|
-
export declare const elementNames: Map<string, string>;
|
|
9
|
-
export declare const attributeNames: Map<string, string>;
|
|
10
|
-
export interface DomSerializerOptions {
|
|
11
|
-
/**
|
|
12
|
-
* Print an empty attribute's value.
|
|
13
|
-
*
|
|
14
|
-
* @default xmlMode
|
|
15
|
-
* @example With <code>emptyAttrs: false</code>: <code><input checked></code>
|
|
16
|
-
* @example With <code>emptyAttrs: true</code>: <code><input checked=""></code>
|
|
17
|
-
*/
|
|
18
|
-
emptyAttrs?: boolean;
|
|
19
|
-
/**
|
|
20
|
-
* Print self-closing tags for tags without contents.
|
|
21
|
-
*
|
|
22
|
-
* @default xmlMode
|
|
23
|
-
* @example With <code>selfClosingTags: false</code>: <code><foo></foo></code>
|
|
24
|
-
* @example With <code>selfClosingTags: true</code>: <code><foo /></code>
|
|
25
|
-
*/
|
|
26
|
-
selfClosingTags?: boolean;
|
|
27
|
-
/**
|
|
28
|
-
* Treat the input as an XML document; enables the `emptyAttrs` and `selfClosingTags` options.
|
|
29
|
-
*
|
|
30
|
-
* If the value is `"foreign"`, it will try to correct mixed-case attribute names.
|
|
31
|
-
*
|
|
32
|
-
* @default false
|
|
33
|
-
*/
|
|
34
|
-
xmlMode?: boolean | 'foreign';
|
|
35
|
-
/**
|
|
36
|
-
* Encode characters that are either reserved in HTML or XML, or are outside of the ASCII range.
|
|
37
|
-
*
|
|
38
|
-
* @default true
|
|
39
|
-
*/
|
|
40
|
-
decodeEntities?: boolean;
|
|
41
|
-
}
|
|
42
|
-
/**
|
|
43
|
-
* Renders a DOM node or an array of DOM nodes to a string.
|
|
44
|
-
*
|
|
45
|
-
* Can be thought of as the equivalent of the `outerHTML` of the passed node(s).
|
|
46
|
-
*
|
|
47
|
-
* @param node Node to be rendered.
|
|
48
|
-
* @param options Changes serialization behavior
|
|
49
|
-
*/
|
|
50
|
-
export default function render(node: Node | ArrayLike<Node>, options?: DomSerializerOptions): string;
|
|
@@ -1,301 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
24
|
-
};
|
|
25
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
-
exports.attributeNames = exports.elementNames = void 0;
|
|
27
|
-
/*
|
|
28
|
-
* Module dependencies
|
|
29
|
-
*/
|
|
30
|
-
const ElementType = __importStar(require("./ElementType.js"));
|
|
31
|
-
const mod_js_1 = require("./utils/entities/mod.js");
|
|
32
|
-
/**
|
|
33
|
-
* Mixed-case SVG and MathML tags & attributes
|
|
34
|
-
* recognized by the HTML parser.
|
|
35
|
-
*
|
|
36
|
-
* @see https://html.spec.whatwg.org/multipage/parsing.html#parsing-main-inforeign
|
|
37
|
-
*/
|
|
38
|
-
exports.elementNames = new Map([
|
|
39
|
-
['altglyph', 'altGlyph'],
|
|
40
|
-
['altglyphdef', 'altGlyphDef'],
|
|
41
|
-
['altglyphitem', 'altGlyphItem'],
|
|
42
|
-
['animatecolor', 'animateColor'],
|
|
43
|
-
['animatemotion', 'animateMotion'],
|
|
44
|
-
['animatetransform', 'animateTransform'],
|
|
45
|
-
['clippath', 'clipPath'],
|
|
46
|
-
['feblend', 'feBlend'],
|
|
47
|
-
['fecolormatrix', 'feColorMatrix'],
|
|
48
|
-
['fecomponenttransfer', 'feComponentTransfer'],
|
|
49
|
-
['fecomposite', 'feComposite'],
|
|
50
|
-
['feconvolvematrix', 'feConvolveMatrix'],
|
|
51
|
-
['fediffuselighting', 'feDiffuseLighting'],
|
|
52
|
-
['fedisplacementmap', 'feDisplacementMap'],
|
|
53
|
-
['fedistantlight', 'feDistantLight'],
|
|
54
|
-
['fedropshadow', 'feDropShadow'],
|
|
55
|
-
['feflood', 'feFlood'],
|
|
56
|
-
['fefunca', 'feFuncA'],
|
|
57
|
-
['fefuncb', 'feFuncB'],
|
|
58
|
-
['fefuncg', 'feFuncG'],
|
|
59
|
-
['fefuncr', 'feFuncR'],
|
|
60
|
-
['fegaussianblur', 'feGaussianBlur'],
|
|
61
|
-
['feimage', 'feImage'],
|
|
62
|
-
['femerge', 'feMerge'],
|
|
63
|
-
['femergenode', 'feMergeNode'],
|
|
64
|
-
['femorphology', 'feMorphology'],
|
|
65
|
-
['feoffset', 'feOffset'],
|
|
66
|
-
['fepointlight', 'fePointLight'],
|
|
67
|
-
['fespecularlighting', 'feSpecularLighting'],
|
|
68
|
-
['fespotlight', 'feSpotLight'],
|
|
69
|
-
['fetile', 'feTile'],
|
|
70
|
-
['feturbulence', 'feTurbulence'],
|
|
71
|
-
['foreignobject', 'foreignObject'],
|
|
72
|
-
['glyphref', 'glyphRef'],
|
|
73
|
-
['lineargradient', 'linearGradient'],
|
|
74
|
-
['radialgradient', 'radialGradient'],
|
|
75
|
-
['textpath', 'textPath'],
|
|
76
|
-
]);
|
|
77
|
-
exports.attributeNames = new Map([
|
|
78
|
-
['definitionurl', 'definitionURL'],
|
|
79
|
-
['attributename', 'attributeName'],
|
|
80
|
-
['attributetype', 'attributeType'],
|
|
81
|
-
['basefrequency', 'baseFrequency'],
|
|
82
|
-
['baseprofile', 'baseProfile'],
|
|
83
|
-
['calcmode', 'calcMode'],
|
|
84
|
-
['clippathunits', 'clipPathUnits'],
|
|
85
|
-
['diffuseconstant', 'diffuseConstant'],
|
|
86
|
-
['edgemode', 'edgeMode'],
|
|
87
|
-
['filterunits', 'filterUnits'],
|
|
88
|
-
['glyphref', 'glyphRef'],
|
|
89
|
-
['gradienttransform', 'gradientTransform'],
|
|
90
|
-
['gradientunits', 'gradientUnits'],
|
|
91
|
-
['kernelmatrix', 'kernelMatrix'],
|
|
92
|
-
['kernelunitlength', 'kernelUnitLength'],
|
|
93
|
-
['keypoints', 'keyPoints'],
|
|
94
|
-
['keysplines', 'keySplines'],
|
|
95
|
-
['keytimes', 'keyTimes'],
|
|
96
|
-
['lengthadjust', 'lengthAdjust'],
|
|
97
|
-
['limitingconeangle', 'limitingConeAngle'],
|
|
98
|
-
['markerheight', 'markerHeight'],
|
|
99
|
-
['markerunits', 'markerUnits'],
|
|
100
|
-
['markerwidth', 'markerWidth'],
|
|
101
|
-
['maskcontentunits', 'maskContentUnits'],
|
|
102
|
-
['maskunits', 'maskUnits'],
|
|
103
|
-
['numoctaves', 'numOctaves'],
|
|
104
|
-
['pathlength', 'pathLength'],
|
|
105
|
-
['patterncontentunits', 'patternContentUnits'],
|
|
106
|
-
['patterntransform', 'patternTransform'],
|
|
107
|
-
['patternunits', 'patternUnits'],
|
|
108
|
-
['pointsatx', 'pointsAtX'],
|
|
109
|
-
['pointsaty', 'pointsAtY'],
|
|
110
|
-
['pointsatz', 'pointsAtZ'],
|
|
111
|
-
['preservealpha', 'preserveAlpha'],
|
|
112
|
-
['preserveaspectratio', 'preserveAspectRatio'],
|
|
113
|
-
['primitiveunits', 'primitiveUnits'],
|
|
114
|
-
['refx', 'refX'],
|
|
115
|
-
['refy', 'refY'],
|
|
116
|
-
['repeatcount', 'repeatCount'],
|
|
117
|
-
['repeatdur', 'repeatDur'],
|
|
118
|
-
['requiredextensions', 'requiredExtensions'],
|
|
119
|
-
['requiredfeatures', 'requiredFeatures'],
|
|
120
|
-
['specularconstant', 'specularConstant'],
|
|
121
|
-
['specularexponent', 'specularExponent'],
|
|
122
|
-
['spreadmethod', 'spreadMethod'],
|
|
123
|
-
['startoffset', 'startOffset'],
|
|
124
|
-
['stddeviation', 'stdDeviation'],
|
|
125
|
-
['stitchtiles', 'stitchTiles'],
|
|
126
|
-
['surfacescale', 'surfaceScale'],
|
|
127
|
-
['systemlanguage', 'systemLanguage'],
|
|
128
|
-
['tablevalues', 'tableValues'],
|
|
129
|
-
['targetx', 'targetX'],
|
|
130
|
-
['targety', 'targetY'],
|
|
131
|
-
['textlength', 'textLength'],
|
|
132
|
-
['viewbox', 'viewBox'],
|
|
133
|
-
['viewtarget', 'viewTarget'],
|
|
134
|
-
['xchannelselector', 'xChannelSelector'],
|
|
135
|
-
['ychannelselector', 'yChannelSelector'],
|
|
136
|
-
['zoomandpan', 'zoomAndPan'],
|
|
137
|
-
]);
|
|
138
|
-
const unencodedElements = new Set([
|
|
139
|
-
'style',
|
|
140
|
-
'script',
|
|
141
|
-
'xmp',
|
|
142
|
-
'iframe',
|
|
143
|
-
'noembed',
|
|
144
|
-
'noframes',
|
|
145
|
-
'plaintext',
|
|
146
|
-
'noscript',
|
|
147
|
-
]);
|
|
148
|
-
/**
|
|
149
|
-
* Format attributes
|
|
150
|
-
*/
|
|
151
|
-
function formatAttributes(attributes, opts) {
|
|
152
|
-
if (!attributes)
|
|
153
|
-
return;
|
|
154
|
-
return Object.keys(attributes)
|
|
155
|
-
.map(key => {
|
|
156
|
-
const value = attributes[key] ?? '';
|
|
157
|
-
if (opts.xmlMode === 'foreign') {
|
|
158
|
-
/* Fix up mixed-case attribute names */
|
|
159
|
-
key = exports.attributeNames.get(key) ?? key;
|
|
160
|
-
}
|
|
161
|
-
if (!opts.emptyAttrs && !opts.xmlMode && value === '') {
|
|
162
|
-
return key;
|
|
163
|
-
}
|
|
164
|
-
return `${key}="${opts.decodeEntities !== false
|
|
165
|
-
? (0, mod_js_1.encodeXML)(value)
|
|
166
|
-
: value.replace(/"/g, '"')}"`;
|
|
167
|
-
})
|
|
168
|
-
.join(' ');
|
|
169
|
-
}
|
|
170
|
-
/**
|
|
171
|
-
* Self-enclosing tags
|
|
172
|
-
*/
|
|
173
|
-
const singleTag = new Set([
|
|
174
|
-
'area',
|
|
175
|
-
'base',
|
|
176
|
-
'basefont',
|
|
177
|
-
'br',
|
|
178
|
-
'col',
|
|
179
|
-
'command',
|
|
180
|
-
'embed',
|
|
181
|
-
'frame',
|
|
182
|
-
'hr',
|
|
183
|
-
'img',
|
|
184
|
-
'input',
|
|
185
|
-
'isindex',
|
|
186
|
-
'keygen',
|
|
187
|
-
'link',
|
|
188
|
-
'meta',
|
|
189
|
-
'param',
|
|
190
|
-
'source',
|
|
191
|
-
'track',
|
|
192
|
-
'wbr',
|
|
193
|
-
]);
|
|
194
|
-
/**
|
|
195
|
-
* Renders a DOM node or an array of DOM nodes to a string.
|
|
196
|
-
*
|
|
197
|
-
* Can be thought of as the equivalent of the `outerHTML` of the passed node(s).
|
|
198
|
-
*
|
|
199
|
-
* @param node Node to be rendered.
|
|
200
|
-
* @param options Changes serialization behavior
|
|
201
|
-
*/
|
|
202
|
-
function render(node, options = {}) {
|
|
203
|
-
const nodes = 'length' in node ? node : [node];
|
|
204
|
-
let output = '';
|
|
205
|
-
for (let i = 0; i < nodes.length; i++) {
|
|
206
|
-
output += renderNode(nodes[i], options);
|
|
207
|
-
}
|
|
208
|
-
return output;
|
|
209
|
-
}
|
|
210
|
-
exports.default = render;
|
|
211
|
-
function renderNode(node, options) {
|
|
212
|
-
switch (node.type) {
|
|
213
|
-
case ElementType.Root:
|
|
214
|
-
return render(node.children, options);
|
|
215
|
-
case ElementType.Directive:
|
|
216
|
-
case ElementType.Doctype:
|
|
217
|
-
return renderDirective(node);
|
|
218
|
-
case ElementType.Comment:
|
|
219
|
-
return renderComment(node);
|
|
220
|
-
case ElementType.CDATA:
|
|
221
|
-
return renderCdata(node);
|
|
222
|
-
case ElementType.Script:
|
|
223
|
-
case ElementType.Style:
|
|
224
|
-
case ElementType.Tag:
|
|
225
|
-
return renderTag(node, options);
|
|
226
|
-
case ElementType.Text:
|
|
227
|
-
return renderText(node, options);
|
|
228
|
-
}
|
|
229
|
-
}
|
|
230
|
-
const foreignModeIntegrationPoints = new Set([
|
|
231
|
-
'mi',
|
|
232
|
-
'mo',
|
|
233
|
-
'mn',
|
|
234
|
-
'ms',
|
|
235
|
-
'mtext',
|
|
236
|
-
'annotation-xml',
|
|
237
|
-
'foreignObject',
|
|
238
|
-
'desc',
|
|
239
|
-
'title',
|
|
240
|
-
]);
|
|
241
|
-
const foreignElements = new Set(['svg', 'math']);
|
|
242
|
-
function renderTag(elem, opts) {
|
|
243
|
-
// Handle SVG / MathML in HTML
|
|
244
|
-
if (opts.xmlMode === 'foreign') {
|
|
245
|
-
/* Fix up mixed-case element names */
|
|
246
|
-
elem.name = exports.elementNames.get(elem.name) ?? elem.name;
|
|
247
|
-
/* Exit foreign mode at integration points */
|
|
248
|
-
if (elem.parent &&
|
|
249
|
-
foreignModeIntegrationPoints.has(elem.parent.name)) {
|
|
250
|
-
opts = { ...opts, xmlMode: false };
|
|
251
|
-
}
|
|
252
|
-
}
|
|
253
|
-
if (!opts.xmlMode && foreignElements.has(elem.name)) {
|
|
254
|
-
opts = { ...opts, xmlMode: 'foreign' };
|
|
255
|
-
}
|
|
256
|
-
let tag = `<${elem.name}`;
|
|
257
|
-
const attribs = formatAttributes(elem.attribs, opts);
|
|
258
|
-
if (attribs) {
|
|
259
|
-
tag += ` ${attribs}`;
|
|
260
|
-
}
|
|
261
|
-
if (elem.children.length === 0 &&
|
|
262
|
-
(opts.xmlMode
|
|
263
|
-
? // In XML mode or foreign mode, and user hasn't explicitly turned off self-closing tags
|
|
264
|
-
opts.selfClosingTags !== false
|
|
265
|
-
: // User explicitly asked for self-closing tags, even in HTML mode
|
|
266
|
-
opts.selfClosingTags && singleTag.has(elem.name))) {
|
|
267
|
-
if (!opts.xmlMode)
|
|
268
|
-
tag += ' ';
|
|
269
|
-
tag += '/>';
|
|
270
|
-
}
|
|
271
|
-
else {
|
|
272
|
-
tag += '>';
|
|
273
|
-
if (elem.children.length > 0) {
|
|
274
|
-
tag += render(elem.children, opts);
|
|
275
|
-
}
|
|
276
|
-
if (opts.xmlMode || !singleTag.has(elem.name)) {
|
|
277
|
-
tag += `</${elem.name}>`;
|
|
278
|
-
}
|
|
279
|
-
}
|
|
280
|
-
return tag;
|
|
281
|
-
}
|
|
282
|
-
function renderDirective(elem) {
|
|
283
|
-
return `<${elem.data}>`;
|
|
284
|
-
}
|
|
285
|
-
function renderText(elem, opts) {
|
|
286
|
-
let data = elem.data || '';
|
|
287
|
-
// If entities weren't decoded, no need to encode them back
|
|
288
|
-
if (opts.decodeEntities !== false &&
|
|
289
|
-
!(!opts.xmlMode &&
|
|
290
|
-
elem.parent &&
|
|
291
|
-
unencodedElements.has(elem.parent.name))) {
|
|
292
|
-
data = (0, mod_js_1.encodeXML)(data);
|
|
293
|
-
}
|
|
294
|
-
return data;
|
|
295
|
-
}
|
|
296
|
-
function renderCdata(elem) {
|
|
297
|
-
return `<![CDATA[${elem.children[0].data}]]>`;
|
|
298
|
-
}
|
|
299
|
-
function renderComment(elem) {
|
|
300
|
-
return `<!--${elem.data}-->`;
|
|
301
|
-
}
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
/** Types of elements found in htmlparser2's DOM */
|
|
2
|
-
export declare enum ElementType {
|
|
3
|
-
/** Type for the root element of a document */
|
|
4
|
-
Root = "root",
|
|
5
|
-
/** Type for Text */
|
|
6
|
-
Text = "text",
|
|
7
|
-
/** Type for <? ... ?> */
|
|
8
|
-
Directive = "directive",
|
|
9
|
-
/** Type for <!-- ... --> */
|
|
10
|
-
Comment = "comment",
|
|
11
|
-
/** Type for <script> tags */
|
|
12
|
-
Script = "script",
|
|
13
|
-
/** Type for <style> tags */
|
|
14
|
-
Style = "style",
|
|
15
|
-
/** Type for Any tag */
|
|
16
|
-
Tag = "tag",
|
|
17
|
-
/** Type for <![CDATA[ ... ]]> */
|
|
18
|
-
CDATA = "cdata",
|
|
19
|
-
/** Type for <!doctype ...> */
|
|
20
|
-
Doctype = "doctype"
|
|
21
|
-
}
|
|
22
|
-
/**
|
|
23
|
-
* Tests whether an element is a tag or not.
|
|
24
|
-
*
|
|
25
|
-
* @param elem Element to test
|
|
26
|
-
*/
|
|
27
|
-
export declare function isTag(elem: {
|
|
28
|
-
type: ElementType;
|
|
29
|
-
}): boolean;
|
|
30
|
-
/** Type for the root element of a document */
|
|
31
|
-
export declare const Root = ElementType.Root;
|
|
32
|
-
/** Type for Text */
|
|
33
|
-
export declare const Text = ElementType.Text;
|
|
34
|
-
/** Type for <? ... ?> */
|
|
35
|
-
export declare const Directive = ElementType.Directive;
|
|
36
|
-
/** Type for <!-- ... --> */
|
|
37
|
-
export declare const Comment = ElementType.Comment;
|
|
38
|
-
/** Type for <script> tags */
|
|
39
|
-
export declare const Script = ElementType.Script;
|
|
40
|
-
/** Type for <style> tags */
|
|
41
|
-
export declare const Style = ElementType.Style;
|
|
42
|
-
/** Type for Any tag */
|
|
43
|
-
export declare const Tag = ElementType.Tag;
|
|
44
|
-
/** Type for <![CDATA[ ... ]]> */
|
|
45
|
-
export declare const CDATA = ElementType.CDATA;
|
|
46
|
-
/** Type for <!doctype ...> */
|
|
47
|
-
export declare const Doctype = ElementType.Doctype;
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Doctype = exports.CDATA = exports.Tag = exports.Style = exports.Script = exports.Comment = exports.Directive = exports.Text = exports.Root = exports.isTag = exports.ElementType = void 0;
|
|
4
|
-
/** Types of elements found in htmlparser2's DOM */
|
|
5
|
-
var ElementType;
|
|
6
|
-
(function (ElementType) {
|
|
7
|
-
/** Type for the root element of a document */
|
|
8
|
-
ElementType["Root"] = "root";
|
|
9
|
-
/** Type for Text */
|
|
10
|
-
ElementType["Text"] = "text";
|
|
11
|
-
/** Type for <? ... ?> */
|
|
12
|
-
ElementType["Directive"] = "directive";
|
|
13
|
-
/** Type for <!-- ... --> */
|
|
14
|
-
ElementType["Comment"] = "comment";
|
|
15
|
-
/** Type for <script> tags */
|
|
16
|
-
ElementType["Script"] = "script";
|
|
17
|
-
/** Type for <style> tags */
|
|
18
|
-
ElementType["Style"] = "style";
|
|
19
|
-
/** Type for Any tag */
|
|
20
|
-
ElementType["Tag"] = "tag";
|
|
21
|
-
/** Type for <![CDATA[ ... ]]> */
|
|
22
|
-
ElementType["CDATA"] = "cdata";
|
|
23
|
-
/** Type for <!doctype ...> */
|
|
24
|
-
ElementType["Doctype"] = "doctype";
|
|
25
|
-
})(ElementType || (exports.ElementType = ElementType = {}));
|
|
26
|
-
/**
|
|
27
|
-
* Tests whether an element is a tag or not.
|
|
28
|
-
*
|
|
29
|
-
* @param elem Element to test
|
|
30
|
-
*/
|
|
31
|
-
function isTag(elem) {
|
|
32
|
-
return (elem.type === ElementType.Tag ||
|
|
33
|
-
elem.type === ElementType.Script ||
|
|
34
|
-
elem.type === ElementType.Style);
|
|
35
|
-
}
|
|
36
|
-
exports.isTag = isTag;
|
|
37
|
-
// Exports for backwards compatibility
|
|
38
|
-
/** Type for the root element of a document */
|
|
39
|
-
exports.Root = ElementType.Root;
|
|
40
|
-
/** Type for Text */
|
|
41
|
-
exports.Text = ElementType.Text;
|
|
42
|
-
/** Type for <? ... ?> */
|
|
43
|
-
exports.Directive = ElementType.Directive;
|
|
44
|
-
/** Type for <!-- ... --> */
|
|
45
|
-
exports.Comment = ElementType.Comment;
|
|
46
|
-
/** Type for <script> tags */
|
|
47
|
-
exports.Script = ElementType.Script;
|
|
48
|
-
/** Type for <style> tags */
|
|
49
|
-
exports.Style = ElementType.Style;
|
|
50
|
-
/** Type for Any tag */
|
|
51
|
-
exports.Tag = ElementType.Tag;
|
|
52
|
-
/** Type for <![CDATA[ ... ]]> */
|
|
53
|
-
exports.CDATA = ElementType.CDATA;
|
|
54
|
-
/** Type for <!doctype ...> */
|
|
55
|
-
exports.Doctype = ElementType.Doctype;
|