> Documentation index: https://developer.android.com/reference/llms.txt

# RemoteSerializationCodeGenerator

Artifact: [androidx.compose.remote:remote-generator](https://developer.android.com/jetpack/androidx/releases/compose-remote.md.txt) [View Source](https://cs.android.com/search?q=file:androidx/compose/remote/generator/RemoteSerializationCodeGenerator.kt+class:androidx.compose.remote.generator.RemoteSerializationCodeGenerator) Added in [1.0.0-alpha25](https://developer.android.com/jetpack/androidx/releases/compose-remote.md.txt#1.0.0-alpha25)


```
object RemoteSerializationCodeGenerator
```

<br />

*** ** * ** ***

Generates RemoteCompose wire-protocol serialization bindings for target languages.

## Summary

| ### Constants |
|---|---|
| `const Int` | `LANGUAGE_CPP = 1` Generates C++17 bindings (`WireBuffer.h`, `WireBuffer.cpp`, `RemoteComposeOps.h`, and `RemoteComposeOps.cpp`). |
| `const Int` | `LANGUAGE_PYTHON = 3` Generates Python 3 bindings (`remote_compose.py`). |
| `const Int` | `LANGUAGE_RUST = 2` Generates Rust bindings (`remote_compose_operations.rs` and `op_codes.rs`). |
| `const Int` | `LANGUAGE_SWIFT = 4` Generates Swift bindings (`RemoteComposeOperations.swift`). |
| `const Int` | `LANGUAGE_TYPESCRIPT = 5` Generates TypeScript bindings (`remoteComposeOperations.ts`). |

| ### Public functions |
|---|---|
| `Unit` | `generate(language: Int, outputDirectory: Path)` Generates RemoteCompose operation bindings for `language` into `outputDirectory`. |

## Constants

### LANGUAGE_CPP

Added in [1.0.0-alpha25](https://developer.android.com/jetpack/androidx/releases/compose-remote.md.txt#1.0.0-alpha25)

```
const val LANGUAGE_CPP = 1: Int
```

Generates C++17 bindings (`WireBuffer.h`, `WireBuffer.cpp`, `RemoteComposeOps.h`, and `RemoteComposeOps.cpp`).

### LANGUAGE_PYTHON

Added in [1.0.0-alpha25](https://developer.android.com/jetpack/androidx/releases/compose-remote.md.txt#1.0.0-alpha25)

```
const val LANGUAGE_PYTHON = 3: Int
```

Generates Python 3 bindings (`remote_compose.py`).

### LANGUAGE_RUST

Added in [1.0.0-alpha25](https://developer.android.com/jetpack/androidx/releases/compose-remote.md.txt#1.0.0-alpha25)

```
const val LANGUAGE_RUST = 2: Int
```

Generates Rust bindings (`remote_compose_operations.rs` and `op_codes.rs`).

### LANGUAGE_SWIFT

Added in [1.0.0-alpha25](https://developer.android.com/jetpack/androidx/releases/compose-remote.md.txt#1.0.0-alpha25)

```
const val LANGUAGE_SWIFT = 4: Int
```

Generates Swift bindings (`RemoteComposeOperations.swift`).

### LANGUAGE_TYPESCRIPT

Added in [1.0.0-alpha25](https://developer.android.com/jetpack/androidx/releases/compose-remote.md.txt#1.0.0-alpha25)

```
const val LANGUAGE_TYPESCRIPT = 5: Int
```

Generates TypeScript bindings (`remoteComposeOperations.ts`).

## Public functions

### generate

Added in [1.0.0-alpha25](https://developer.android.com/jetpack/androidx/releases/compose-remote.md.txt#1.0.0-alpha25)

```
fun generate(language: Int, outputDirectory: Path): Unit
```

Generates RemoteCompose operation bindings for `language` into `outputDirectory`.

Creates `outputDirectory` if it does not exist and overwrites target files in place.

| Parameters |
|---|---|
| `language: Int` | target language constant (`LANGUAGE_CPP`, `LANGUAGE_RUST`, `LANGUAGE_PYTHON`, `LANGUAGE_SWIFT`, or `LANGUAGE_TYPESCRIPT`) Value is one of the following: - `1` - `2` - `3` - `4` - `5` <br /> |
| `outputDirectory: Path` | directory where generated source files are written |

| Throws |
|---|---|
| `IllegalArgumentException` | if `language` is not a supported `LANGUAGE_*` constant |
| `IOException` | if writing to `outputDirectory` fails |