@loopback/docs
Version:
Documentation files rendered at [https://loopback.io](https://loopback.io)
49 lines (34 loc) • 1.63 kB
Markdown
---
lang: en
title: 'API docs: repository.uniontype'
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.uniontype.html
---
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) > [@loopback/repository](./repository.md) > [UnionType](./repository.uniontype.md)
## UnionType class
Union type, such as string \| number
<b>Signature:</b>
```typescript
export declare class UnionType implements Type<any>
```
<b>Implements:</b> [Type](./repository.type.md)<!-- --><any>
## Constructors
| Constructor | Modifiers | Description |
| --- | --- | --- |
| [(constructor)(itemTypes)](./repository.uniontype._constructor_.md) | | Constructs a new instance of the <code>UnionType</code> class |
## Properties
| Property | Modifiers | Type | Description |
| --- | --- | --- | --- |
| [itemTypes](./repository.uniontype.itemtypes.md) | | [Type](./repository.type.md)<!-- --><any>\[\] | |
| [name](./repository.uniontype.name.md) | | (not declared) | |
## Methods
| Method | Modifiers | Description |
| --- | --- | --- |
| [coerce(value)](./repository.uniontype.coerce.md) | | |
| [defaultValue()](./repository.uniontype.defaultvalue.md) | | |
| [isCoercible(value)](./repository.uniontype.iscoercible.md) | | |
| [isInstance(value)](./repository.uniontype.isinstance.md) | | |
| [serialize(value)](./repository.uniontype.serialize.md) | | |