But you dntdon't need to pass page in every function of a class. Instead you can pass the page object from test class while creating the object of the class.
const searchPage = new SearchPage(page). thisconst searchPage = new SearchPage(page)
This will work.