AshTypescript.Rpc.Codegen.TypeGenerators.ResultTypes (ash_typescript v0.17.2)

Copy Markdown View Source

Generates TypeScript result types for RPC actions.

Result types define the shape of data returned from RPC actions, including:

  • Field selection types (which fields can be selected)
  • Inferred result types (what the result looks like given a field selection)
  • Pagination wrapper types (for paginated results)
  • Metadata integration (for actions that return metadata)

Summary

Functions

Generates the TypeScript result type for an RPC action.

Functions

generate_result_type(resource, action, rpc_action, rpc_action_name)

Generates the TypeScript result type for an RPC action.

The generated type includes:

  • A Fields type (what fields can be selected)
  • An InferResult type (what the result will be given a field selection)
  • Optional metadata types (if metadata is enabled)
  • Optional pagination types (if the action supports pagination)

Parameters

  • resource - The Ash resource
  • action - The Ash action
  • rpc_action - The RPC action configuration
  • rpc_action_name - The snake_case name of the RPC action

Returns

A string containing the TypeScript type definitions for this action's result.