@nfdi4plants/swate-components
Version:
Customizable React components for ontology annotation, based on Swate and the ARC.
120 lines • 9.8 kB
TypeScript
import { Decoder$1, IDecoderHelpers$1, ErrorReason$1_$union } from './Types.fs.js';
import { FSharpList } from '@fable-org/fable-library-js/List.js';
import { FSharpResult$2_$union } from '@fable-org/fable-library-js/Result.js';
import { float32 as float32_1, uint32 as uint32_1, int32, uint16 as uint16_1, int16 as int16_1, uint8, int8, float64 } from '@fable-org/fable-library-js/Int32.js';
import { uint64 as uint64_1, int64 as int64_1 } from '@fable-org/fable-library-js/BigInt.js';
import { decimal as decimal_1 } from '@fable-org/fable-library-js/Decimal.js';
import { Option } from '@fable-org/fable-library-js/Option.js';
import { TypeInfo } from '@fable-org/fable-library-js/Reflection.js';
import { FSharpMap } from '@fable-org/fable-library-js/Map.js';
export declare function Helpers_prependPath<JsonValue>(path: string, err_: string, err__1: ErrorReason$1_$union<JsonValue>): [string, ErrorReason$1_$union<JsonValue>];
export declare function errorToString<JsonValue>(helpers: IDecoderHelpers$1<JsonValue>, path: string, error: ErrorReason$1_$union<JsonValue>): string;
/**
* Runs the decoder against the given JSON value.
*
* If the decoder fails, it reports the error prefixed with the given path.
*/
export declare function Advanced_fromValue<JsonValue, T>(helpers: IDecoderHelpers$1<JsonValue>, decoder: Decoder$1<T>, value_1: JsonValue): FSharpResult$2_$union<T, string>;
export declare const string: Decoder$1<string>;
export declare const char: Decoder$1<string>;
export declare const guid: Decoder$1<string>;
export declare const unit: Decoder$1<void>;
export declare const sbyte: Decoder$1<int8>;
export declare const byte: Decoder$1<uint8>;
export declare const int16: Decoder$1<int16_1>;
export declare const uint16: Decoder$1<uint16_1>;
export declare const int: Decoder$1<int32>;
export declare const uint32: Decoder$1<uint32_1>;
export declare const int64: Decoder$1<int64_1>;
export declare const uint64: Decoder$1<uint64_1>;
export declare const bigint: Decoder$1<bigint>;
export declare const bool: Decoder$1<boolean>;
export declare const float: Decoder$1<float64>;
export declare const float32: Decoder$1<float32_1>;
export declare const decimal: Decoder$1<decimal_1>;
export declare const datetimeUtc: Decoder$1<Date>;
export declare const datetimeLocal: Decoder$1<Date>;
export declare const datetimeOffset: Decoder$1<Date>;
export declare const timespan: Decoder$1<number>;
export declare function optional<value>(fieldName: string, decoder: Decoder$1<value>): Decoder$1<Option<value>>;
export declare function map2<a, b, Output>(ctor: ((arg0: a, arg1: b) => Output), d1: Decoder$1<a>, d2: Decoder$1<b>): Decoder$1<Output>;
export declare function optionalAt<value>(fieldNames: FSharpList<string>, decoder: Decoder$1<value>): Decoder$1<Option<value>>;
export declare function field<value>(fieldName: string, decoder: Decoder$1<value>): Decoder$1<value>;
export declare function at<value>(fieldNames: FSharpList<string>, decoder: Decoder$1<value>): Decoder$1<value>;
export declare function index<value>(requestedIndex: int32, decoder: Decoder$1<value>): Decoder$1<value>;
export declare function list<value>(decoder: Decoder$1<value>): Decoder$1<FSharpList<value>>;
export declare function resizeArray<value>(decoder: Decoder$1<value>): Decoder$1<value[]>;
export declare function seq<value>(decoder: Decoder$1<value>): Decoder$1<Iterable<value>>;
export declare function array<value>(decoder: Decoder$1<value>): Decoder$1<value[]>;
export declare const keys: Decoder$1<FSharpList<string>>;
export declare function keyValuePairs<value>(decoder: Decoder$1<value>): Decoder$1<FSharpList<[string, value]>>;
export declare function oneOf<value>(decoders: FSharpList<Decoder$1<value>>): Decoder$1<value>;
export declare function nil<a>(output: a): Decoder$1<a>;
export declare function value<$a, $b, $c>(_arg: $a, v: $b): FSharpResult$2_$union<$b, $c>;
export declare function succeed<a>(output: a): Decoder$1<a>;
export declare function fail<a>(msg: string): Decoder$1<a>;
export declare function andThen<a, b>(cb: ((arg0: a) => Decoder$1<b>), decoder: Decoder$1<a>): Decoder$1<b>;
export declare function all<a>(decoders: FSharpList<Decoder$1<a>>): Decoder$1<FSharpList<a>>;
export declare function map<a, Output>(ctor: ((arg0: a) => Output), d1: Decoder$1<a>): Decoder$1<Output>;
export declare function map3<a, b, c, Output>(ctor: ((arg0: a, arg1: b, arg2: c) => Output), d1: Decoder$1<a>, d2: Decoder$1<b>, d3: Decoder$1<c>): Decoder$1<Output>;
export declare function map4<a, b, c, d, Output>(ctor: ((arg0: a, arg1: b, arg2: c, arg3: d) => Output), d1: Decoder$1<a>, d2: Decoder$1<b>, d3: Decoder$1<c>, d4: Decoder$1<d>): Decoder$1<Output>;
export declare function map5<a, b, c, d, e, Output>(ctor: ((arg0: a, arg1: b, arg2: c, arg3: d, arg4: e) => Output), d1: Decoder$1<a>, d2: Decoder$1<b>, d3: Decoder$1<c>, d4: Decoder$1<d>, d5: Decoder$1<e>): Decoder$1<Output>;
export declare function map6<a, b, c, d, e, f, Output>(ctor: ((arg0: a, arg1: b, arg2: c, arg3: d, arg4: e, arg5: f) => Output), d1: Decoder$1<a>, d2: Decoder$1<b>, d3: Decoder$1<c>, d4: Decoder$1<d>, d5: Decoder$1<e>, d6: Decoder$1<f>): Decoder$1<Output>;
export declare function map7<a, b, c, d, e, f, g, Output>(ctor: ((arg0: a, arg1: b, arg2: c, arg3: d, arg4: e, arg5: f, arg6: g) => Output), d1: Decoder$1<a>, d2: Decoder$1<b>, d3: Decoder$1<c>, d4: Decoder$1<d>, d5: Decoder$1<e>, d6: Decoder$1<f>, d7: Decoder$1<g>): Decoder$1<Output>;
export declare function map8<a, b, c, d, e, f, g, h, Output>(ctor: ((arg0: a, arg1: b, arg2: c, arg3: d, arg4: e, arg5: f, arg6: g, arg7: h) => Output), d1: Decoder$1<a>, d2: Decoder$1<b>, d3: Decoder$1<c>, d4: Decoder$1<d>, d5: Decoder$1<e>, d6: Decoder$1<f>, d7: Decoder$1<g>, d8: Decoder$1<h>): Decoder$1<Output>;
/**
* Decode a JSON null value into an F# option.
*
* Attention, this decoder is lossy, it will not be able to distinguish between `'T option` and `'T option option`.
*
* If you need to distinguish between `'T option` and `'T option option`, use `losslessOption`.
*/
export declare function lossyOption<value>(decoder: Decoder$1<value>): Decoder$1<Option<value>>;
/**
* Decode a JSON null value into an F# option.
*
* This decoder is lossless, it will be able to distinguish between `'T option` and `'T option option`.
*
* If you don't need to distinguish between `'T option` and `'T option option`, you can use `lossyOption` which is more efficient.
*/
export declare function losslessOption<value>(decoder: Decoder$1<value>): Decoder$1<Option<value>>;
/**
* Allow to incrementally apply a decoder, for building large objects.
*/
export declare function andMap<a, b>(): ((arg0: Decoder$1<a>) => ((arg0: Decoder$1<((arg0: a) => b)>) => Decoder$1<b>));
export interface IRequiredGetter {
At<a>(arg0: FSharpList<string>, arg1: Decoder$1<a>): a;
Field<a>(arg0: string, arg1: Decoder$1<a>): a;
Raw<a>(arg0: Decoder$1<a>): a;
}
export interface IOptionalGetter {
At<a>(arg0: FSharpList<string>, arg1: Decoder$1<a>): Option<a>;
Field<a>(arg0: string, arg1: Decoder$1<a>): Option<a>;
Raw<a>(arg0: Decoder$1<a>): Option<a>;
}
export interface IGetters {
Optional: IOptionalGetter;
Required: IRequiredGetter;
}
export declare class Getters$2<JsonValue, T> implements IGetters {
errors: [string, ErrorReason$1_$union<JsonValue>][];
readonly required: IRequiredGetter;
readonly optional: IOptionalGetter;
constructor(helpers: IDecoderHelpers$1<JsonValue>, value_1: JsonValue);
get Required(): IRequiredGetter;
get Optional(): IOptionalGetter;
}
export declare function Getters$2_$reflection(gen0: TypeInfo, gen1: TypeInfo): TypeInfo;
export declare function Getters$2_$ctor_Z4BE6C149<JsonValue, T>(helpers: IDecoderHelpers$1<JsonValue>, value_1: JsonValue): Getters$2<JsonValue, T>;
export declare function Getters$2__get_Errors<JsonValue, T>(__: Getters$2<JsonValue, T>): FSharpList<[string, ErrorReason$1_$union<JsonValue>]>;
export declare function object<value>(builder: ((arg0: IGetters) => value)): Decoder$1<value>;
export declare function tuple2<T1, T2>(decoder1: Decoder$1<T1>, decoder2: Decoder$1<T2>): Decoder$1<[T1, T2]>;
export declare function tuple3<T1, T2, T3>(decoder1: Decoder$1<T1>, decoder2: Decoder$1<T2>, decoder3: Decoder$1<T3>): Decoder$1<[T1, T2, T3]>;
export declare function tuple4<T1, T2, T3, T4>(decoder1: Decoder$1<T1>, decoder2: Decoder$1<T2>, decoder3: Decoder$1<T3>, decoder4: Decoder$1<T4>): Decoder$1<[T1, T2, T3, T4]>;
export declare function tuple5<T1, T2, T3, T4, T5>(decoder1: Decoder$1<T1>, decoder2: Decoder$1<T2>, decoder3: Decoder$1<T3>, decoder4: Decoder$1<T4>, decoder5: Decoder$1<T5>): Decoder$1<[T1, T2, T3, T4, T5]>;
export declare function tuple6<T1, T2, T3, T4, T5, T6>(decoder1: Decoder$1<T1>, decoder2: Decoder$1<T2>, decoder3: Decoder$1<T3>, decoder4: Decoder$1<T4>, decoder5: Decoder$1<T5>, decoder6: Decoder$1<T6>): Decoder$1<[T1, T2, T3, T4, T5, T6]>;
export declare function tuple7<T1, T2, T3, T4, T5, T6, T7>(decoder1: Decoder$1<T1>, decoder2: Decoder$1<T2>, decoder3: Decoder$1<T3>, decoder4: Decoder$1<T4>, decoder5: Decoder$1<T5>, decoder6: Decoder$1<T6>, decoder7: Decoder$1<T7>): Decoder$1<[T1, T2, T3, T4, T5, T6, T7]>;
export declare function tuple8<T1, T2, T3, T4, T5, T6, T7, T8>(decoder1: Decoder$1<T1>, decoder2: Decoder$1<T2>, decoder3: Decoder$1<T3>, decoder4: Decoder$1<T4>, decoder5: Decoder$1<T5>, decoder6: Decoder$1<T6>, decoder7: Decoder$1<T7>, decoder8: Decoder$1<T8>): Decoder$1<[T1, T2, T3, T4, T5, T6, T7, T8]>;
export declare function dict<value>(decoder: Decoder$1<value>): Decoder$1<FSharpMap<string, value>>;
export declare function map$0027<key, value>(keyDecoder: Decoder$1<key>, valueDecoder: Decoder$1<value>): Decoder$1<FSharpMap<key, value>>;
//# sourceMappingURL=Decode.fs.d.ts.map