IANAL, but this is likely a legal gray area regarding software licenses, especially if you read the AGPL code prior to writing your library. Companies that do this sort of thing professionally have a/b teams that don't speak to each other (one reads and generates design documents, the other uses those design documents to write a new library) to prevent a lawsuit for violating licensing terms. They can claim that the developers writing the library didn't copy any code from the source library.
As for the typedef, it's most likely considered a public definition document. I would think it would be like a public C# interface, where it's only the method declarations and expected parameters and the actual implementation is not included at all.
If you're considering publishing this or using it commercially you should definitely consult a lawyer that specializes in copyright.