precious/profile

Types

pub type EnforcementError {
  CategoryError(category: derived.Category, index: Int)
  BidirectionalRule
  Empty
  NotIdempotent
}

Constructors

  • CategoryError(category: derived.Category, index: Int)
  • BidirectionalRule
  • Empty
  • NotIdempotent
pub type Profile {
  Profile(
    name: String,
    allowed: List(derived.Category),
    width_map: fn(String) -> String,
    additional_mapping: fn(String) -> String,
    case_map: fn(String) -> String,
    normalization: fn(String) -> String,
    directionality: fn(iv.Array(Int)) -> Bool,
    idempotence_check: fn(String, Profile) -> Result(
      #(String, iv.Array(Int)),
      EnforcementError,
    ),
  )
}

Constructors

  • Profile(
      name: String,
      allowed: List(derived.Category),
      width_map: fn(String) -> String,
      additional_mapping: fn(String) -> String,
      case_map: fn(String) -> String,
      normalization: fn(String) -> String,
      directionality: fn(iv.Array(Int)) -> Bool,
      idempotence_check: fn(String, Profile) -> Result(
        #(String, iv.Array(Int)),
        EnforcementError,
      ),
    )

Values

pub fn bidi_rule_if_contains_rtl(
  codepoints: iv.Array(Int),
) -> Bool
pub fn enforce(
  on str: String,
  using profile: Profile,
) -> Result(String, EnforcementError)
pub fn enforce_class(
  on codepoints: iv.Array(Int),
  allowing categories: List(derived.Category),
) -> Result(Nil, EnforcementError)
pub const freeform_class_allowed: List(derived.Category)
pub const identifer_class_allowed: List(derived.Category)
pub fn nickname() -> Profile
pub fn opaque_string() -> Profile
pub fn username_case_mapped() -> Profile
pub fn username_case_preserved() -> Profile
Search Document