ConfigError.ts overview
Since v2.0.0
Exports Grouped by Category
constructors
And
Signature
declare const And: (self: ConfigError, that: ConfigError) => ConfigError
Since v2.0.0
InvalidData
Signature
declare const InvalidData: (path: Array<string>, message: string, options?: Options) => ConfigError
Since v2.0.0
MissingData
Signature
declare const MissingData: (path: Array<string>, message: string, options?: Options) => ConfigError
Since v2.0.0
Or
Signature
declare const Or: (self: ConfigError, that: ConfigError) => ConfigError
Since v2.0.0
SourceUnavailable
Signature
declare const SourceUnavailable: (
path: Array<string>,
message: string,
cause: Cause.Cause<unknown>,
options?: Options
) => ConfigError
Since v2.0.0
Unsupported
Signature
declare const Unsupported: (path: Array<string>, message: string, options?: Options) => ConfigError
Since v2.0.0
folding
reduceWithContext
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
}
Since v2.0.0
models
And (interface)
Signature
export interface And extends ConfigError.Proto {
readonly _op: "And"
readonly left: ConfigError
readonly right: ConfigError
}
Since v2.0.0
ConfigError (type alias)
The possible ways that loading configuration data may fail.
Signature
type ConfigError = And | Or | InvalidData | MissingData | SourceUnavailable | Unsupported
Since v2.0.0
ConfigErrorReducer (interface)
Signature
export interface ConfigErrorReducer<in C, in out Z> {
andCase(context: C, left: Z, right: Z): Z
orCase(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
sourceUnavailableCase(context: C, path: Array<string>, message: string, cause: Cause.Cause<unknown>): Z
unsupportedCase(context: C, path: Array<string>, message: string): Z
}
Since v2.0.0
InvalidData (interface)
Signature
export interface InvalidData extends ConfigError.Proto {
readonly _op: "InvalidData"
readonly path: Array<string>
readonly message: string
}
Since v2.0.0
MissingData (interface)
Signature
export interface MissingData extends ConfigError.Proto {
readonly _op: "MissingData"
readonly path: Array<string>
readonly message: string
}
Since v2.0.0
Options (interface)
Signature
export interface Options {
readonly pathDelim: string
}
Since v2.0.0
Or (interface)
Signature
export interface Or extends ConfigError.Proto {
readonly _op: "Or"
readonly left: ConfigError
readonly right: ConfigError
}
Since v2.0.0
SourceUnavailable (interface)
Signature
export interface SourceUnavailable extends ConfigError.Proto {
readonly _op: "SourceUnavailable"
readonly path: Array<string>
readonly message: string
readonly cause: Cause.Cause<unknown>
}
Since v2.0.0
Unsupported (interface)
Signature
export interface Unsupported extends ConfigError.Proto {
readonly _op: "Unsupported"
readonly path: Array<string>
readonly message: string
}
Since v2.0.0
refinements
isAnd
Returns true
if the specified ConfigError
is an And
, false
otherwise.
Signature
declare const isAnd: (self: ConfigError) => self is And
Since v2.0.0
isConfigError
Returns true
if the specified value is a ConfigError
, false
otherwise.
Signature
declare const isConfigError: (u: unknown) => u is ConfigError
Since v2.0.0
isInvalidData
Returns true
if the specified ConfigError
is an InvalidData
, false
otherwise.
Signature
declare const isInvalidData: (self: ConfigError) => self is InvalidData
Since v2.0.0
isMissingData
Returns true
if the specified ConfigError
is an MissingData
, false
otherwise.
Signature
declare const isMissingData: (self: ConfigError) => self is MissingData
Since v2.0.0
isOr
Returns true
if the specified ConfigError
is an Or
, false
otherwise.
Signature
declare const isOr: (self: ConfigError) => self is Or
Since v2.0.0
isSourceUnavailable
Returns true
if the specified ConfigError
is a SourceUnavailable
, false
otherwise.
Signature
declare const isSourceUnavailable: (self: ConfigError) => self is SourceUnavailable
Since v2.0.0
isUnsupported
Returns true
if the specified ConfigError
is an Unsupported
, false
otherwise.
Signature
declare const isUnsupported: (self: ConfigError) => self is Unsupported
Since v2.0.0
symbols
ConfigErrorTypeId
Signature
declare const ConfigErrorTypeId: unique symbol
Since v2.0.0
ConfigErrorTypeId (type alias)
Signature
type ConfigErrorTypeId = typeof ConfigErrorTypeId
Since v2.0.0
utils
ConfigError (namespace)
Since v2.0.0
Proto (interface)
Signature
export interface Proto {
readonly _tag: "ConfigError"
readonly [ConfigErrorTypeId]: ConfigErrorTypeId
}
Since v2.0.0
Reducer (type alias)
Signature
type Reducer<C, Z> = ConfigErrorReducer<C, Z>
Since v2.0.0
isMissingDataOnly
Returns true
if the specified ConfigError
contains only MissingData
errors, false
otherwise.
Signature
declare const isMissingDataOnly: (self: ConfigError) => boolean
Since v2.0.0
prefixed
Signature
declare const prefixed: {
(prefix: Array<string>): (self: ConfigError) => ConfigError
(self: ConfigError, prefix: Array<string>): ConfigError
}
Since v2.0.0