AshTypescript.TypedController.Codegen.TypescriptStatic (ash_typescript v0.17.3)

Copy Markdown View Source

Generates static TypeScript code for typed controller routes.

This includes:

  • Import statements (Zod, custom imports)
  • Hook context type definitions
  • TypedControllerConfig interface
  • executeTypedControllerRequest helper function

Summary

Functions

Generates a _basePath constant when a base path is configured.

Generates all static TypeScript code for typed controller routes.

Functions

generate_base_path_variable(base_path)

Generates a _basePath constant when a base path is configured.

Returns an empty string when the base path is "" (default).

generate_static_code(opts \\ [])

Generates all static TypeScript code for typed controller routes.

Returns a string containing imports, config interface, and helper function. Only generates content when typed_controller_mode() == :full.

Options

  • :skip_zod - When true, omits the Zod import (for split-file mode)