-module(rally@types).
-compile([no_auto_import, nowarn_unused_vars, nowarn_unused_function, nowarn_nomatch, inline]).
-define(FILEPATH, "src/rally/types.gleam").
-export_type([param_type/0, url_segment/0, scanned_route/0, scan_config/0, variant_field/0, variant_info/0, client_context_contract/0, auth_config/0, page_contract/0]).
-if(?OTP_RELEASE >= 27).
-define(MODULEDOC(Str), -moduledoc(Str)).
-define(DOC(Str), -doc(Str)).
-else.
-define(MODULEDOC(Str), -compile([])).
-define(DOC(Str), -compile([])).
-endif.
?MODULEDOC(
" Central type vocabulary for the codegen pipeline.\n"
"\n"
" These types flow between the scanner, parser, and generators.\n"
" The scanner produces ScannedRoutes. The parser produces PageContracts.\n"
" The generators consume both to emit server handlers, client packages,\n"
" and everything in between. ScanConfig carries the per-namespace\n"
" configuration that drives the whole pipeline.\n"
).
-type param_type() :: int_param | string_param.
-type url_segment() :: {static_segment, binary()} |
{dynamic_segment, binary(), param_type()}.
-type scanned_route() :: {scanned_route,
list(url_segment()),
binary(),
list({binary(), param_type()}),
binary(),
gleam@option:option(binary())}.
-type scan_config() :: {scan_config,
binary(),
binary(),
binary(),
binary(),
binary(),
binary(),
binary(),
binary(),
binary(),
binary(),
binary(),
binary(),
binary(),
binary(),
binary(),
gleam@dict:dict(binary(), tom:toml()),
binary()}.
-type variant_field() :: {variant_field,
binary(),
libero@field_type:field_type()}.
-type variant_info() :: {variant_info, binary(), list(variant_field())}.
-type client_context_contract() :: {client_context_contract,
list(variant_info()),
list(variant_info()),
boolean(),
boolean()}.
-type auth_config() :: {auth_config, binary()}.
-type page_contract() :: {page_contract,
list(variant_info()),
list(variant_info()),
boolean(),
boolean(),
boolean(),
boolean(),
boolean(),
list(binary()),
binary(),
binary(),
binary(),
binary(),
boolean(),
boolean(),
boolean()}.