Recently, the string parameter overload of AddComponent was removed, I guess to prevent ambiguity in what it actually was doing with that string. (since for such cases, defining the type makes sense universally, making it fully generic) I hope they don’t mess with GetComponent too much though.
SomeScript myScript = gameObject.AddComponent(typeof(SomeScript)) as SomeScript;
And typeof should work with all classes that can be added as a component! AddComponent is very much like Instantiate and returns the object it created.
Just in case you wanted to read up on different topics:
As shown in the link above there are three different ways to add and cast the object using <T>, ("string type of T"), and typeof(T) and using the castings shown above.