|
| 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