mirror of
https://github.com/dillonkearns/elm-pages-v3-beta.git
synced 2024-11-27 01:12:50 +03:00
Make Script type opaque.
This commit is contained in:
parent
c9e1eecc3c
commit
689c9cb7eb
16
src/Pages/Internal/Script.elm
Normal file
16
src/Pages/Internal/Script.elm
Normal file
@ -0,0 +1,16 @@
|
||||
module Pages.Internal.Script exposing (Script(..))
|
||||
|
||||
import Cli.Program as Program
|
||||
import DataSource exposing (DataSource)
|
||||
import Html exposing (Html)
|
||||
|
||||
|
||||
{-| -}
|
||||
type Script
|
||||
= Script
|
||||
((Maybe { indent : Int, newLines : Bool }
|
||||
-> Html Never
|
||||
-> String
|
||||
)
|
||||
-> Program.Config (DataSource ())
|
||||
)
|
@ -1,5 +1,5 @@
|
||||
module Pages.Script exposing
|
||||
( Script(..)
|
||||
( Script
|
||||
, withCliOptions, withoutCliOptions
|
||||
, writeFile
|
||||
, log
|
||||
@ -28,20 +28,14 @@ import Cli.Program as Program
|
||||
import DataSource exposing (DataSource)
|
||||
import DataSource.Http
|
||||
import DataSource.Internal.Request
|
||||
import Html exposing (Html)
|
||||
import Json.Decode as Decode
|
||||
import Json.Encode as Encode
|
||||
import Pages.Internal.Script
|
||||
|
||||
|
||||
{-| -}
|
||||
type Script
|
||||
= Script
|
||||
((Maybe { indent : Int, newLines : Bool }
|
||||
-> Html Never
|
||||
-> String
|
||||
)
|
||||
-> Program.Config (DataSource ())
|
||||
)
|
||||
type alias Script =
|
||||
Pages.Internal.Script.Script
|
||||
|
||||
|
||||
{-| -}
|
||||
@ -78,7 +72,7 @@ log message =
|
||||
{-| -}
|
||||
withoutCliOptions : DataSource () -> Script
|
||||
withoutCliOptions execute =
|
||||
Script
|
||||
Pages.Internal.Script.Script
|
||||
(\_ ->
|
||||
Program.config
|
||||
|> Program.add
|
||||
@ -93,7 +87,7 @@ withoutCliOptions execute =
|
||||
{-| -}
|
||||
withCliOptions : Program.Config cliOptions -> (cliOptions -> DataSource ()) -> Script
|
||||
withCliOptions config execute =
|
||||
Script
|
||||
Pages.Internal.Script.Script
|
||||
(\_ ->
|
||||
config
|
||||
|> Program.mapConfig execute
|
||||
|
Loading…
Reference in New Issue
Block a user