A type that represents the interface for an Elm module.
You can see this as a trimmed down version of a file that only contains the header (module X exposing (..)
) and some small set of additional data.
List Exposed
An interface is just a list of 'things' that are exposed by a module.
[ Type "Color" [ "Red", "Blue" ], Function "asRgb" ]
Union type for the things that a module can expose. These are Function
s, CustomType
s, and Alias
es.
Elm core packages can also define Operator
s, and thus we take that into account as well.
The Infix
type alias will contain all the information regarding the operator
build : Elm.RawFile.RawFile -> Interface
Build an interface from a file
exposesAlias : String -> Interface -> Basics.Bool
A function to check whether an Interface
exposes an certain type alias.
exposesFunction : String -> Interface -> Basics.Bool
Check whether an Interface
exposes an function.
exposesFunction "A" [ Function "A", CustomType "B", [ "C" ] ] == True
exposesFunction "B" [ Function "A", CustomType "B", [ "C" ] ] == False
exposesFunction "<" [ Infix { operator = "<" , ... } ] == True
exposesFunction "A" [ Alias "A" ] == False
operators : Interface -> List Elm.Syntax.Infix.Infix
Retrieve all operators exposed by the Interface