All Downloads are FREE. Search and download functionalities are using the official Maven repository.

typescript-fetch-api.modelGeneric.handlebars Maven / Gradle / Ivy

{{~#if description}}
/**
 * {{{description}}}
 */
{{~/if}}
export interface {{classname}} {{#if parent}}extends {{{parent}}} {{/if}}{

{{~#if additionalPropertiesType}}
    [key: string]: {{{additionalPropertiesType}}}{{#hasVars}} | any{{/hasVars}};

{{/if~}}
{{~#vars}}
    {{~#if description}}
    /**
     * {{{description}}}
     */
    {{~/if}}
    {{name}}{{^required}}?{{/required}}: {{#if isEnum}}{{{datatypeWithEnum}}}{{else if isFile}}Blob{{else}}{{{dataType}}}{{/if}}{{#isNullable}} | null{{/isNullable}};
{{~/vars}}
}
{{~#if vendorExtensions.ts-fetch-api-omitted-in-request}}

export type {{classname}}Request = Omit<{{classname}}, {{#vendorExtensions.ts-fetch-api-omitted-in-request}}"{{name}}"{{#unless @last}}|{{/unless}}{{/vendorExtensions.ts-fetch-api-omitted-in-request}}>{{#vars}}{{#vendorExtensions.ts-fetch-api-request-type}}
    & { {{name}}: {{{.}}} }{{/vendorExtensions.ts-fetch-api-request-type}}{{/vars}};
{{~/if}}
{{~#if vendorExtensions.ts-fetch-api-omitted-in-response}}

export type {{classname}}Response = Omit<{{classname}}, {{#vendorExtensions.ts-fetch-api-omitted-in-response}}"{{name}}"{{#unless @last}}|{{/unless}}{{/vendorExtensions.ts-fetch-api-omitted-in-response}}>;
{{~/if}}
{{~#vars}}{{~#isEnum}}

export const {{enumName}}Values = [
{{~#allowableValues}}
    {{~#enumVars}}
    {{{value}}},
    {{~/enumVars}}
{{~/allowableValues}}
] as const;
{{#if description}}
/**
 * {{{description}}}
 */{{/if}}
export type {{enumName}} = typeof {{enumName}}Values[number];
{{~/isEnum}}{{~/vars}}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy