Skip to content

Latest commit

 

History

History
63 lines (57 loc) · 2.03 KB

types.messagedetails.md

File metadata and controls

63 lines (57 loc) · 2.03 KB

Home > @skunkteam/types > MessageDetails

MessageDetails type

Individual message details with optional info about the performed validation.

Signature:

type MessageDetails = Partial<ValidationDetails> & {
    path?: PropertyKey[];
    context?: string;
    omitInput?: boolean;
} & (
        | {
              kind?: undefined;
          }
        | {
              kind: 'missing property';
              property: string;
          }
        | {
              kind: 'invalid key';
              property: string;
              failure: Failure;
          }
        | {
              kind: 'invalid literal';
              expected: LiteralValue | LiteralValue[];
          }
        | {
              kind: 'invalid basic type';
              expected: BasicType | BasicType[];
              expectedValue?: LiteralValue;
          }
        | {
              kind: 'length out of range';
              violation: LengthViolation;
              config: LengthChecksConfig;
          }
        | {
              kind: 'input out of range';
              violation: NumberViolation;
              config: NumberTypeConfig;
          }
        | {
              kind: 'pattern mismatch';
              config: StringTypeConfig;
          }
        | {
              kind: 'union';
              failures: Failure[];
          }
        | {
              kind: 'custom message';
              message: string;
          }
    );

References: ValidationDetails, Failure, LiteralValue, BasicType, LengthViolation, LengthChecksConfig, NumberViolation, NumberTypeConfig, StringTypeConfig