feat(web): document the API

This commit is contained in:
Amaan Qureshi 2025-01-20 02:43:52 -05:00
parent a4b20c1c56
commit 09cb4c5729
17 changed files with 1155 additions and 198 deletions

View file

@ -43,6 +43,7 @@
"ts_node_next_named_sibling_wasm",
"ts_node_next_sibling_wasm",
"ts_node_parent_wasm",
"ts_node_child_with_descendant_wasm",
"ts_node_prev_named_sibling_wasm",
"ts_node_prev_sibling_wasm",
"ts_node_descendant_count_wasm",

View file

@ -597,6 +597,12 @@ void ts_node_parent_wasm(const TSTree *tree) {
marshal_node(TRANSFER_BUFFER, ts_node_parent(node));
}
void ts_node_child_with_descendant_wasm(const TSTree *tree) {
TSNode node = unmarshal_node(tree);
TSNode descendant = unmarshal_node(tree);
marshal_node(TRANSFER_BUFFER, ts_node_child_with_descendant(node, descendant));
}
void ts_node_descendant_for_index_wasm(const TSTree *tree) {
TSNode node = unmarshal_node(tree);
const void **address = TRANSFER_BUFFER + SIZE_OF_NODE;

View file

@ -174,6 +174,7 @@ interface WasmModule {
_ts_node_prev_named_sibling_wasm(_0: number): void;
_ts_node_descendant_count_wasm(_0: number): number;
_ts_node_parent_wasm(_0: number): void;
_ts_node_child_with_descendant_wasm(_0: number): void;
_ts_node_descendant_for_index_wasm(_0: number): void;
_ts_node_named_descendant_for_index_wasm(_0: number): void;
_ts_node_descendant_for_position_wasm(_0: number): void;