Found out.
You can do this by using _get_property_list()
func _get_property_list() -> Array:
return [
{
name="test",
type=TYPE_NODE_PATH,
usage=PROPERTY_USAGE_DEFAULT,
hint=35,
hint_string="Node"
}
]
At hint=35
is not in the docs; I found it from here
I have no idea how to do it for export key-word, though. Trying
export(NodePath, 'Node') var test: NodePath
return an error
Parse Error: Type "NodePath" can't take hints.
Advance export docs