If you want to bind a class to gdscript with a singleton set up, you have to bind a dummy class. The dummy class access the singeton. The process of setting up a signal should be similar to a regular function call.
Size2 _OS::get_screen_size(int p_screen) const {
return OS::get_singleton()->get_screen_size(p_screen);
}
void _OS::_bind_method() {
ClassDB::bind_method(D_METHOD("get_screen_size", "screen"), &_OS::get_screen_size, DEFVAL(-1));
}
https://github.com/godotengine/godot/blob/e0f43e06785ea1b05a5d7c4be32b74a9995be8fe/core/bind/core_bind.h#L93
https://github.com/godotengine/godot/blob/e0f43e06785ea1b05a5d7c4be32b74a9995be8fe/core/bind/core_bind.cpp
i would recommend using OS class as a guide.
Basically, you have a regular class
void register_types() {
foo = memnew(FOO);
foo->init();
_foo = memnew(_FOO);
ClassDB::register_class<_FOO>();
Engine::get_singleton()->add_singleton(Engine::Singleton("FOO",
_FOO::get_singleton()));
}
I am thinking of writing a guide on how to do these things but it will take awhile since Godot servers is an integral part of the engine,