AshTypescript.Rpc.Codegen.TypeGenerators.PaginationTypes
(ash_typescript v0.17.2)
Copy Markdown
View Source
Generates TypeScript pagination result types for RPC actions.
Supports:
- Offset pagination (limit/offset)
- Keyset pagination (limit/after/before)
- Mixed pagination (both offset and keyset)
- Conditional pagination (optional pagination)
Summary
Functions
Generates a conditional pagination result type (pagination is optional).
Generates the pagination result type based on the action's pagination support.
Functions
Generates a conditional pagination result type (pagination is optional).
Uses TypeScript conditional types to return either a plain array (no pagination)
or a paginated result based on the presence of the page config parameter.
Parameters
_resource- The Ash resource (unused but kept for consistency)action- The Ash actionrpc_action_name_pascal- The PascalCase name of the RPC actionschema_ref- The TypeScript resource type namehas_metadata- Boolean indicating if metadata is enabled
Returns
A string containing the TypeScript conditional result type definition.
Generates the pagination result type based on the action's pagination support.
This function is used when pagination is required (not optional).
Parameters
_resource- The Ash resource (unused but kept for consistency)action- The Ash actionrpc_action_name_pascal- The PascalCase name of the RPC actionschema_ref- The TypeScript resource type namehas_metadata- Boolean indicating if metadata is enabled
Returns
A string containing the TypeScript result type definition for the appropriate pagination type.