Feature Request: Support "internal" as visibility
Generating interfaces is useful for internally used classes too, which are not part of the interface of a compilation unit. I'd prefer using the same accessibility for the interface as used for the class. Is there any interest in that?
What is your idea? Do you want to decorate the interface OR members of the interface?
I.e. internal IFoo or internal string Baz {get; set;}?
I think the first is possible if I can manage https://github.com/codecentric/net_automatic_interface/issues/29 - otherwise it gets confusing really fast.
The latter would also require an Attribute on the Class Member itself, since all interface Members must be public, even if the Interface itself declares them at a different visibillity.
I'd start with the actual access modifier for a class, so have internal class SomethingNeededInTheAssemblyOnly: ISomethingNeededInTheAssemblyOnly result in a internal interface ISomethingNeededInTheAssemblyOnly.
That would enable the interface separation between "public API" of an assembly and "internal implementation details."
I don't think clean API design and "split the interface of a public class into public and internal methods" goes well together, so that would be out of scope.
I've put together a PR to show what I mean: https://github.com/codecentric/net_automatic_interface/pull/43
Perhaps I can add our use case here: Classes are always internal because the implementation isn't meant to be exposed externally. The interface, on the other hand, is usually public. However, there are cases where only the own assembly itself should know about this interface, and therefore an "internal interface Ixxx" should be generated. The ideal approach would therefore be to have an "asInternal" parameter for the attribute.
@klaus-lair I think that's a good idea. PRs are welcome