Interface IPromiseOptions<Pending, Success, Error>

Parameters for notification depending on a promise.

interface IPromiseOptions<
    Pending extends ReadonlyJSONValue,
    Success extends ReadonlyJSONValue = Pending,
    Error extends ReadonlyJSONValue = Pending,
> {
    error: {
        message: (reason: unknown, data?: Error) => string;
        options?: Notification.IOptions<Error>;
    };
    pending: { message: string; options?: Notification.IOptions<Pending> };
    success: {
        message: (result: unknown, data?: Success) => string;
        options?: Notification.IOptions<Success>;
    };
}

Type Parameters

  • Pending extends ReadonlyJSONValue
  • Success extends ReadonlyJSONValue = Pending
  • Error extends ReadonlyJSONValue = Pending

Properties

Properties

error: {
    message: (reason: unknown, data?: Error) => string;
    options?: Notification.IOptions<Error>;
}

Message when promise rejects and options

The message factory receives as first argument the error of the promise and as second the error options.data.

The message will be truncated if longer than 140 characters.

pending: { message: string; options?: Notification.IOptions<Pending> }

Promise pending message and options

The message will be truncated if longer than 140 characters.

success: {
    message: (result: unknown, data?: Success) => string;
    options?: Notification.IOptions<Success>;
}

Message when promise resolves and options

The message factory receives as first argument the result of the promise and as second the success options.data.

The message will be truncated if longer than 140 characters.