AshTypescript.Rpc.Codegen.FunctionGenerators.JsdocGenerator
(ash_typescript v0.17.3)
Copy Markdown
View Source
Generates JSDoc comments for RPC functions.
Provides IDE discoverability by adding documentation with metadata tags that describe the action type, resource, internal action name, and namespace.
Summary
Functions
Generates a JSDoc comment for an RPC function.
Generates a JSDoc comment for a typed query.
Generates a JSDoc comment for a validation function.
Functions
Generates a JSDoc comment for an RPC function.
Parameters
resource- The Ash resource moduleaction- The Ash action structrpc_action- The RPC action configurationopts- Options including::namespace- The resolved namespace for this action (optional)
Returns
A string containing the JSDoc comment block.
Example Output
Default (relative paths):
/**
* List all users
*
* @ashActionType :read
* @ashResource MyApp.User
* @ashAction :list
* @ashActionDef lib/my_app/resources/user.ex
* @rpcActionDef lib/my_app/domain.ex
* @namespace users
* @see createUser
* @deprecated Use listUsersV2 instead
*/With :source_path_prefix set to "backend" (for monorepos):
/**
* List all users
*
* @ashActionType :read
* @ashResource MyApp.User
* @ashAction :list
* @ashActionDef backend/lib/my_app/resources/user.ex
* @rpcActionDef backend/lib/my_app/domain.ex
* @namespace users
* @see createUser
* @deprecated Use listUsersV2 instead
*/
Generates a JSDoc comment for a typed query.
Parameters
typed_query- The typed query configurationresource- The Ash resource module
Returns
A string containing the JSDoc comment block.
Generates a JSDoc comment for a validation function.
Parameters
resource- The Ash resource moduleaction- The Ash action structrpc_action- The RPC action configurationopts- Options including::namespace- The resolved namespace for this action (optional)
Returns
A string containing the JSDoc comment block.