---
lang: en
title: 'API docs: repository.model'
keywords: LoopBack 4.0, LoopBack 4, Node.js, TypeScript, OpenAPI
sidebar: lb4_sidebar
editurl: https://github.com/loopbackio/loopback-next/tree/master/packages/repository
permalink: /doc/en/lb4/apidocs.repository.model.html
---

<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [@loopback/repository](./repository.md) &gt; [model](./repository.model.md)

## model() function

Decorator for model definitions

<b>Signature:</b>

```typescript
export declare function model(definition?: Partial<ModelDefinitionSyntax>): (target: Function & {
    definition?: ModelDefinition;
}) => void;
```

## Parameters

|  Parameter | Type | Description |
|  --- | --- | --- |
|  definition | Partial&lt;[ModelDefinitionSyntax](./repository.modeldefinitionsyntax.md)<!-- -->&gt; |  |

<b>Returns:</b>

(target: Function &amp; { definition?: [ModelDefinition](./repository.modeldefinition.md)<!-- -->; }) =&gt; void

A class decorator for `model`


