UNPKG

navidev-adt-api

Version:

API de conexión al Abap Developer Tools

30 lines 1.06 kB
import AdtException from "..//exceptions/adtException"; export type errorTypes = string | AdtException | null | undefined; export declare class Result<T> { isSuccess: boolean; isFailure: boolean; private _error; private _value; constructor(isSuccess: boolean, error?: errorTypes, value?: T | undefined); getValue(): T | undefined; getErrorValue(): T; static ok<U>(value?: U): Result<U>; static fail<U>(error: string | AdtException): Result<U>; static combine(results: Result<any>[]): Result<any>; } export type Either<L, A> = Left<L, A> | Right<L, A>; export declare class Left<L, A> { readonly value: L; constructor(value: L); isLeft(): this is Left<L, A>; isRight(): this is Right<L, A>; } export declare class Right<L, A> { readonly value: A; constructor(value: A); isLeft(): this is Left<L, A>; isRight(): this is Right<L, A>; } export declare const left: <L, A>(l: L) => Either<L, A>; export declare const right: <L, A>(a: A) => Either<L, A>; //# sourceMappingURL=Result.d.ts.map