Add target selector argument in custom component

I am currently developing a library with reusable components. One of these components needs an selector as an argument. Up until now, i have just used a string for that task, but would like to know how i can recreate the selector from the target area in for example the “Element Exists” activity (as shown below).

image

The problem is that when i use a string for that task, it wil for good reasons remain a string and always open up in the expression editor, whereas the selector in the “element exists” activity will open up in the selector editor after you have typed in the selector as a string once.

I dont know which type to use in the argumentlist to achieve this or if it is even possible.

it would be nice i you could recreate the entire Target area in you own components.