{-# LANGUAGE PartialTypeSignatures #-}

{-# OPTIONS_GHC -Wno-partial-type-signatures #-}

module Codec.GlTF.Prelude
  ( Size

  , FromJSON(..)
  , ToJSON(..)
  , Generic
  , gParseJSON
  , gToJSON

  , HashMap
  , Object
  , Scientific
  , Text
  , Value
  , Vector

  , withText
  , withObject
  , (.:)
  , (.:?)
  , (.!=)
  ) where

import Data.Aeson (FromJSON(..), ToJSON(..), Value, Object, withText, withObject, (.:), (.:?), (.!=))
import Data.Aeson.Types (Parser, Options(..), defaultOptions, genericParseJSON, genericToJSON)
import Data.List (dropWhileEnd)
import Data.Scientific (Scientific)
import Data.Text (Text)
import Data.Vector (Vector)
import Data.HashMap.Strict (HashMap)
import GHC.Generics (Generic)

type Size = Int

gParseJSON :: _ => Value -> Parser a
gParseJSON :: Value -> Parser a
gParseJSON = Options -> Value -> Parser a
forall a.
(Generic a, GFromJSON Zero (Rep a)) =>
Options -> Value -> Parser a
genericParseJSON Options
dropEndTick

gToJSON :: _ => a -> Value
gToJSON :: a -> Value
gToJSON = Options -> a -> Value
forall a.
(Generic a, GToJSON' Value Zero (Rep a)) =>
Options -> a -> Value
genericToJSON Options
dropEndTick

dropEndTick :: Options
dropEndTick :: Options
dropEndTick = Options
defaultOptions
  { fieldLabelModifier :: String -> String
fieldLabelModifier = (Char -> Bool) -> String -> String
forall a. (a -> Bool) -> [a] -> [a]
dropWhileEnd (Char -> Char -> Bool
forall a. Eq a => a -> a -> Bool
== Char
'\'')
  }