@mtkruto/node 0.1.191 → 0.1.201
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/1_utilities.d.ts +1 -1
- package/esm/1_utilities.js +1 -1
- package/esm/2_tl.d.ts +6 -6
- package/esm/2_tl.js +6 -6
- package/esm/3_storage.d.ts +5 -5
- package/esm/3_storage.js +5 -5
- package/esm/3_types.d.ts +6 -5
- package/esm/3_types.js +6 -5
- package/esm/4_constants.d.ts +2 -2
- package/esm/4_constants.js +2 -2
- package/esm/5_client.d.ts +1 -1
- package/esm/5_client.js +1 -1
- package/esm/client/0_params.d.ts +7 -1
- package/esm/client/0_types.d.ts +1 -0
- package/esm/client/0_utilities.d.ts +0 -3
- package/esm/client/0_utilities.js +0 -20
- package/esm/client/1_business_connection_manager.d.ts +11 -0
- package/esm/client/1_business_connection_manager.js +47 -0
- package/esm/client/1_update_manager.d.ts +8 -1
- package/esm/client/1_update_manager.js +88 -8
- package/esm/client/2_message_manager.d.ts +7 -6
- package/esm/client/2_message_manager.js +48 -31
- package/esm/client/4_client.d.ts +426 -428
- package/esm/client/4_client.js +570 -530
- package/esm/storage/0_storage.d.ts +5 -0
- package/esm/storage/0_storage.js +20 -0
- package/esm/storage/{1_storage_indexed_db.js → 2_storage_indexed_db.js} +1 -1
- package/esm/storage/{1_storage_local_storage.js → 2_storage_local_storage.js} +1 -1
- package/{script/storage/1_storage_memory.d.ts → esm/storage/2_storage_memory.d.ts} +1 -4
- package/esm/storage/{1_storage_memory.js → 2_storage_memory.js} +8 -28
- package/esm/storage/{1_storage_session_storage.js → 2_storage_session_storage.js} +1 -1
- package/esm/tl/2_types.d.ts +1071 -183
- package/esm/tl/2_types.js +2916 -464
- package/esm/tl/3_functions.d.ts +381 -17
- package/esm/tl/3_functions.js +1002 -120
- package/{script/tl/4_tl_writer.d.ts → esm/tl/5_tl_writer.d.ts} +1 -1
- package/{script/tl/4_rpc_result.d.ts → esm/tl/6_rpc_result.d.ts} +1 -1
- package/esm/tl/{4_rpc_result.js → 6_rpc_result.js} +1 -1
- package/esm/tl/{6_message.d.ts → 7_message.d.ts} +2 -2
- package/esm/tl/{6_message.js → 7_message.js} +3 -3
- package/esm/tl/{7_message_container.d.ts → 8_message_container.d.ts} +1 -1
- package/esm/tl/{7_message_container.js → 8_message_container.js} +3 -3
- package/esm/types/0_chat_photo.js +1 -1
- package/esm/types/0_message_entity.d.ts +1 -1
- package/esm/types/0_thumbnail.js +1 -1
- package/esm/types/1_bot_command_scope.d.ts +1 -1
- package/esm/types/1_photo.js +2 -2
- package/esm/types/1_story_privacy.d.ts +1 -1
- package/esm/types/2_business_connection.d.ts +11 -0
- package/esm/types/2_business_connection.js +12 -0
- package/esm/types/2_chat_member.d.ts +1 -1
- package/esm/types/2_chosen_inline_result.d.ts +1 -1
- package/esm/types/2_game.js +1 -1
- package/esm/types/2_inline_keyboard_button.d.ts +1 -1
- package/esm/types/2_inline_query.d.ts +1 -1
- package/esm/types/2_invite_link.d.ts +1 -1
- package/esm/types/2_message_reaction_count.d.ts +1 -1
- package/esm/types/2_message_reactions.d.ts +1 -1
- package/esm/types/2_story_content.js +1 -1
- package/esm/types/{1_story_interactive_area.d.ts → 2_story_interactive_area.d.ts} +2 -2
- package/esm/types/{1_story_interactive_area.js → 2_story_interactive_area.js} +1 -1
- package/esm/types/3_chat_member_updated.d.ts +1 -1
- package/esm/types/3_reply_markup.d.ts +1 -1
- package/esm/types/3_story.d.ts +2 -2
- package/esm/types/3_story.js +1 -1
- package/esm/types/4_inline_query_result.d.ts +1 -1
- package/esm/types/4_inline_query_result.js +1 -1
- package/esm/types/4_message.d.ts +9 -3
- package/esm/types/4_message.js +22 -5
- package/esm/types/5_callback_query.d.ts +1 -1
- package/esm/types/5_chat.d.ts +1 -1
- package/esm/types/6_update.d.ts +12 -2
- package/package.json +1 -1
- package/script/1_utilities.d.ts +1 -1
- package/script/1_utilities.js +1 -1
- package/script/2_tl.d.ts +6 -6
- package/script/2_tl.js +6 -6
- package/script/3_storage.d.ts +5 -5
- package/script/3_storage.js +5 -5
- package/script/3_types.d.ts +6 -5
- package/script/3_types.js +6 -5
- package/script/4_constants.d.ts +2 -2
- package/script/4_constants.js +2 -2
- package/script/5_client.d.ts +1 -1
- package/script/5_client.js +1 -1
- package/script/client/0_params.d.ts +7 -1
- package/script/client/0_types.d.ts +1 -0
- package/script/client/0_utilities.d.ts +0 -3
- package/script/client/0_utilities.js +1 -23
- package/script/client/1_business_connection_manager.d.ts +11 -0
- package/script/client/1_business_connection_manager.js +51 -0
- package/script/client/1_update_manager.d.ts +8 -1
- package/script/client/1_update_manager.js +88 -8
- package/script/client/2_message_manager.d.ts +7 -6
- package/script/client/2_message_manager.js +47 -30
- package/script/client/4_client.d.ts +426 -428
- package/script/client/4_client.js +570 -530
- package/script/storage/0_storage.d.ts +5 -0
- package/script/storage/0_storage.js +20 -0
- package/script/storage/{1_storage_indexed_db.js → 2_storage_indexed_db.js} +7 -7
- package/script/storage/{1_storage_local_storage.js → 2_storage_local_storage.js} +10 -10
- package/{esm/storage/1_storage_memory.d.ts → script/storage/2_storage_memory.d.ts} +1 -4
- package/script/storage/{1_storage_memory.js → 2_storage_memory.js} +12 -32
- package/script/storage/{1_storage_session_storage.js → 2_storage_session_storage.js} +10 -10
- package/script/tl/2_types.d.ts +1071 -183
- package/script/tl/2_types.js +3028 -504
- package/script/tl/3_functions.d.ts +381 -17
- package/script/tl/3_functions.js +1047 -143
- package/{esm/tl/4_tl_writer.d.ts → script/tl/5_tl_writer.d.ts} +1 -1
- package/{esm/tl/4_rpc_result.d.ts → script/tl/6_rpc_result.d.ts} +1 -1
- package/script/tl/{4_rpc_result.js → 6_rpc_result.js} +2 -2
- package/script/tl/{6_message.d.ts → 7_message.d.ts} +2 -2
- package/script/tl/{6_message.js → 7_message.js} +8 -8
- package/script/tl/{7_message_container.d.ts → 8_message_container.d.ts} +1 -1
- package/script/tl/{7_message_container.js → 8_message_container.js} +7 -7
- package/script/types/0_chat_photo.js +9 -9
- package/script/types/0_message_entity.d.ts +1 -1
- package/script/types/0_thumbnail.js +6 -6
- package/script/types/1_bot_command_scope.d.ts +1 -1
- package/script/types/1_photo.js +7 -7
- package/script/types/1_story_privacy.d.ts +1 -1
- package/script/types/2_business_connection.d.ts +11 -0
- package/script/types/2_business_connection.js +16 -0
- package/script/types/2_chat_member.d.ts +1 -1
- package/script/types/2_chosen_inline_result.d.ts +1 -1
- package/script/types/2_game.js +3 -3
- package/script/types/2_inline_keyboard_button.d.ts +1 -1
- package/script/types/2_inline_query.d.ts +1 -1
- package/script/types/2_invite_link.d.ts +1 -1
- package/script/types/2_message_reaction_count.d.ts +1 -1
- package/script/types/2_message_reactions.d.ts +1 -1
- package/script/types/2_story_content.js +4 -4
- package/script/types/{1_story_interactive_area.d.ts → 2_story_interactive_area.d.ts} +2 -2
- package/script/types/{1_story_interactive_area.js → 2_story_interactive_area.js} +2 -2
- package/script/types/3_chat_member_updated.d.ts +1 -1
- package/script/types/3_reply_markup.d.ts +1 -1
- package/script/types/3_story.d.ts +2 -2
- package/script/types/3_story.js +2 -2
- package/script/types/4_inline_query_result.d.ts +1 -1
- package/script/types/4_inline_query_result.js +2 -2
- package/script/types/4_message.d.ts +9 -3
- package/script/types/4_message.js +37 -20
- package/script/types/5_callback_query.d.ts +1 -1
- package/script/types/5_chat.d.ts +1 -1
- package/script/types/6_update.d.ts +12 -2
- 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/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/esm/storage/{0_utilities.d.ts → 1_utilities.d.ts} +0 -0
- /package/esm/storage/{0_utilities.js → 1_utilities.js} +0 -0
- /package/esm/storage/{1_storage_indexed_db.d.ts → 2_storage_indexed_db.d.ts} +0 -0
- /package/esm/storage/{1_storage_local_storage.d.ts → 2_storage_local_storage.d.ts} +0 -0
- /package/esm/storage/{1_storage_session_storage.d.ts → 2_storage_session_storage.d.ts} +0 -0
- /package/esm/tl/{3_tl_reader.d.ts → 4_tl_reader.d.ts} +0 -0
- /package/esm/tl/{3_tl_reader.js → 4_tl_reader.js} +0 -0
- /package/esm/tl/{4_tl_writer.js → 5_tl_writer.js} +0 -0
- /package/esm/types/{0_venue.d.ts → 1_venue.d.ts} +0 -0
- /package/esm/types/{0_venue.js → 1_venue.js} +0 -0
- /package/esm/types/{0__file_id.d.ts → _file_id.d.ts} +0 -0
- /package/esm/types/{0__file_id.js → _file_id.js} +0 -0
- /package/esm/types/{1__getters.d.ts → _getters.d.ts} +0 -0
- /package/esm/types/{1__getters.js → _getters.js} +0 -0
- /package/script/storage/{0_utilities.d.ts → 1_utilities.d.ts} +0 -0
- /package/script/storage/{0_utilities.js → 1_utilities.js} +0 -0
- /package/script/storage/{1_storage_indexed_db.d.ts → 2_storage_indexed_db.d.ts} +0 -0
- /package/script/storage/{1_storage_local_storage.d.ts → 2_storage_local_storage.d.ts} +0 -0
- /package/script/storage/{1_storage_session_storage.d.ts → 2_storage_session_storage.d.ts} +0 -0
- /package/script/tl/{3_tl_reader.d.ts → 4_tl_reader.d.ts} +0 -0
- /package/script/tl/{3_tl_reader.js → 4_tl_reader.js} +0 -0
- /package/script/tl/{4_tl_writer.js → 5_tl_writer.js} +0 -0
- /package/script/types/{0_venue.d.ts → 1_venue.d.ts} +0 -0
- /package/script/types/{0_venue.js → 1_venue.js} +0 -0
- /package/script/types/{0__file_id.d.ts → _file_id.d.ts} +0 -0
- /package/script/types/{0__file_id.js → _file_id.js} +0 -0
- /package/script/types/{1__getters.d.ts → _getters.d.ts} +0 -0
- /package/script/types/{1__getters.js → _getters.js} +0 -0
|
@@ -1,168 +0,0 @@
|
|
|
1
|
-
import { ElementType } from './ElementType.js';
|
|
2
|
-
/**
|
|
3
|
-
* This object will be used as the prototype for Nodes when creating a
|
|
4
|
-
* DOM-Level-1-compliant structure.
|
|
5
|
-
*/
|
|
6
|
-
export declare class Node {
|
|
7
|
-
type: ElementType;
|
|
8
|
-
/** Parent of the node */
|
|
9
|
-
parent: NodeWithChildren | null;
|
|
10
|
-
/** Previous sibling */
|
|
11
|
-
prev: Node | null;
|
|
12
|
-
/** Next sibling */
|
|
13
|
-
next: Node | null;
|
|
14
|
-
/** The start index of the node. Requires `withStartIndices` on the handler to be `true. */
|
|
15
|
-
startIndex: number | null;
|
|
16
|
-
/** The end index of the node. Requires `withEndIndices` on the handler to be `true. */
|
|
17
|
-
endIndex: number | null;
|
|
18
|
-
/**
|
|
19
|
-
*
|
|
20
|
-
* @param type The type of the node.
|
|
21
|
-
*/
|
|
22
|
-
constructor(type: ElementType);
|
|
23
|
-
get nodeType(): number;
|
|
24
|
-
get parentNode(): NodeWithChildren | null;
|
|
25
|
-
set parentNode(parent: NodeWithChildren | null);
|
|
26
|
-
get previousSibling(): Node | null;
|
|
27
|
-
set previousSibling(prev: Node | null);
|
|
28
|
-
get nextSibling(): Node | null;
|
|
29
|
-
set nextSibling(next: Node | null);
|
|
30
|
-
/**
|
|
31
|
-
* Clone this node, and optionally its children.
|
|
32
|
-
*
|
|
33
|
-
* @param recursive Clone child nodes as well.
|
|
34
|
-
* @returns A clone of the node.
|
|
35
|
-
*/
|
|
36
|
-
cloneNode<T extends Node>(this: T, recursive?: boolean): T;
|
|
37
|
-
}
|
|
38
|
-
/**
|
|
39
|
-
* A node that contains some data.
|
|
40
|
-
*/
|
|
41
|
-
export declare class DataNode extends Node {
|
|
42
|
-
data: string;
|
|
43
|
-
/**
|
|
44
|
-
* @param type The type of the node
|
|
45
|
-
* @param data The content of the data node
|
|
46
|
-
*/
|
|
47
|
-
constructor(type: ElementType.Comment | ElementType.Text | ElementType.Directive, data: string);
|
|
48
|
-
get nodeValue(): string;
|
|
49
|
-
set nodeValue(data: string);
|
|
50
|
-
}
|
|
51
|
-
/**
|
|
52
|
-
* Text within the document.
|
|
53
|
-
*/
|
|
54
|
-
export declare class Text extends DataNode {
|
|
55
|
-
constructor(data: string);
|
|
56
|
-
}
|
|
57
|
-
/**
|
|
58
|
-
* Comments within the document.
|
|
59
|
-
*/
|
|
60
|
-
export declare class Comment extends DataNode {
|
|
61
|
-
constructor(data: string);
|
|
62
|
-
}
|
|
63
|
-
/**
|
|
64
|
-
* Processing instructions, including doc types.
|
|
65
|
-
*/
|
|
66
|
-
export declare class ProcessingInstruction extends DataNode {
|
|
67
|
-
name: string;
|
|
68
|
-
constructor(name: string, data: string);
|
|
69
|
-
'x-name'?: string;
|
|
70
|
-
'x-publicId'?: string;
|
|
71
|
-
'x-systemId'?: string;
|
|
72
|
-
}
|
|
73
|
-
/**
|
|
74
|
-
* A `Node` that can have children.
|
|
75
|
-
*/
|
|
76
|
-
export declare class NodeWithChildren extends Node {
|
|
77
|
-
children: Node[];
|
|
78
|
-
/**
|
|
79
|
-
* @param type Type of the node.
|
|
80
|
-
* @param children Children of the node. Only certain node types can have children.
|
|
81
|
-
*/
|
|
82
|
-
constructor(type: ElementType.Root | ElementType.CDATA | ElementType.Script | ElementType.Style | ElementType.Tag, children: Node[]);
|
|
83
|
-
get firstChild(): Node | null;
|
|
84
|
-
get lastChild(): Node | null;
|
|
85
|
-
get childNodes(): Node[];
|
|
86
|
-
set childNodes(children: Node[]);
|
|
87
|
-
}
|
|
88
|
-
/**
|
|
89
|
-
* The root node of the document.
|
|
90
|
-
*/
|
|
91
|
-
export declare class Document extends NodeWithChildren {
|
|
92
|
-
constructor(children: Node[]);
|
|
93
|
-
'x-mode'?: 'no-quirks' | 'quirks' | 'limited-quirks';
|
|
94
|
-
}
|
|
95
|
-
/**
|
|
96
|
-
* The description of an individual attribute.
|
|
97
|
-
*/
|
|
98
|
-
interface Attribute {
|
|
99
|
-
name: string;
|
|
100
|
-
value: string;
|
|
101
|
-
namespace?: string;
|
|
102
|
-
prefix?: string;
|
|
103
|
-
}
|
|
104
|
-
/**
|
|
105
|
-
* An element within the DOM.
|
|
106
|
-
*/
|
|
107
|
-
export declare class Element extends NodeWithChildren {
|
|
108
|
-
name: string;
|
|
109
|
-
attribs: {
|
|
110
|
-
[name: string]: string;
|
|
111
|
-
};
|
|
112
|
-
/**
|
|
113
|
-
* @param name Name of the tag, eg. `div`, `span`.
|
|
114
|
-
* @param attribs Object mapping attribute names to attribute values.
|
|
115
|
-
* @param children Children of the node.
|
|
116
|
-
*/
|
|
117
|
-
constructor(name: string, attribs: {
|
|
118
|
-
[name: string]: string;
|
|
119
|
-
}, children?: Node[], type?: ElementType.Tag | ElementType.Script | ElementType.Style);
|
|
120
|
-
get tagName(): string;
|
|
121
|
-
set tagName(name: string);
|
|
122
|
-
get attributes(): Attribute[];
|
|
123
|
-
'x-attribsNamespace'?: Record<string, string>;
|
|
124
|
-
'x-attribsPrefix'?: Record<string, string>;
|
|
125
|
-
}
|
|
126
|
-
/**
|
|
127
|
-
* @param node Node to check.
|
|
128
|
-
* @returns `true` if the node is a `Element`, `false` otherwise.
|
|
129
|
-
*/
|
|
130
|
-
export declare function isTag(node: Node): node is Element;
|
|
131
|
-
/**
|
|
132
|
-
* @param node Node to check.
|
|
133
|
-
* @returns `true` if the node has the type `CDATA`, `false` otherwise.
|
|
134
|
-
*/
|
|
135
|
-
export declare function isCDATA(node: Node): node is NodeWithChildren;
|
|
136
|
-
/**
|
|
137
|
-
* @param node Node to check.
|
|
138
|
-
* @returns `true` if the node has the type `Text`, `false` otherwise.
|
|
139
|
-
*/
|
|
140
|
-
export declare function isText(node: Node): node is Text;
|
|
141
|
-
/**
|
|
142
|
-
* @param node Node to check.
|
|
143
|
-
* @returns `true` if the node has the type `Comment`, `false` otherwise.
|
|
144
|
-
*/
|
|
145
|
-
export declare function isComment(node: Node): node is DataNode;
|
|
146
|
-
/**
|
|
147
|
-
* @param node Node to check.
|
|
148
|
-
* @returns `true` if the node has the type `ProcessingInstruction`, `false` otherwise.
|
|
149
|
-
*/
|
|
150
|
-
export declare function isDirective(node: Node): node is ProcessingInstruction;
|
|
151
|
-
/**
|
|
152
|
-
* @param node Node to check.
|
|
153
|
-
* @returns `true` if the node has the type `ProcessingInstruction`, `false` otherwise.
|
|
154
|
-
*/
|
|
155
|
-
export declare function isDocument(node: Node): node is Document;
|
|
156
|
-
/**
|
|
157
|
-
* @param node Node to check.
|
|
158
|
-
* @returns `true` if the node is a `NodeWithChildren` (has children), `false` otherwise.
|
|
159
|
-
*/
|
|
160
|
-
export declare function hasChildren(node: Node): node is NodeWithChildren;
|
|
161
|
-
/**
|
|
162
|
-
* Clone a node, and optionally its children.
|
|
163
|
-
*
|
|
164
|
-
* @param recursive Clone child nodes as well.
|
|
165
|
-
* @returns A clone of the node.
|
|
166
|
-
*/
|
|
167
|
-
export declare function cloneNode<T extends Node>(node: T, recursive?: boolean): T;
|
|
168
|
-
export {};
|
|
@@ -1,404 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.cloneNode = exports.hasChildren = exports.isDocument = exports.isDirective = exports.isComment = exports.isText = exports.isCDATA = exports.isTag = exports.Element = exports.Document = exports.NodeWithChildren = exports.ProcessingInstruction = exports.Comment = exports.Text = exports.DataNode = exports.Node = void 0;
|
|
4
|
-
const ElementType_js_1 = require("./ElementType.js");
|
|
5
|
-
const nodeTypes = new Map([
|
|
6
|
-
[ElementType_js_1.ElementType.Tag, 1],
|
|
7
|
-
[ElementType_js_1.ElementType.Script, 1],
|
|
8
|
-
[ElementType_js_1.ElementType.Style, 1],
|
|
9
|
-
[ElementType_js_1.ElementType.Directive, 1],
|
|
10
|
-
[ElementType_js_1.ElementType.Text, 3],
|
|
11
|
-
[ElementType_js_1.ElementType.CDATA, 4],
|
|
12
|
-
[ElementType_js_1.ElementType.Comment, 8],
|
|
13
|
-
[ElementType_js_1.ElementType.Root, 9],
|
|
14
|
-
]);
|
|
15
|
-
/**
|
|
16
|
-
* This object will be used as the prototype for Nodes when creating a
|
|
17
|
-
* DOM-Level-1-compliant structure.
|
|
18
|
-
*/
|
|
19
|
-
class Node {
|
|
20
|
-
/**
|
|
21
|
-
*
|
|
22
|
-
* @param type The type of the node.
|
|
23
|
-
*/
|
|
24
|
-
constructor(type) {
|
|
25
|
-
Object.defineProperty(this, "type", {
|
|
26
|
-
enumerable: true,
|
|
27
|
-
configurable: true,
|
|
28
|
-
writable: true,
|
|
29
|
-
value: type
|
|
30
|
-
});
|
|
31
|
-
/** Parent of the node */
|
|
32
|
-
Object.defineProperty(this, "parent", {
|
|
33
|
-
enumerable: true,
|
|
34
|
-
configurable: true,
|
|
35
|
-
writable: true,
|
|
36
|
-
value: null
|
|
37
|
-
});
|
|
38
|
-
/** Previous sibling */
|
|
39
|
-
Object.defineProperty(this, "prev", {
|
|
40
|
-
enumerable: true,
|
|
41
|
-
configurable: true,
|
|
42
|
-
writable: true,
|
|
43
|
-
value: null
|
|
44
|
-
});
|
|
45
|
-
/** Next sibling */
|
|
46
|
-
Object.defineProperty(this, "next", {
|
|
47
|
-
enumerable: true,
|
|
48
|
-
configurable: true,
|
|
49
|
-
writable: true,
|
|
50
|
-
value: null
|
|
51
|
-
});
|
|
52
|
-
/** The start index of the node. Requires `withStartIndices` on the handler to be `true. */
|
|
53
|
-
Object.defineProperty(this, "startIndex", {
|
|
54
|
-
enumerable: true,
|
|
55
|
-
configurable: true,
|
|
56
|
-
writable: true,
|
|
57
|
-
value: null
|
|
58
|
-
});
|
|
59
|
-
/** The end index of the node. Requires `withEndIndices` on the handler to be `true. */
|
|
60
|
-
Object.defineProperty(this, "endIndex", {
|
|
61
|
-
enumerable: true,
|
|
62
|
-
configurable: true,
|
|
63
|
-
writable: true,
|
|
64
|
-
value: null
|
|
65
|
-
});
|
|
66
|
-
}
|
|
67
|
-
// Read-only aliases
|
|
68
|
-
get nodeType() {
|
|
69
|
-
return nodeTypes.get(this.type) ?? 1;
|
|
70
|
-
}
|
|
71
|
-
// Read-write aliases for properties
|
|
72
|
-
get parentNode() {
|
|
73
|
-
return this.parent;
|
|
74
|
-
}
|
|
75
|
-
set parentNode(parent) {
|
|
76
|
-
this.parent = parent;
|
|
77
|
-
}
|
|
78
|
-
get previousSibling() {
|
|
79
|
-
return this.prev;
|
|
80
|
-
}
|
|
81
|
-
set previousSibling(prev) {
|
|
82
|
-
this.prev = prev;
|
|
83
|
-
}
|
|
84
|
-
get nextSibling() {
|
|
85
|
-
return this.next;
|
|
86
|
-
}
|
|
87
|
-
set nextSibling(next) {
|
|
88
|
-
this.next = next;
|
|
89
|
-
}
|
|
90
|
-
/**
|
|
91
|
-
* Clone this node, and optionally its children.
|
|
92
|
-
*
|
|
93
|
-
* @param recursive Clone child nodes as well.
|
|
94
|
-
* @returns A clone of the node.
|
|
95
|
-
*/
|
|
96
|
-
cloneNode(recursive = false) {
|
|
97
|
-
return cloneNode(this, recursive);
|
|
98
|
-
}
|
|
99
|
-
}
|
|
100
|
-
exports.Node = Node;
|
|
101
|
-
/**
|
|
102
|
-
* A node that contains some data.
|
|
103
|
-
*/
|
|
104
|
-
class DataNode extends Node {
|
|
105
|
-
/**
|
|
106
|
-
* @param type The type of the node
|
|
107
|
-
* @param data The content of the data node
|
|
108
|
-
*/
|
|
109
|
-
constructor(type, data) {
|
|
110
|
-
super(type);
|
|
111
|
-
Object.defineProperty(this, "data", {
|
|
112
|
-
enumerable: true,
|
|
113
|
-
configurable: true,
|
|
114
|
-
writable: true,
|
|
115
|
-
value: data
|
|
116
|
-
});
|
|
117
|
-
}
|
|
118
|
-
get nodeValue() {
|
|
119
|
-
return this.data;
|
|
120
|
-
}
|
|
121
|
-
set nodeValue(data) {
|
|
122
|
-
this.data = data;
|
|
123
|
-
}
|
|
124
|
-
}
|
|
125
|
-
exports.DataNode = DataNode;
|
|
126
|
-
/**
|
|
127
|
-
* Text within the document.
|
|
128
|
-
*/
|
|
129
|
-
class Text extends DataNode {
|
|
130
|
-
constructor(data) {
|
|
131
|
-
super(ElementType_js_1.ElementType.Text, data);
|
|
132
|
-
}
|
|
133
|
-
}
|
|
134
|
-
exports.Text = Text;
|
|
135
|
-
/**
|
|
136
|
-
* Comments within the document.
|
|
137
|
-
*/
|
|
138
|
-
class Comment extends DataNode {
|
|
139
|
-
constructor(data) {
|
|
140
|
-
super(ElementType_js_1.ElementType.Comment, data);
|
|
141
|
-
}
|
|
142
|
-
}
|
|
143
|
-
exports.Comment = Comment;
|
|
144
|
-
/**
|
|
145
|
-
* Processing instructions, including doc types.
|
|
146
|
-
*/
|
|
147
|
-
class ProcessingInstruction extends DataNode {
|
|
148
|
-
constructor(name, data) {
|
|
149
|
-
super(ElementType_js_1.ElementType.Directive, data);
|
|
150
|
-
Object.defineProperty(this, "name", {
|
|
151
|
-
enumerable: true,
|
|
152
|
-
configurable: true,
|
|
153
|
-
writable: true,
|
|
154
|
-
value: name
|
|
155
|
-
});
|
|
156
|
-
Object.defineProperty(this, 'x-name', {
|
|
157
|
-
enumerable: true,
|
|
158
|
-
configurable: true,
|
|
159
|
-
writable: true,
|
|
160
|
-
value: void 0
|
|
161
|
-
});
|
|
162
|
-
Object.defineProperty(this, 'x-publicId', {
|
|
163
|
-
enumerable: true,
|
|
164
|
-
configurable: true,
|
|
165
|
-
writable: true,
|
|
166
|
-
value: void 0
|
|
167
|
-
});
|
|
168
|
-
Object.defineProperty(this, 'x-systemId', {
|
|
169
|
-
enumerable: true,
|
|
170
|
-
configurable: true,
|
|
171
|
-
writable: true,
|
|
172
|
-
value: void 0
|
|
173
|
-
});
|
|
174
|
-
}
|
|
175
|
-
}
|
|
176
|
-
exports.ProcessingInstruction = ProcessingInstruction;
|
|
177
|
-
/**
|
|
178
|
-
* A `Node` that can have children.
|
|
179
|
-
*/
|
|
180
|
-
class NodeWithChildren extends Node {
|
|
181
|
-
/**
|
|
182
|
-
* @param type Type of the node.
|
|
183
|
-
* @param children Children of the node. Only certain node types can have children.
|
|
184
|
-
*/
|
|
185
|
-
constructor(type, children) {
|
|
186
|
-
super(type);
|
|
187
|
-
Object.defineProperty(this, "children", {
|
|
188
|
-
enumerable: true,
|
|
189
|
-
configurable: true,
|
|
190
|
-
writable: true,
|
|
191
|
-
value: children
|
|
192
|
-
});
|
|
193
|
-
}
|
|
194
|
-
// Aliases
|
|
195
|
-
get firstChild() {
|
|
196
|
-
return this.children[0] ?? null;
|
|
197
|
-
}
|
|
198
|
-
get lastChild() {
|
|
199
|
-
return this.children.length > 0
|
|
200
|
-
? this.children[this.children.length - 1]
|
|
201
|
-
: null;
|
|
202
|
-
}
|
|
203
|
-
get childNodes() {
|
|
204
|
-
return this.children;
|
|
205
|
-
}
|
|
206
|
-
set childNodes(children) {
|
|
207
|
-
this.children = children;
|
|
208
|
-
}
|
|
209
|
-
}
|
|
210
|
-
exports.NodeWithChildren = NodeWithChildren;
|
|
211
|
-
/**
|
|
212
|
-
* The root node of the document.
|
|
213
|
-
*/
|
|
214
|
-
class Document extends NodeWithChildren {
|
|
215
|
-
constructor(children) {
|
|
216
|
-
super(ElementType_js_1.ElementType.Root, children);
|
|
217
|
-
Object.defineProperty(this, 'x-mode', {
|
|
218
|
-
enumerable: true,
|
|
219
|
-
configurable: true,
|
|
220
|
-
writable: true,
|
|
221
|
-
value: void 0
|
|
222
|
-
});
|
|
223
|
-
}
|
|
224
|
-
}
|
|
225
|
-
exports.Document = Document;
|
|
226
|
-
/**
|
|
227
|
-
* An element within the DOM.
|
|
228
|
-
*/
|
|
229
|
-
class Element extends NodeWithChildren {
|
|
230
|
-
/**
|
|
231
|
-
* @param name Name of the tag, eg. `div`, `span`.
|
|
232
|
-
* @param attribs Object mapping attribute names to attribute values.
|
|
233
|
-
* @param children Children of the node.
|
|
234
|
-
*/
|
|
235
|
-
constructor(name, attribs, children = [], type = name === 'script'
|
|
236
|
-
? ElementType_js_1.ElementType.Script
|
|
237
|
-
: name === 'style'
|
|
238
|
-
? ElementType_js_1.ElementType.Style
|
|
239
|
-
: ElementType_js_1.ElementType.Tag) {
|
|
240
|
-
super(type, children);
|
|
241
|
-
Object.defineProperty(this, "name", {
|
|
242
|
-
enumerable: true,
|
|
243
|
-
configurable: true,
|
|
244
|
-
writable: true,
|
|
245
|
-
value: name
|
|
246
|
-
});
|
|
247
|
-
Object.defineProperty(this, "attribs", {
|
|
248
|
-
enumerable: true,
|
|
249
|
-
configurable: true,
|
|
250
|
-
writable: true,
|
|
251
|
-
value: attribs
|
|
252
|
-
});
|
|
253
|
-
Object.defineProperty(this, 'x-attribsNamespace', {
|
|
254
|
-
enumerable: true,
|
|
255
|
-
configurable: true,
|
|
256
|
-
writable: true,
|
|
257
|
-
value: void 0
|
|
258
|
-
});
|
|
259
|
-
Object.defineProperty(this, 'x-attribsPrefix', {
|
|
260
|
-
enumerable: true,
|
|
261
|
-
configurable: true,
|
|
262
|
-
writable: true,
|
|
263
|
-
value: void 0
|
|
264
|
-
});
|
|
265
|
-
}
|
|
266
|
-
// DOM Level 1 aliases
|
|
267
|
-
get tagName() {
|
|
268
|
-
return this.name;
|
|
269
|
-
}
|
|
270
|
-
set tagName(name) {
|
|
271
|
-
this.name = name;
|
|
272
|
-
}
|
|
273
|
-
get attributes() {
|
|
274
|
-
return Object.keys(this.attribs).map(name => ({
|
|
275
|
-
name,
|
|
276
|
-
value: this.attribs[name],
|
|
277
|
-
namespace: this['x-attribsNamespace']?.[name],
|
|
278
|
-
prefix: this['x-attribsPrefix']?.[name],
|
|
279
|
-
}));
|
|
280
|
-
}
|
|
281
|
-
}
|
|
282
|
-
exports.Element = Element;
|
|
283
|
-
/**
|
|
284
|
-
* @param node Node to check.
|
|
285
|
-
* @returns `true` if the node is a `Element`, `false` otherwise.
|
|
286
|
-
*/
|
|
287
|
-
function isTag(node) {
|
|
288
|
-
return (0, ElementType_js_1.isTag)(node);
|
|
289
|
-
}
|
|
290
|
-
exports.isTag = isTag;
|
|
291
|
-
/**
|
|
292
|
-
* @param node Node to check.
|
|
293
|
-
* @returns `true` if the node has the type `CDATA`, `false` otherwise.
|
|
294
|
-
*/
|
|
295
|
-
function isCDATA(node) {
|
|
296
|
-
return node.type === ElementType_js_1.ElementType.CDATA;
|
|
297
|
-
}
|
|
298
|
-
exports.isCDATA = isCDATA;
|
|
299
|
-
/**
|
|
300
|
-
* @param node Node to check.
|
|
301
|
-
* @returns `true` if the node has the type `Text`, `false` otherwise.
|
|
302
|
-
*/
|
|
303
|
-
function isText(node) {
|
|
304
|
-
return node.type === ElementType_js_1.ElementType.Text;
|
|
305
|
-
}
|
|
306
|
-
exports.isText = isText;
|
|
307
|
-
/**
|
|
308
|
-
* @param node Node to check.
|
|
309
|
-
* @returns `true` if the node has the type `Comment`, `false` otherwise.
|
|
310
|
-
*/
|
|
311
|
-
function isComment(node) {
|
|
312
|
-
return node.type === ElementType_js_1.ElementType.Comment;
|
|
313
|
-
}
|
|
314
|
-
exports.isComment = isComment;
|
|
315
|
-
/**
|
|
316
|
-
* @param node Node to check.
|
|
317
|
-
* @returns `true` if the node has the type `ProcessingInstruction`, `false` otherwise.
|
|
318
|
-
*/
|
|
319
|
-
function isDirective(node) {
|
|
320
|
-
return node.type === ElementType_js_1.ElementType.Directive;
|
|
321
|
-
}
|
|
322
|
-
exports.isDirective = isDirective;
|
|
323
|
-
/**
|
|
324
|
-
* @param node Node to check.
|
|
325
|
-
* @returns `true` if the node has the type `ProcessingInstruction`, `false` otherwise.
|
|
326
|
-
*/
|
|
327
|
-
function isDocument(node) {
|
|
328
|
-
return node.type === ElementType_js_1.ElementType.Root;
|
|
329
|
-
}
|
|
330
|
-
exports.isDocument = isDocument;
|
|
331
|
-
/**
|
|
332
|
-
* @param node Node to check.
|
|
333
|
-
* @returns `true` if the node is a `NodeWithChildren` (has children), `false` otherwise.
|
|
334
|
-
*/
|
|
335
|
-
function hasChildren(node) {
|
|
336
|
-
return Object.prototype.hasOwnProperty.call(node, 'children');
|
|
337
|
-
}
|
|
338
|
-
exports.hasChildren = hasChildren;
|
|
339
|
-
/**
|
|
340
|
-
* Clone a node, and optionally its children.
|
|
341
|
-
*
|
|
342
|
-
* @param recursive Clone child nodes as well.
|
|
343
|
-
* @returns A clone of the node.
|
|
344
|
-
*/
|
|
345
|
-
function cloneNode(node, recursive = false) {
|
|
346
|
-
let result;
|
|
347
|
-
if (isText(node)) {
|
|
348
|
-
result = new Text(node.data);
|
|
349
|
-
}
|
|
350
|
-
else if (isComment(node)) {
|
|
351
|
-
result = new Comment(node.data);
|
|
352
|
-
}
|
|
353
|
-
else if (isTag(node)) {
|
|
354
|
-
const children = recursive ? cloneChildren(node.children) : [];
|
|
355
|
-
const clone = new Element(node.name, { ...node.attribs }, children);
|
|
356
|
-
children.forEach(child => (child.parent = clone));
|
|
357
|
-
if (node['x-attribsNamespace']) {
|
|
358
|
-
clone['x-attribsNamespace'] = { ...node['x-attribsNamespace'] };
|
|
359
|
-
}
|
|
360
|
-
if (node['x-attribsPrefix']) {
|
|
361
|
-
clone['x-attribsPrefix'] = { ...node['x-attribsPrefix'] };
|
|
362
|
-
}
|
|
363
|
-
result = clone;
|
|
364
|
-
}
|
|
365
|
-
else if (isCDATA(node)) {
|
|
366
|
-
const children = recursive ? cloneChildren(node.children) : [];
|
|
367
|
-
const clone = new NodeWithChildren(ElementType_js_1.ElementType.CDATA, children);
|
|
368
|
-
children.forEach(child => (child.parent = clone));
|
|
369
|
-
result = clone;
|
|
370
|
-
}
|
|
371
|
-
else if (isDocument(node)) {
|
|
372
|
-
const children = recursive ? cloneChildren(node.children) : [];
|
|
373
|
-
const clone = new Document(children);
|
|
374
|
-
children.forEach(child => (child.parent = clone));
|
|
375
|
-
if (node['x-mode']) {
|
|
376
|
-
clone['x-mode'] = node['x-mode'];
|
|
377
|
-
}
|
|
378
|
-
result = clone;
|
|
379
|
-
}
|
|
380
|
-
else if (isDirective(node)) {
|
|
381
|
-
const instruction = new ProcessingInstruction(node.name, node.data);
|
|
382
|
-
if (node['x-name'] != null) {
|
|
383
|
-
instruction['x-name'] = node['x-name'];
|
|
384
|
-
instruction['x-publicId'] = node['x-publicId'];
|
|
385
|
-
instruction['x-systemId'] = node['x-systemId'];
|
|
386
|
-
}
|
|
387
|
-
result = instruction;
|
|
388
|
-
}
|
|
389
|
-
else {
|
|
390
|
-
throw new Error(`Not implemented yet: ${node.type}`);
|
|
391
|
-
}
|
|
392
|
-
result.startIndex = node.startIndex;
|
|
393
|
-
result.endIndex = node.endIndex;
|
|
394
|
-
return result;
|
|
395
|
-
}
|
|
396
|
-
exports.cloneNode = cloneNode;
|
|
397
|
-
function cloneChildren(childs) {
|
|
398
|
-
const children = childs.map(child => cloneNode(child, true));
|
|
399
|
-
for (let i = 1; i < children.length; i++) {
|
|
400
|
-
children[i].prev = children[i - 1];
|
|
401
|
-
children[i - 1].next = children[i];
|
|
402
|
-
}
|
|
403
|
-
return children;
|
|
404
|
-
}
|