wa_diff (assert v2.0.0)
Summary
Types
A struct (map/record) carries either a {Key, ValueSide} pair for keys present on both sides, or a whole-item block() for keys present on one side.
Types
-type break() :: binary().
-type container_type() :: tuple | list.
-type contents() :: #{contents := [content()]}.
-type context() :: #{records => #{{atom(), pos_integer()} => [atom()]}}.
-type delimiter() :: binary().
-type diff() :: {eq, supported_input()} | {diff, side(), side()}.
-type doc() :: erlfmt_algebra:doc().
-type error_description() :: #{pos_integer() => unicode:chardata(), general => unicode:chardata(), reason => unicode:chardata()}.
-type meta() :: [{diff, boolean()}].
-type script() :: diffy:diffs().
-type side() :: contents() | {literal, literal()} | {container_type(), meta(), [side()]} | block() | {struct_type(), meta(), [struct_arg()]} | struct_item() | {eq, supported_input()}.
A struct (map/record) carries either a {Key, ValueSide} pair for keys present on both sides, or a whole-item block() for keys present on one side.
-type struct_arg() :: {supported_input(), side()} | block().
-type struct_type() :: map | {record, atom()}.
Functions
-spec compute(supported_input(), supported_input()) -> diff().
-spec compute(supported_input(), supported_input(), atom()) -> diff().
-spec error_info(module(), dynamic(), dynamic()) -> [{error_info, error_info()}].
-spec format_error(term(), erlang:stacktrace()) -> error_description().
-spec green() -> binary().
-spec red() -> binary().
-spec reset() -> binary().
-spec to_algebra(side(), wrapper_fun()) -> doc().
-spec yellow() -> binary().