Create a new instance of the Deaccessibilizer. Gets the tree-sitter parser for Swift, considering whether it is running in Node.js or WebAssembly, and the hasher for checksums.
Apply the given mutations to the tree.
This method is faster than applyOperatorsToTreeWithRebuild, but it is less safe, since it sorts and applies all mutations at once.
This is recommended for small batches of mutations.
Get the mutations from the given operators and apply them directly to the tree. If no operators are provided, all of them are considered.
This method is safer than applyCodeMutationsToTree, since it applies one operator at a time and rebuilds the tree after each mutation.
This is recommended for large batches of mutations.
Apply the given serializable mutation to the file text.
This can apply mutations previously returned by getSerializableCodeMutations and getSerializableCodeMutationsFromOperators.
Create a Swift file tree from the given file text.
Get the possible mutations that can be applied to the given tree, based on the given operators. If no operators are provided, all of them are considered.
Get the mutations for a file text, based on the given operators.
Given a tree and generated mutations, converts the mutations into a serializable format.
Given a tree, get mutations in a serializable format from the given operators.
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 mutating code.