YD_Event.Web/templates/type-data-contract.ejs
2025-12-17 10:38:15 +08:00

16 lines
450 B
Plaintext

<%
const { contract, utils } = it;
const { formatDescription, require, _ } = utils;
%>
<% if (contract.$content.length) { %>
export type <%~ contract.name %> = {
<% for (const field of contract.$content) { %>
<%~ includeFile('./object-field-jsdoc.ejs', { ...it, field }) %>
<%~ field.field %>;
<% } %>
}<%~ utils.isNeedToAddNull(contract) ? ' | null' : ''%>
<% } else { %>
export type <%~ contract.name %> = Record<string, any>;
<% } %>