/** * @since 2.0.0 */ import type * as Cause from "./Cause.js"; /** * @since 2.0.0 * @category symbols */ export declare const ConfigErrorTypeId: unique symbol; /** * @since 2.0.0 * @category symbols */ export type ConfigErrorTypeId = typeof ConfigErrorTypeId; /** * The possible ways that loading configuration data may fail. * * @since 2.0.0 * @category models */ export type ConfigError = And | Or | InvalidData | MissingData | SourceUnavailable | Unsupported; /** * @since 2.0.0 */ export declare namespace ConfigError { /** * @since 2.0.0 * @category models */ interface Proto { readonly _tag: "ConfigError"; readonly [ConfigErrorTypeId]: ConfigErrorTypeId; } /** * @since 2.0.0 * @category models */ type Reducer = ConfigErrorReducer; } /** * @since 2.0.0 * @category models */ export interface ConfigErrorReducer { andCase(context: C, left: Z, right: Z): Z; orCase(context: C, left: Z, right: Z): Z; invalidDataCase(context: C, path: Array, message: string): Z; missingDataCase(context: C, path: Array, message: string): Z; sourceUnavailableCase(context: C, path: Array, message: string, cause: Cause.Cause): Z; unsupportedCase(context: C, path: Array, message: string): Z; } /** * @since 2.0.0 * @category models */ export interface And extends ConfigError.Proto { readonly _op: "And"; readonly left: ConfigError; readonly right: ConfigError; readonly message: string; } /** * @since 2.0.0 * @category models */ export interface Or extends ConfigError.Proto { readonly _op: "Or"; readonly left: ConfigError; readonly right: ConfigError; readonly message: string; } /** * @since 2.0.0 * @category models */ export interface InvalidData extends ConfigError.Proto { readonly _op: "InvalidData"; readonly path: Array; readonly message: string; } /** * @since 2.0.0 * @category models */ export interface MissingData extends ConfigError.Proto { readonly _op: "MissingData"; readonly path: Array; readonly message: string; } /** * @since 2.0.0 * @category models */ export interface SourceUnavailable extends ConfigError.Proto { readonly _op: "SourceUnavailable"; readonly path: Array; readonly message: string; readonly cause: Cause.Cause; } /** * @since 2.0.0 * @category models */ export interface Unsupported extends ConfigError.Proto { readonly _op: "Unsupported"; readonly path: Array; readonly message: string; } /** * @since 2.0.0 * @category models */ export interface Options { readonly pathDelim: string; } /** * @since 2.0.0 * @category constructors */ export declare const And: (self: ConfigError, that: ConfigError) => ConfigError; /** * @since 2.0.0 * @category constructors */ export declare const Or: (self: ConfigError, that: ConfigError) => ConfigError; /** * @since 2.0.0 * @category constructors */ export declare const MissingData: (path: Array, message: string, options?: Options) => ConfigError; /** * @since 2.0.0 * @category constructors */ export declare const InvalidData: (path: Array, message: string, options?: Options) => ConfigError; /** * @since 2.0.0 * @category constructors */ export declare const SourceUnavailable: (path: Array, message: string, cause: Cause.Cause, options?: Options) => ConfigError; /** * @since 2.0.0 * @category constructors */ export declare const Unsupported: (path: Array, message: string, options?: Options) => ConfigError; /** * Returns `true` if the specified value is a `ConfigError`, `false` otherwise. * * @since 2.0.0 * @category refinements */ export declare const isConfigError: (u: unknown) => u is ConfigError; /** * Returns `true` if the specified `ConfigError` is an `And`, `false` otherwise. * * @since 2.0.0 * @category refinements */ export declare const isAnd: (self: ConfigError) => self is And; /** * Returns `true` if the specified `ConfigError` is an `Or`, `false` otherwise. * * @since 2.0.0 * @category refinements */ export declare const isOr: (self: ConfigError) => self is Or; /** * Returns `true` if the specified `ConfigError` is an `InvalidData`, `false` * otherwise. * * @since 2.0.0 * @category refinements */ export declare const isInvalidData: (self: ConfigError) => self is InvalidData; /** * Returns `true` if the specified `ConfigError` is an `MissingData`, `false` * otherwise. * * @since 2.0.0 * @category refinements */ export declare const isMissingData: (self: ConfigError) => self is MissingData; /** * Returns `true` if the specified `ConfigError` contains only `MissingData` errors, `false` otherwise. * * @since 2.0.0 * @categer getters */ export declare const isMissingDataOnly: (self: ConfigError) => boolean; /** * Returns `true` if the specified `ConfigError` is a `SourceUnavailable`, * `false` otherwise. * * @since 2.0.0 * @category refinements */ export declare const isSourceUnavailable: (self: ConfigError) => self is SourceUnavailable; /** * Returns `true` if the specified `ConfigError` is an `Unsupported`, `false` * otherwise. * * @since 2.0.0 * @category refinements */ export declare const isUnsupported: (self: ConfigError) => self is Unsupported; /** * @since 2.0.0 * @category utils */ export declare const prefixed: { /** * @since 2.0.0 * @category utils */ (prefix: Array): (self: ConfigError) => ConfigError; /** * @since 2.0.0 * @category utils */ (self: ConfigError, prefix: Array): ConfigError; }; /** * @since 2.0.0 * @category folding */ export declare const reduceWithContext: { /** * @since 2.0.0 * @category folding */ (context: C, reducer: ConfigErrorReducer): (self: ConfigError) => Z; /** * @since 2.0.0 * @category folding */ (self: ConfigError, context: C, reducer: ConfigErrorReducer): Z; }; //# sourceMappingURL=ConfigError.d.ts.map