<!--
This file was generated by Spark. Do not edit it by hand.
-->
# AshTypescript.Rpc
## typescript_rpc
Define available RPC-actions for resources in this domain.
### Nested DSLs
 * [resource](#typescript_rpc-resource)
   * rpc_action
   * typed_query
### typescript_rpc.resource
```elixir
resource resource
```
Define available RPC-actions for a resource
### Nested DSLs
 * [rpc_action](#typescript_rpc-resource-rpc_action)
 * [typed_query](#typescript_rpc-resource-typed_query)
### Arguments
| Name | Type | Default | Docs |
|------|------|---------|------|
| [`resource`](#typescript_rpc-resource-resource){: #typescript_rpc-resource-resource } | `module` |  | The resource being configured |
### typescript_rpc.resource.rpc_action
```elixir
rpc_action name, action
```
Define an RPC action that exposes a resource action to TypeScript clients.
Metadata fields: Action metadata can be exposed via `show_metadata` option.
Set to `nil` (default) to expose all metadata fields, `false` or `[]` to disable,
or provide a list of atoms to expose specific fields.
Metadata field naming: Use `metadata_field_names` to map invalid metadata field names
(e.g., `field_1`, `is_valid?`) to valid TypeScript identifiers.
Example: `metadata_field_names [field_1: :field1, is_valid?: :isValid]`
### Arguments
| Name | Type | Default | Docs |
|------|------|---------|------|
| [`name`](#typescript_rpc-resource-rpc_action-name){: #typescript_rpc-resource-rpc_action-name } | `atom` |  | The name of the RPC-action |
| [`action`](#typescript_rpc-resource-rpc_action-action){: #typescript_rpc-resource-rpc_action-action } | `atom` |  | The resource action to expose |
### Options
| Name | Type | Default | Docs |
|------|------|---------|------|
| [`show_metadata`](#typescript_rpc-resource-rpc_action-show_metadata){: #typescript_rpc-resource-rpc_action-show_metadata } | `nil \| boolean \| list(atom)` |  | Which metadata fields to expose (nil=all, false/[]=none, list=specific fields) |
| [`metadata_field_names`](#typescript_rpc-resource-rpc_action-metadata_field_names){: #typescript_rpc-resource-rpc_action-metadata_field_names } | `list({atom, atom})` | `[]` | Map metadata field names to valid TypeScript identifiers |
### Introspection
Target: `AshTypescript.Rpc.RpcAction`
### typescript_rpc.resource.typed_query
```elixir
typed_query name, action
```
### Arguments
| Name | Type | Default | Docs |
|------|------|---------|------|
| [`name`](#typescript_rpc-resource-typed_query-name){: #typescript_rpc-resource-typed_query-name } | `atom` |  | The name of the RPC-action |
| [`action`](#typescript_rpc-resource-typed_query-action){: #typescript_rpc-resource-typed_query-action } | `atom` |  | The read action on the resource to query |
### Options
| Name | Type | Default | Docs |
|------|------|---------|------|
| [`ts_result_type_name`](#typescript_rpc-resource-typed_query-ts_result_type_name){: #typescript_rpc-resource-typed_query-ts_result_type_name } | `String.t` |  | The name of the TypeScript type for the query result |
| [`ts_fields_const_name`](#typescript_rpc-resource-typed_query-ts_fields_const_name){: #typescript_rpc-resource-typed_query-ts_fields_const_name } | `String.t` |  | The name of the constant for the fields, that can be reused by the client to re-run the query |
| [`fields`](#typescript_rpc-resource-typed_query-fields){: #typescript_rpc-resource-typed_query-fields } | `list(any)` |  | The fields to query |
### Introspection
Target: `AshTypescript.Rpc.TypedQuery`
### Introspection
Target: `AshTypescript.Rpc.Resource`
<style type="text/css">.spark-required::after { content: "*"; color: red !important; }</style>