---
jsApi: true
title: "[F] $encode"

---
```ts
$encode(
   context, 
   target, 
   encoding, 
   encodedAs?): void
```

## Parameters

| Parameter | Type |
| :------ | :------ |
| `context` | [`DecoratorContext`](../interfaces/DecoratorContext.md) |
| `target` | [`Scalar`](../interfaces/Scalar.md) \| [`ModelProperty`](../interfaces/ModelProperty.md) |
| `encoding` | [`Type`](../type-aliases/Type.md) |
| `encodedAs`? | [`Scalar`](../interfaces/Scalar.md) |

## Returns

`void`
