Skip to content

ConfigError

28 exports Added in v2.0.0 Source

Constructors

And

Added in v2.0.0 Source

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;

Or

Added in v2.0.0 Source

Signature

declare const Or: (self: ConfigError, that: ConfigError) => ConfigError;

Signature

declare const SourceUnavailable: (
  path: Array<string>,
  message: string,
  cause: Cause<unknown>,
  options?: Options,
) => ConfigError;

Unsupported

Added in v2.0.0 Source

Signature

declare const Unsupported: (path: Array<string>, message: string, options?: Options) => ConfigError;

Folding

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

And interface

Added in v2.0.0 Source

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

The possible ways that loading configuration data may fail.

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>;
}

Options interface

Added in v2.0.0 Source

Signature

interface Options {
  readonly pathDelim: string;
}

Or interface

Added in v2.0.0 Source

Signature

interface Or extends Proto {
  readonly _op: "Or";
  readonly left: ConfigError;
  readonly message: string;
  readonly right: ConfigError;
}

SourceUnavailable interface

Added in v2.0.0 Source

Signature

interface SourceUnavailable extends Proto {
  readonly _op: "SourceUnavailable";
  readonly cause: Cause<unknown>;
  readonly message: string;
  readonly path: Array<string>;
}

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

Returns true if the specified ConfigError contains only MissingData errors, false otherwise.

Signature

declare const isMissingDataOnly: (self: ConfigError) => boolean;

Refinements

isAnd

Added in v2.0.0 Source

Returns true if the specified ConfigError is an And, false otherwise.

Signature

declare const isAnd: (self: ConfigError) => self is And;

Returns true if the specified value is a ConfigError, false otherwise.

Signature

declare const isConfigError: (u: unknown) => u is ConfigError;

Returns true if the specified ConfigError is an InvalidData, false otherwise.

Signature

declare const isInvalidData: (self: ConfigError) => self is InvalidData;

Returns true if the specified ConfigError is an MissingData, false otherwise.

Signature

declare const isMissingData: (self: ConfigError) => self is MissingData;

isOr

Added in v2.0.0 Source

Returns true if the specified ConfigError is an Or, false otherwise.

Signature

declare const isOr: (self: ConfigError) => self is Or;

Returns true if the specified ConfigError is a SourceUnavailable, false otherwise.

Signature

declare const isSourceUnavailable: (self: ConfigError) => self is SourceUnavailable;

Returns true if the specified ConfigError is an Unsupported, false otherwise.

Signature

declare const isUnsupported: (self: ConfigError) => self is Unsupported;

Symbols

Signature

declare const ConfigErrorTypeId: unique symbol;

ConfigErrorTypeId type

Added in v2.0.0 Source

Signature

type ConfigErrorTypeId = typeof ConfigErrorTypeId;

Utils

prefixed

Added in v2.0.0 Source

Signature

declare const prefixed: {
  (prefix: Array<string>): (self: ConfigError) => ConfigError;
  (self: ConfigError, prefix: Array<string>): ConfigError;
};