NativeElixirPdfUtilities.Validators.CssCalculationValidator (native_elixir_pdf_utilities v1.1.0)

View Source

MathML compatibility interface to the shared CSS calculation validator.

Summary

Types

A shared validated length-percentage calculation.

Functions

Prepares length-percentage arithmetic through the shared CSS grammar.

Returns measured unit dependencies after the shared grammar validates their type.

Resolves the shared calculation against its actual percentage basis in points.

Types

calculation()

A shared validated length-percentage calculation.

Functions

prepare(value, scales)

@spec prepare(term(), term()) ::
  {:ok, calculation()}
  | :error
  | {:error, NativeElixirPdfUtilities.Diagnostics.detailed_error()}

Prepares length-percentage arithmetic through the shared CSS grammar.

referenced_units(value)

@spec referenced_units(term()) ::
  {:ok, [String.t()]}
  | {:error, NativeElixirPdfUtilities.Diagnostics.detailed_error()}

Returns measured unit dependencies after the shared grammar validates their type.

resolve(calculation, basis)

@spec resolve(term(), term()) ::
  {:ok, number()}
  | {:error, NativeElixirPdfUtilities.Diagnostics.detailed_error()}

Resolves the shared calculation against its actual percentage basis in points.