Get node type in editor

Godot Version

4.3

Question

How to get attached script node type in editor mode (the script that run when i give [Tool])? When the game is running, i can get node type by casting it to the script attached or using GetNode T, for example:
GetParent() as AttachedScript;
or
GetNode<AttachedScript>(“…”);

but when i try this when godot is still in the editor mode, i can only get the node type, not the script type that is attached to the node. I can’t find any resources on how i can do this