gleamgen/types/custom

Types

pub type CustomType(repr, generics) {
  CustomType(module: option.Option(String), name: String)
}

Constructors

pub type CustomTypeBuilder(repr, variants, generics) {
  CustomTypeBuilder(
    variants: List(variant.Variant(types.Dynamic)),
    generics_list: List(String),
    generics: generics,
  )
}

Constructors

pub type Generics1(a) =
  #(#(), a)
pub type Generics2(a, b) =
  #(#(#(), a), b)
pub type Generics3(a, b, c) =
  #(#(#(#(), a), b), c)
pub type Generics4(a, b, c, d) =
  #(#(#(#(#(), a), b), c), d)
pub type Generics5(a, b, c, d, e) =
  #(#(#(#(#(#(), a), b), c), d), e)
pub type Generics6(a, b, c, d, e, f) =
  #(#(#(#(#(#(#(), a), b), c), d), e), f)
pub type Generics7(a, b, c, d, e, f, g) =
  #(#(#(#(#(#(#(#(), a), b), c), d), e), f), g)
pub type Generics8(a, b, c, d, e, f, g, h) =
  #(#(#(#(#(#(#(#(#(), a), b), c), d), e), f), g), h)
pub type Generics9(a, b, c, d, e, f, g, h, i) =
  #(#(#(#(#(#(#(#(#(#(), a), b), c), d), e), f), g), h), i)

Values

pub fn new(
  typed_representation: a,
) -> CustomTypeBuilder(a, #(), #())
pub fn new_dynamic(
  typed_representation: repr,
  variants: List(variant.Variant(types.Dynamic)),
  generics_list: List(String),
) -> CustomTypeBuilder(
  repr,
  a,
  List(types.GeneratedType(types.Dynamic)),
)
pub fn render(
  type_: CustomTypeBuilder(repr, variants, generics),
) -> @internal Rendered
pub fn to_dynamic(
  old: CustomTypeBuilder(a, b, c),
) -> CustomTypeBuilder(types.Dynamic, Nil, Nil)
pub fn to_type(
  input: CustomType(repr, #()),
) -> types.GeneratedType(CustomType(repr, #()))
pub fn to_type1(
  input: CustomType(repr, #(#(), types.GeneratedType(a))),
  type1: types.GeneratedType(type_a),
) -> types.GeneratedType(
  CustomType(repr, #(#(), types.GeneratedType(type_a))),
)
pub fn to_type2(
  input: CustomType(
    repr,
    #(#(#(), types.GeneratedType(a)), types.GeneratedType(b)),
  ),
  type1: types.GeneratedType(type_a),
  type2: types.GeneratedType(type_b),
) -> types.GeneratedType(
  CustomType(
    repr,
    #(
      #(#(), types.GeneratedType(type_a)),
      types.GeneratedType(type_b),
    ),
  ),
)
pub fn to_type3(
  input: CustomType(
    repr,
    #(
      #(#(#(), types.GeneratedType(a)), types.GeneratedType(b)),
      types.GeneratedType(c),
    ),
  ),
  type1: types.GeneratedType(type_a),
  type2: types.GeneratedType(type_b),
  type3: types.GeneratedType(type_c),
) -> types.GeneratedType(
  CustomType(
    repr,
    #(
      #(
        #(#(), types.GeneratedType(type_a)),
        types.GeneratedType(type_b),
      ),
      types.GeneratedType(type_c),
    ),
  ),
)
pub fn to_type4(
  input: CustomType(
    repr,
    #(
      #(
        #(#(#(), types.GeneratedType(a)), types.GeneratedType(b)),
        types.GeneratedType(c),
      ),
      types.GeneratedType(d),
    ),
  ),
  type1: types.GeneratedType(type_a),
  type2: types.GeneratedType(type_b),
  type3: types.GeneratedType(type_c),
  type4: types.GeneratedType(type_d),
) -> types.GeneratedType(
  CustomType(
    repr,
    #(
      #(
        #(
          #(#(), types.GeneratedType(type_a)),
          types.GeneratedType(type_b),
        ),
        types.GeneratedType(type_c),
      ),
      types.GeneratedType(type_d),
    ),
  ),
)
pub fn to_type5(
  input: CustomType(
    repr,
    #(
      #(
        #(
          #(
            #(#(), types.GeneratedType(a)),
            types.GeneratedType(b),
          ),
          types.GeneratedType(c),
        ),
        types.GeneratedType(d),
      ),
      types.GeneratedType(e),
    ),
  ),
  type1: types.GeneratedType(type_a),
  type2: types.GeneratedType(type_b),
  type3: types.GeneratedType(type_c),
  type4: types.GeneratedType(type_d),
  type5: types.GeneratedType(type_e),
) -> types.GeneratedType(
  CustomType(
    repr,
    #(
      #(
        #(
          #(
            #(#(), types.GeneratedType(type_a)),
            types.GeneratedType(type_b),
          ),
          types.GeneratedType(type_c),
        ),
        types.GeneratedType(type_d),
      ),
      types.GeneratedType(type_e),
    ),
  ),
)
pub fn with_dynamic_variants(
  old: CustomTypeBuilder(repr, old, generics),
  variants: fn(generics) -> List(variant.Variant(types.Dynamic)),
) -> CustomTypeBuilder(repr, types.Dynamic, generics)
pub fn with_generic(
  old: CustomTypeBuilder(repr, variants, old_generics),
  generic: String,
) -> CustomTypeBuilder(
  repr,
  variants,
  #(old_generics, types.GeneratedType(a)),
)
pub fn with_variant(
  old: CustomTypeBuilder(repr, old, generics),
  variant: fn(generics) -> variant.Variant(new),
) -> CustomTypeBuilder(repr, #(old, new), generics)
Search Document