Wayfinder.Typescript.BuildActions (Wayfinder Ex v0.1.2)
View SourceGenerates a Typescript code for a controller / action Each action can have one or more routes, and each route can have one or more HTTP methods. When user define this kind of routes
get "/users", UserController, :my_action
post "/users", UserController, :my_action
It should generate only one myAction.url specification with all the methods that this action can handle according to the router.
Summary
Types
@type opts() :: %{ route: Wayfinder.Processor.Route.t(), safe_name: String.t(), path: String.t(), main_method: String.t(), methods: [String.t()], doc_block: String.t(), all_arguments: [Wayfinder.Processor.Route.param_spec()], url_arguments: Wayfinder.Typescript.BuildParams.argument(), method_arguments: Wayfinder.Typescript.BuildParams.method_argments() }
Functions
@spec call(Wayfinder.Processor.controller()) :: String.t()
@spec main_method(Wayfinder.Processor.Route.t()) :: String.t()