type-data-contract.ejs 452 B

123456789101112131415
  1. <%
  2. const { contract, utils } = it;
  3. const { formatDescription, require, _ } = utils;
  4. %>
  5. <% if (contract.$content.length) { %>
  6. export type <%~ contract.name %> = {
  7. <% _.forEach(contract.$content, (field) => { %>
  8. <%~ includeFile('./object-field-jsdoc.ejs', { ...it, field }) %>
  9. <%~ field.field %>;
  10. <% }) %>
  11. }<%~ utils.isNeedToAddNull(contract) ? ' | null' : ''%>
  12. <% } else { %>
  13. export type <%~ contract.name %> = Record<string, any>;
  14. <% } %>