diff --git a/src/FSharp.Data.GraphQL.Client/FSharp.Data.GraphQL.Client.fsproj b/src/FSharp.Data.GraphQL.Client/FSharp.Data.GraphQL.Client.fsproj index 87a6f3a98..5f7714765 100644 --- a/src/FSharp.Data.GraphQL.Client/FSharp.Data.GraphQL.Client.fsproj +++ b/src/FSharp.Data.GraphQL.Client/FSharp.Data.GraphQL.Client.fsproj @@ -23,6 +23,7 @@ + diff --git a/src/FSharp.Data.GraphQL.Client/JsonValue.fs b/src/FSharp.Data.GraphQL.Client/JsonValue.fs index fc8efe51d..ad5119009 100644 --- a/src/FSharp.Data.GraphQL.Client/JsonValue.fs +++ b/src/FSharp.Data.GraphQL.Client/JsonValue.fs @@ -40,9 +40,6 @@ type JsonValue = | Boolean of bool | Null - /// - [] - [] member x._Print = let str = x.ToString() if str.Length > 512 then str.Substring(0, 509) + "..." diff --git a/src/FSharp.Data.GraphQL.Client/JsonValue.fsi b/src/FSharp.Data.GraphQL.Client/JsonValue.fsi new file mode 100644 index 000000000..eddb9de91 --- /dev/null +++ b/src/FSharp.Data.GraphQL.Client/JsonValue.fsi @@ -0,0 +1,45 @@ +namespace FSharp.Data.GraphQL.Client +open System.ComponentModel + /// Specifies the formatting behaviour of JSON values. + [] + type JsonSaveOptions = + | None = 0 + | DisableFormatting = 1 + + /// Represents a JSON value. Large numbers that do not fit in the + /// Decimal type are represented using the Float case, while + /// smaller numbers are represented as decimals to avoid precision loss. + [] + type JsonValue = + | Integer of int + | String of string + | Float of float + | Record of properties: (string * JsonValue)[] + | Array of elements: JsonValue[] + | Boolean of bool + | Null + + static member + internal JsonStringEncodeTo: w: System.IO.TextWriter -> + value: string -> unit + + /// Parses the specified JSON string. + static member Parse: text: string -> JsonValue + + /// Attempts to parse the specified JSON string. + static member TryParse: text: string -> JsonValue option + + override ToString: unit -> string + + member ToString: saveOptions: JsonSaveOptions -> string + + /// Serializes the JsonValue to the specified System.IO.TextWriter. + member + WriteTo: w: System.IO.TextWriter * saveOptions: JsonSaveOptions -> + unit + + /// + [] + member _Print: string +