Typescript and Class used before its declaration

The typescript client stopped compiling when I added the azure media services nuget package and was trying to output The culprits are below. I can see the dependencies are not generated in order in the file. I’m not sure what needs to be changed?

dto.dtos.ts(86,37): error TS1023: An index signature parameter type must be ‘string’ or ‘number’.
dto.dtos.ts(121,48): error TS2449: Class ‘BaseCollection’ used before its declaration.
dto.dtos.ts(233,46): error TS2449: Class ‘BaseCollection’ used before its declaration.
dto.dtos.ts(323,68): error TS2449: Class ‘CloudBaseCollection’ used before its declaration.
dto.dtos.ts(334,62): error TS2449: Class ‘CloudBaseCollection’ used before its declaration.
dto.dtos.ts(338,52): error TS2449: Class ‘CloudBaseCollection’ used before its declaration.
dto.dtos.ts(446,44): error TS2449: Class ‘CloudBaseCollection’ used before its declaration.
dto.dtos.ts(468,44): error TS2449: Class ‘CloudBaseCollection’ used before its declaration.
dto.dtos.ts(513,54): error TS2449: Class ‘CloudBaseCollection’ used before its declaration.
dto.dtos.ts(558,49): error TS2449: Class ‘CloudBaseCollection’ used before its declaration.
dto.dtos.ts(566,47): error TS2449: Class ‘CloudBaseCollection’ used before its declaration.
dto.dtos.ts(598,40): error TS2449: Class ‘CloudBaseCollection’ used before its declaration.
dto.dtos.ts(602,48): error TS2449: Class ‘CloudBaseCollection’ used before its declaration.
dto.dtos.ts(616,51): error TS2449: Class ‘CloudBaseCollection’ used before its declaration.
dto.dtos.ts(620,51): error TS2449: Class ‘CloudBaseCollection’ used before its declaration.
dto.dtos.ts(634,53): error TS2449: Class ‘CloudBaseCollection’ used before its declaration.
dto.dtos.ts(651,53): error TS2449: Class ‘CloudBaseCollection’ used before its declaration.
dto.dtos.ts(722,47): error TS2449: Class ‘CloudBaseCollection’ used before its declaration.
dto.dtos.ts(726,44): error TS2449: Class ‘CloudBaseCollection’ used before its declaration.
dto.dtos.ts(787,56): error TS2449: Class ‘CloudBaseCollection’ used before its declaration.

You’re leaking Azure Types in your DTOs, we don’t support 3rd party types that aren’t using clean DTOs. You can copy the data into clean DTOs.

If you can narrow it down to a problem class that’s causing the issue, we’ll see if it’s something we should try to add support for or not.

I knew you were going to respond that way and you are right, I am just returning the azure media classes for a proof of concept although I don’t particularly look forward to building clean dto’s for them. I know which classes use the CloudBaseCollection and BaseCollection and the typescript client is still generating them out of order. For now I’m just manually moving them to the top of the file.