I created t4 template(TypeScriptTemplate.tt
) for generation .d.ts(TypeScriptTemplate.d.ts
) annotation file for all rest API proxies(at case of AngularJS). Included it into Web
project, so you can simple rebuild it and then ran corresponding .tt file, as a result .d.ts file will be created with bunch of interfaces and you can use them as intellisence and for validation purposes on client side during development. You can view more info with example at rejected pull request. Code, that actually do all work, is located at TypeScriptGenerator.cs
:
Excerpt from autogenerated output .d.ts file:
interface UserAppService {
prohibitPermission(input: ProhibitPermissionInput, ajaxParams?: JQueryAjaxSettings): AbpResultVoid;
removeFromRole(userId: number, roleName: string, ajaxParams?: JQueryAjaxSettings): AbpResultVoid;
getUsers(ajaxParams?: JQueryAjaxSettings): AbpResult<ListResultDto<UserListDto>>;
createUser(input: CreateUserInput, ajaxParams?: JQueryAjaxSettings): AbpResultVoid;
}
