Create a new instance of the Deaccessibilizer. Gets the tree-sitter parser for Swift, considering whether it is running in Node.js or WebAssembly.
Apply the given code transformations to the tree.
This method is faster than applyFaultTransformationsToTreeWithRebuild, but it is less safe, since it sorts and applies all transformations at once.
This is recommended for small batches of code transformations.
Get the fault transformations from the given rules and apply them directly to the tree. If no rules are provided, all rules are considered.
This method is safer than applyCodeTransformationsToTree, since it applies one rule at a time and rebuilds the tree after each transformation.
This is reccomended for large batches of code transformations.
Create a Swift file tree from the given file text.
Get the code transformations introducing a fault that can be applied to the given tree, based on the given rules. If no rules are provided, all rules are considered.
Query a Swift file tree with a query in tree-sitter syntax.
Query the SwiftUI views in the file tree with a query in tree-sitter syntax.
The main class of the library, responsible for handling Swift files, creating syntax trees, performing queries, and transforming code.