Type Alias SNBTParseErrorCauseStackItem

SNBTParseErrorCauseStackItem:
    | {
        error?: | {
            argument: string;
            functionName: "bool"
            | "uuid";
            type: "InvalidArgumentToFunction";
        }
        | { functionName: string; type: "UnsupportedFunction" }
        | { raw: any; type: "UnsupportedSNBTPrimitive" }
        | { raw: any; type: "InvalidSNBTString" };
        function: "parseSNBTPrimitive";
        input: any;
        positionInInput: number;
    }
    | {
        error: { type: "InvalidUUID"; uuid: string };
        function: "uuidToIntArray";
        input: string;
        positionInInput: number;
    }
    | {
        arrayType: `${B
        | S
        | I
        | L}`;
        error?:
            | {
                allowedTypes: `${B
                | S
                | I
                | L}`[];
                itemType: `${B | S | I | L}`;
                type: "DisallowedTypeInTypedArray";
            }
            | { itemType?: `${TagType}`; type: "UnsupportedTypeInTypedArray" };
        function: "parseTypedArray";
        inputItem: string;
        inputItemIndex: number;
        inputItems: string[];
        positionInInputItem: number;
    }
    | {
        error?: {
            detectedArrayType: `${TagType}`;
            item: Tags[TagType];
            itemType: `${TagType}`;
            type: "MixedListTypesNotAllowed";
        };
        function: "parseList";
        inputItem: string;
        inputItemIndex: number;
        inputItems: string[];
        positionInInputItem: number;
    }
    | {
        error?: { raw: any; type: "InvalidSNBTKey" };
        function: "extractSNBT" | "parseSNBTCompoundString";
        input: string;
        key?: string;
        positionInInput: number;
    }

A stack item in an SNBT parse error.

Type declaration

  • {
        error?:
            | {
                argument: string;
                functionName: "bool"
                | "uuid";
                type: "InvalidArgumentToFunction";
            }
            | { functionName: string; type: "UnsupportedFunction" }
            | { raw: any; type: "UnsupportedSNBTPrimitive" }
            | { raw: any; type: "InvalidSNBTString" };
        function: "parseSNBTPrimitive";
        input: any;
        positionInInput: number;
    }
    • Optionalerror?:
          | {
              argument: string;
              functionName: "bool"
              | "uuid";
              type: "InvalidArgumentToFunction";
          }
          | { functionName: string; type: "UnsupportedFunction" }
          | { raw: any; type: "UnsupportedSNBTPrimitive" }
          | { raw: any; type: "InvalidSNBTString" }

      The error associated with this stack item.

    • function: "parseSNBTPrimitive"

      The function associated with this stack item.

    • input: any

      The input.

    • positionInInput: number

      The position of the error in the input.

  • {
        error: { type: "InvalidUUID"; uuid: string };
        function: "uuidToIntArray";
        input: string;
        positionInInput: number;
    }
    • error: { type: "InvalidUUID"; uuid: string }

      The error associated with this stack item.

      • type: "InvalidUUID"

        The type of this error.

      • uuid: string

        The invalid UUID that caused this error.

    • function: "uuidToIntArray"

      The function associated with this stack item.

    • input: string

      The input.

    • positionInInput: number

      The position of the error in the input.

  • {
        arrayType: `${B | S | I | L}`;
        error?:
            | {
                allowedTypes: `${B
                | S
                | I
                | L}`[];
                itemType: `${B | S | I | L}`;
                type: "DisallowedTypeInTypedArray";
            }
            | { itemType?: `${TagType}`; type: "UnsupportedTypeInTypedArray" };
        function: "parseTypedArray";
        inputItem: string;
        inputItemIndex: number;
        inputItems: string[];
        positionInInputItem: number;
    }
    • arrayType: `${B | S | I | L}`

      The type of the typed array associated with this stack item.

    • Optionalerror?:
          | {
              allowedTypes: `${B
              | S
              | I
              | L}`[];
              itemType: `${B | S | I | L}`;
              type: "DisallowedTypeInTypedArray";
          }
          | { itemType?: `${TagType}`; type: "UnsupportedTypeInTypedArray" }

      The error associated with this stack item.

    • function: "parseTypedArray"

      The function associated with this stack item.

    • inputItem: string

      The input item associated with this stack item.

    • inputItemIndex: number

      The index of the input item associated with this stack item.

    • inputItems: string[]

      The input items (the items in the typed array).

    • positionInInputItem: number

      The position of the error in the input item.

  • {
        error?: {
            detectedArrayType: `${TagType}`;
            item: Tags[TagType];
            itemType: `${TagType}`;
            type: "MixedListTypesNotAllowed";
        };
        function: "parseList";
        inputItem: string;
        inputItemIndex: number;
        inputItems: string[];
        positionInInputItem: number;
    }
    • Optionalerror?: {
          detectedArrayType: `${TagType}`;
          item: Tags[TagType];
          itemType: `${TagType}`;
          type: "MixedListTypesNotAllowed";
      }

      The error associated with this stack item.

      • detectedArrayType: `${TagType}`

        The detected type of the list.

      • item: Tags[TagType]

        The detected type of the item that caused this error.

      • itemType: `${TagType}`

        The type of the item that caused this error.

      • type: "MixedListTypesNotAllowed"

        The type of this error.

    • function: "parseList"

      The function associated with this stack item.

    • inputItem: string

      The input item associated with this stack item.

    • inputItemIndex: number

      The index of the input item associated with this stack item.

    • inputItems: string[]

      The input items (the items in the list).

    • positionInInputItem: number

      The position of the error in the input item.

  • {
        error?: { raw: any; type: "InvalidSNBTKey" };
        function: "extractSNBT" | "parseSNBTCompoundString";
        input: string;
        key?: string;
        positionInInput: number;
    }
    • Optionalerror?: { raw: any; type: "InvalidSNBTKey" }

      The error associated with this stack item.

      • raw: any

        The raw SNBT key value that caused this error.

      • type: "InvalidSNBTKey"

        The type of this error.

    • function: "extractSNBT" | "parseSNBTCompoundString"

      The function associated with this stack item.

    • input: string

      The input.

    • Optionalkey?: string

      The property key associated with this stack item.

    • positionInInput: number

      The position of the error in the input.