FieldMapper

io.github.scalats.core.FieldMapper
See theFieldMapper companion object

Functional type to customize the field naming and access.

import scala.collection.immutable.Set
import io.github.scalats.ast.TypeRef
import io.github.scalats.core.{
 Settings, Field, FieldMapper
}

class CustomFieldMapper extends FieldMapper {
 def apply(
   settings: Settings,
   ownerType: String,
   propertyName: String,
   propertyType: TypeRef) =
   Field("_" + propertyName, Set.empty)
}

Attributes

Companion:
object
Graph
Supertypes
class Object
trait Matchable
class Any
Known subtypes
object Identity.type
object SnakeCase.type

Members list

Concise view

Value members

Abstract methods

def apply(settings: Settings, ownerType: String, propertyName: String, propertyType: TypeRef): Field

Returns the TypeScript field/signature for the given field name (e.g. fooBar -> foo_bar if snake case is used).

Returns the TypeScript field/signature for the given field name (e.g. fooBar -> foo_bar if snake case is used).

Attributes

ownerType

the name of Scala class/interface for which the property is defined

propertyName

the property name

propertyType

the type transpiled for the specified property

Concrete methods

override def toString: String

Returns a string representation of the object.

Returns a string representation of the object.

The default representation is platform dependent.

Attributes

Returns:

a string representation of the object.

Definition Classes
Function4 -> Any

Inherited methods

def curried: T1 => T2 => T3 => T4 => R

Attributes

Inherited from:
Function4
def tupled: ((T1, T2, T3, T4)) => R

Attributes

Inherited from:
Function4