ConfigError
Constructors
Signature
declare const And: (self: ConfigError, that: ConfigError) => ConfigError;InvalidData
Added in v2.0.0
Source
Signature
declare const InvalidData: (path: Array<string>, message: string, options?: Options) => ConfigError;MissingData
Added in v2.0.0
Source
Signature
declare const MissingData: (path: Array<string>, message: string, options?: Options) => ConfigError;Signature
declare const Or: (self: ConfigError, that: ConfigError) => ConfigError;Unsupported
Added in v2.0.0
Source
Signature
declare const Unsupported: (path: Array<string>, message: string, options?: Options) => ConfigError;Folding
reduceWithContext
Added in v2.0.0
Source
Signature
declare const reduceWithContext: {
<C, Z>(context: C, reducer: ConfigErrorReducer<C, Z>): (self: ConfigError) => Z;
<C, Z>(self: ConfigError, context: C, reducer: ConfigErrorReducer<C, Z>): Z;
};Models
Signature
interface And extends Proto {
readonly _op: "And";
readonly left: ConfigError;
readonly message: string;
readonly right: ConfigError;
}ConfigError type
Added in v2.0.0
Source
Signature
type ConfigError = And | Or | InvalidData | MissingData | SourceUnavailable | Unsupported;ConfigErrorReducer interface
Added in v2.0.0
Source
Signature
interface ConfigErrorReducer<in C, in out Z> {
andCase(context: C, left: Z, right: Z): Z;
invalidDataCase(context: C, path: Array<string>, message: string): Z;
missingDataCase(context: C, path: Array<string>, message: string): Z;
orCase(context: C, left: Z, right: Z): Z;
sourceUnavailableCase(context: C, path: Array<string>, message: string, cause: Cause<unknown>): Z;
unsupportedCase(context: C, path: Array<string>, message: string): Z;
}InvalidData interface
Added in v2.0.0
Source
Signature
interface InvalidData extends Proto {
readonly _op: "InvalidData";
readonly message: string;
readonly path: Array<string>;
}MissingData interface
Added in v2.0.0
Source
Signature
interface MissingData extends Proto {
readonly _op: "MissingData";
readonly message: string;
readonly path: Array<string>;
}Signature
interface Options {
readonly pathDelim: string;
}Signature
interface Or extends Proto {
readonly _op: "Or";
readonly left: ConfigError;
readonly message: string;
readonly right: ConfigError;
}Unsupported interface
Added in v2.0.0
Source
Signature
interface Unsupported extends Proto {
readonly _op: "Unsupported";
readonly message: string;
readonly path: Array<string>;
}Other
ConfigError
Added in v2.0.0
Source
isMissingDataOnly
Added in v2.0.0
Source
Returns true if the specified ConfigError contains only MissingData errors, false otherwise.
Signature
declare const isMissingDataOnly: (self: ConfigError) => boolean;Refinements
Returns true if the specified ConfigError is an And, false otherwise.
Signature
declare const isAnd: (self: ConfigError) => self is And;isConfigError
Added in v2.0.0
Source
Returns true if the specified value is a ConfigError, false otherwise.
Signature
declare const isConfigError: (u: unknown) => u is ConfigError;isInvalidData
Added in v2.0.0
Source
Returns true if the specified ConfigError is an InvalidData, false otherwise.
Signature
declare const isInvalidData: (self: ConfigError) => self is InvalidData;isMissingData
Added in v2.0.0
Source
Returns true if the specified ConfigError is an MissingData, false otherwise.
Signature
declare const isMissingData: (self: ConfigError) => self is MissingData;Returns true if the specified ConfigError is an Or, false otherwise.
Signature
declare const isOr: (self: ConfigError) => self is Or;isUnsupported
Added in v2.0.0
Source
Returns true if the specified ConfigError is an Unsupported, false otherwise.
Signature
declare const isUnsupported: (self: ConfigError) => self is Unsupported;Symbols
ConfigErrorTypeId
Added in v2.0.0
Source
Signature
declare const ConfigErrorTypeId: unique symbol;ConfigErrorTypeId type
Added in v2.0.0
Source
Signature
type ConfigErrorTypeId = typeof ConfigErrorTypeId;
The possible ways that loading configuration data may fail.