|
377 | 377 |
|
378 | 378 | ### Types |
379 | 379 |
|
380 | | - type Config a b c d = { responseType :: ResponseType, withCredentials :: Boolean, timeout :: Either Number (Promise c d), cache :: Either Boolean Cache, xsrfCookieName :: String, xsrfHeaderName :: String, headers :: Headers, "data" :: RequestData b, params :: { | a }, url :: Url, method :: Method } |
| 380 | + type Config a b c d = { responseType :: D.ResponseType, withCredentials :: Boolean, timeout :: Either Number (Promise c d), cache :: Either Boolean Cache, xsrfCookieName :: String, xsrfHeaderName :: String, headers :: Headers, "data" :: RequestData b, params :: { | a }, url :: D.Url, method :: D.HttpMethod } |
381 | 381 |
|
382 | 382 | data Http :: * |
383 | 383 |
|
384 | 384 | type HttpResponse e r a b c d = HttpEff e (Promise (Response r a b c d) (Response r a b c d)) |
385 | 385 |
|
386 | | - type Response r a b c d = { statusText :: String, config :: Config a b c d, headers :: [String] -> String, status :: Status, "data" :: ResponseData r } |
| 386 | + type Response r a b c d = { statusText :: String, config :: Config a b c d, headers :: [String] -> String, status :: Status, "data" :: D.HttpData r } |
387 | 387 |
|
388 | 388 |
|
389 | 389 | ### Values |
390 | 390 |
|
391 | 391 | config :: forall a b c d. Config a b c d |
392 | 392 |
|
393 | | - del :: forall e r a b c d. Url -> Http -> HttpResponse e r a b c d |
| 393 | + del :: forall e r a b c d. D.Url -> Http -> HttpResponse e r a b c d |
394 | 394 |
|
395 | | - del' :: forall e r a b c d. Url -> Config a b c d -> Http -> HttpResponse e r a b c d |
| 395 | + del' :: forall e r a b c d. D.Url -> Config a b c d -> Http -> HttpResponse e r a b c d |
396 | 396 |
|
397 | | - get :: forall e r a b c d. Url -> Http -> HttpResponse e r a b c d |
| 397 | + get :: forall e r a b c d. D.Url -> Http -> HttpResponse e r a b c d |
398 | 398 |
|
399 | | - get' :: forall e r a b c d. Url -> Config a b c d -> Http -> HttpResponse e r a b c d |
| 399 | + get' :: forall e r a b c d. D.Url -> Config a b c d -> Http -> HttpResponse e r a b c d |
400 | 400 |
|
401 | | - head :: forall e r a b c d. Url -> Http -> HttpResponse e r a b c d |
| 401 | + head :: forall e r a b c d. D.Url -> Http -> HttpResponse e r a b c d |
402 | 402 |
|
403 | | - head' :: forall e r a b c d. Url -> Config a b c d -> Http -> HttpResponse e r a b c d |
| 403 | + head' :: forall e r a b c d. D.Url -> Config a b c d -> Http -> HttpResponse e r a b c d |
404 | 404 |
|
405 | 405 | http :: forall e r a b c d. Config a b c d -> Http -> HttpResponse e r a b c d |
406 | 406 |
|
407 | | - jsonp :: forall e r a b c d. Url -> Http -> HttpResponse e r a b c d |
| 407 | + jsonp :: forall e r a b c d. D.Url -> Http -> HttpResponse e r a b c d |
408 | 408 |
|
409 | | - jsonp' :: forall e r a b c d. Url -> Config a b c d -> Http -> HttpResponse e r a b c d |
| 409 | + jsonp' :: forall e r a b c d. D.Url -> Config a b c d -> Http -> HttpResponse e r a b c d |
410 | 410 |
|
411 | | - post :: forall e r a b c d. Url -> RequestData b -> Http -> HttpResponse e r a b c d |
| 411 | + post :: forall e r a b c d. D.Url -> RequestData b -> Http -> HttpResponse e r a b c d |
412 | 412 |
|
413 | | - post' :: forall e r a b c d. Url -> RequestData b -> Config a b c d -> Http -> HttpResponse e r a b c d |
| 413 | + post' :: forall e r a b c d. D.Url -> RequestData b -> Config a b c d -> Http -> HttpResponse e r a b c d |
414 | 414 |
|
415 | | - put :: forall e r a b c d. Url -> RequestData b -> Http -> HttpResponse e r a b c d |
| 415 | + put :: forall e r a b c d. D.Url -> RequestData b -> Http -> HttpResponse e r a b c d |
416 | 416 |
|
417 | | - put' :: forall e r a b c d. Url -> RequestData b -> Config a b c d -> Http -> HttpResponse e r a b c d |
| 417 | + put' :: forall e r a b c d. D.Url -> RequestData b -> Config a b c d -> Http -> HttpResponse e r a b c d |
418 | 418 |
|
419 | 419 |
|
420 | 420 | ## Module Angular.Injector |
|
888 | 888 | timeoutk :: forall e f r. Number -> Boolean -> Timeout -> Eff f r -> TimeoutEff e (TimeoutPromise r) |
889 | 889 |
|
890 | 890 |
|
891 | | -## Module DOM.Types |
892 | | - |
893 | | -### Types |
894 | | - |
895 | | - data ArrayBuffer :: * |
896 | | - |
897 | | - data Blob :: * |
898 | | - |
899 | | - data Document :: * |
900 | | - |
901 | | - data MozBlob :: * |
902 | | - |
903 | | - data MozChunkedArrayBuffer :: * |
904 | | - |
905 | | - data MozChunkedText :: * |
906 | | - |
907 | | - |
908 | 891 | ## Module Angular.Http.Internal |
909 | 892 |
|
910 | 893 | ### Types |
|
922 | 905 |
|
923 | 906 | getConfigHeaders :: ForeignConfig -> Headers |
924 | 907 |
|
925 | | - getConfigMethod :: ForeignConfig -> Method |
| 908 | + getConfigMethod :: ForeignConfig -> D.HttpMethod |
926 | 909 |
|
927 | 910 | getConfigParams :: forall a. ForeignConfig -> { | a } |
928 | 911 |
|
929 | 912 | getConfigRequestData :: forall e a. ForeignConfig -> RequestData a |
930 | 913 |
|
931 | | - getConfigResponseType :: ForeignConfig -> ResponseType |
| 914 | + getConfigResponseType :: ForeignConfig -> D.ResponseType |
932 | 915 |
|
933 | 916 | getConfigTimeout :: forall a b. ForeignConfig -> Either Number (Promise a b) |
934 | 917 |
|
935 | | - getConfigUrl :: ForeignConfig -> Url |
| 918 | + getConfigUrl :: ForeignConfig -> D.Url |
936 | 919 |
|
937 | 920 | getConfigWithCredentials :: ForeignConfig -> Boolean |
938 | 921 |
|
|
942 | 925 |
|
943 | 926 | getResponseConfig :: ForeignResponse -> ForeignConfig |
944 | 927 |
|
945 | | - getResponseData :: forall a. ResponseType -> ForeignResponse -> ResponseData a |
| 928 | + getResponseData :: forall a. D.ResponseType -> ForeignResponse -> D.HttpData a |
946 | 929 |
|
947 | 930 | getResponseHeaders :: ForeignResponse -> [String] -> String |
948 | 931 |
|
|
954 | 937 |
|
955 | 938 | setConfigHeaders :: forall e. Headers -> ForeignConfig -> HttpEff e Unit |
956 | 939 |
|
957 | | - setConfigMethod :: forall e. Method -> ForeignConfig -> HttpEff e Unit |
| 940 | + setConfigMethod :: forall e. D.HttpMethod -> ForeignConfig -> HttpEff e Unit |
958 | 941 |
|
959 | 942 | setConfigParams :: forall e a. { | a } -> ForeignConfig -> HttpEff e Unit |
960 | 943 |
|
961 | 944 | setConfigRequestData :: forall e a. RequestData a -> ForeignConfig -> HttpEff e Unit |
962 | 945 |
|
963 | | - setConfigResponseType :: forall e. ResponseType -> ForeignConfig -> HttpEff e Unit |
| 946 | + setConfigResponseType :: forall e. D.ResponseType -> ForeignConfig -> HttpEff e Unit |
964 | 947 |
|
965 | 948 | setConfigTimeout :: forall e a b. Either Number (Promise a b) -> ForeignConfig -> HttpEff e Unit |
966 | 949 |
|
967 | | - setConfigUrl :: forall e. Url -> ForeignConfig -> HttpEff e Unit |
| 950 | + setConfigUrl :: forall e. D.Url -> ForeignConfig -> HttpEff e Unit |
968 | 951 |
|
969 | 952 | setConfigWithCredentials :: forall e. Boolean -> ForeignConfig -> HttpEff e Unit |
970 | 953 |
|
|
994 | 977 |
|
995 | 978 | type HttpEff e r = Eff (nghttp :: NgHttp | e) r |
996 | 979 |
|
997 | | - data Method where |
998 | | - GET :: Method |
999 | | - POST :: Method |
1000 | | - PUT :: Method |
1001 | | - DELETE :: Method |
1002 | | - PATCH :: Method |
1003 | | - HEAD :: Method |
1004 | | - OPTIONS :: Method |
1005 | | - JSONP :: Method |
1006 | | - |
1007 | 980 | data NgHttp :: ! |
1008 | 981 |
|
1009 | 982 | data RequestData a where |
|
1013 | 986 |
|
1014 | 987 | type RequestDataFn a = { objectRequestData :: a -> RequestData a, stringRequestData :: String -> RequestData a, noRequestData :: RequestData a } |
1015 | 988 |
|
1016 | | - data ResponseData a where |
1017 | | - NoResponseData :: ResponseData a |
1018 | | - DefaultResponseData :: String -> ResponseData a |
1019 | | - ArrayBufferResponseData :: D.ArrayBuffer -> ResponseData a |
1020 | | - BlobResponseData :: D.Blob -> ResponseData a |
1021 | | - DocumentResponseData :: D.Document -> ResponseData a |
1022 | | - JsonResponseData :: a -> ResponseData a |
1023 | | - TextResponseData :: String -> ResponseData a |
1024 | | - MozBlobResponseData :: D.MozBlob -> ResponseData a |
1025 | | - MozChunkedTextResponseData :: D.MozChunkedText -> ResponseData a |
1026 | | - MozChunkedArrayBufferResponseData :: D.MozChunkedArrayBuffer -> ResponseData a |
1027 | | - |
1028 | | - type ResponseDataFn a = { mozChunkedArrayBufferResponseData :: D.MozChunkedArrayBuffer -> ResponseData a, mozChunkedTextResponseData :: D.MozChunkedText -> ResponseData a, mozBlobResponseData :: D.MozBlob -> ResponseData a, textResponseData :: String -> ResponseData a, jsonResponseData :: a -> ResponseData a, documentResponseData :: D.Document -> ResponseData a, blobResponseData :: D.Blob -> ResponseData a, arrayBufferResponseData :: D.ArrayBuffer -> ResponseData a, defaultResponseData :: String -> ResponseData a, noResponseData :: ResponseData a } |
1029 | | - |
1030 | | - data ResponseType where |
1031 | | - Default :: ResponseType |
1032 | | - ArrayBuffer :: ResponseType |
1033 | | - Blob :: ResponseType |
1034 | | - Document :: ResponseType |
1035 | | - Json :: ResponseType |
1036 | | - Text :: ResponseType |
1037 | | - MozBlob :: ResponseType |
1038 | | - MozChunkedText :: ResponseType |
1039 | | - MozChunkedArrayBuffer :: ResponseType |
1040 | | - |
1041 | 989 | data Status where |
1042 | 990 | OK :: Status |
1043 | 991 | Created :: Status |
|
1049 | 997 | InternalServerError :: Status |
1050 | 998 | OtherStatus :: Number -> Status |
1051 | 999 |
|
1052 | | - type Url = String |
1053 | | - |
1054 | | - |
1055 | | -### Type Class Instances |
1056 | | - |
1057 | | - instance showMethod :: Show Method |
1058 | | - |
1059 | | - instance showResponseType :: Show ResponseType |
1060 | | - |
1061 | 1000 |
|
1062 | 1001 | ### Values |
1063 | 1002 |
|
|
1069 | 1008 |
|
1070 | 1009 | readHeadersFn :: forall a b. Fn4 (String -> Either String (Unit -> String)) ((Unit -> String) -> Either String (Unit -> String)) (String -> Either String (Unit -> String) -> Header) ForeignHeaders Headers |
1071 | 1010 |
|
1072 | | - readMethod :: String -> Method |
| 1011 | + readMethod :: String -> D.HttpMethod |
1073 | 1012 |
|
1074 | 1013 | readRequestDataFn :: forall a. Fn2 (RequestDataFn a) ForeignRequestData (RequestData a) |
1075 | 1014 |
|
1076 | | - readResponseDataFn :: forall a. Fn3 (ResponseDataFn a) String ForeignResponseData (ResponseData a) |
| 1015 | + readResponseData :: forall a d. (d -> D.HttpData a) -> ForeignResponseData -> D.HttpData a |
1077 | 1016 |
|
1078 | | - readResponseType :: String -> ResponseType |
| 1017 | + readResponseType :: String -> D.ResponseType |
1079 | 1018 |
|
1080 | 1019 | readStatus :: Number -> Status |
1081 | 1020 |
|
|
0 commit comments