Skip to content

Commit dc4a5f3

Browse files
committed
Add JsonValue signature file
1 parent e81601a commit dc4a5f3

3 files changed

Lines changed: 52 additions & 3 deletions

File tree

src/FSharp.Data.GraphQL.Client/FSharp.Data.GraphQL.Client.fsproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
<ItemGroup>
2424
<Compile Include="MimeTypes.fs" />
2525
<Compile Include="TextConversions.fs" />
26+
<Compile Include="JsonValue.fsi" />
2627
<Compile Include="JsonValue.fs" />
2728
<Compile Include="Extensions.fs" />
2829
<Compile Include="Schema.fs" />

src/FSharp.Data.GraphQL.Client/JsonValue.fs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,6 @@ type JsonValue =
4040
| Boolean of bool
4141
| Null
4242

43-
/// <exclude />
44-
[<EditorBrowsableAttribute(EditorBrowsableState.Never)>]
45-
[<CompilerMessageAttribute("This property is intended for use in generated code only.", 10001, IsHidden=true, IsError=false)>]
4643
member x._Print =
4744
let str = x.ToString()
4845
if str.Length > 512 then str.Substring(0, 509) + "..."
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
namespace FSharp.Data.GraphQL.Client
2+
open System.ComponentModel
3+
/// Specifies the formatting behaviour of JSON values.
4+
[<RequireQualifiedAccess; Struct>]
5+
type JsonSaveOptions =
6+
| None = 0
7+
| DisableFormatting = 1
8+
9+
/// Represents a JSON value. Large numbers that do not fit in the
10+
/// Decimal type are represented using the Float case, while
11+
/// smaller numbers are represented as decimals to avoid precision loss.
12+
[<RequireQualifiedAccess; StructuredFormatDisplay ("{_Print}")>]
13+
type JsonValue =
14+
| Integer of int
15+
| String of string
16+
| Float of float
17+
| Record of properties: (string * JsonValue)[]
18+
| Array of elements: JsonValue[]
19+
| Boolean of bool
20+
| Null
21+
22+
static member
23+
internal JsonStringEncodeTo: w: System.IO.TextWriter ->
24+
value: string -> unit
25+
26+
/// Parses the specified JSON string.
27+
static member Parse: text: string -> JsonValue
28+
29+
/// Attempts to parse the specified JSON string.
30+
static member TryParse: text: string -> JsonValue option
31+
32+
override ToString: unit -> string
33+
34+
member ToString: saveOptions: JsonSaveOptions -> string
35+
36+
/// Serializes the JsonValue to the specified System.IO.TextWriter.
37+
member
38+
WriteTo: w: System.IO.TextWriter * saveOptions: JsonSaveOptions ->
39+
unit
40+
41+
/// <exclude />
42+
[<EditorBrowsableAttribute(EditorBrowsableState.Never);
43+
CompilerMessageAttribute("This property is intended for use in generated code only.", 10001, IsHidden=true, IsError=false)>]
44+
member _Print: string
45+
46+
type private JsonParser =
47+
48+
new: jsonText: string -> JsonParser
49+
50+
member Parse: unit -> JsonValue
51+

0 commit comments

Comments
 (0)