{"version":3,"sources":["../../../src/schema/processing/processing-context.ts"],"sourcesContent":["/**\r\n * Options for processing context\r\n */\r\nexport interface ProcessingContextOptions {\r\n  /**\r\n   * If true, collect all validation errors instead of stopping at first error.\r\n   * Default: true (when context is provided)\r\n   */\r\n  collectAllErrors?: boolean;\r\n\r\n  /**\r\n   * If true, apply strict validation rules.\r\n   * Default: false\r\n   */\r\n  strictMode?: boolean;\r\n}\r\n\r\n/**\r\n * Context object passed through schema processing to collect errors\r\n * and maintain processing state. This provides a clean way to pass\r\n * options and collect results through the processing chain.\r\n */\r\nexport class ProcessingContext {\r\n  private _errors: Error[] = [];\r\n  private _options: ProcessingContextOptions;\r\n\r\n  constructor(options?: ProcessingContextOptions) {\r\n    this._options = {\r\n      collectAllErrors: true,\r\n      strictMode: false,\r\n      ...options\r\n    };\r\n  }\r\n\r\n  /**\r\n   * Whether to collect all errors or stop at first\r\n   */\r\n  get collectAllErrors(): boolean {\r\n    return this._options.collectAllErrors ?? true;\r\n  }\r\n\r\n  /**\r\n   * Whether strict validation mode is enabled\r\n   */\r\n  get strictMode(): boolean {\r\n    return this._options.strictMode ?? false;\r\n  }\r\n\r\n  /**\r\n   * Adds an error to the collection\r\n   */\r\n  addError(error: Error): void {\r\n    this._errors.push(error);\r\n  }\r\n\r\n  /**\r\n   * Adds multiple errors to the collection\r\n   */\r\n  addErrors(errors: Error[]): void {\r\n    this._errors.push(...errors);\r\n  }\r\n\r\n  /**\r\n   * Returns all collected errors\r\n   */\r\n  getErrors(): Error[] {\r\n    return this._errors;\r\n  }\r\n\r\n  /**\r\n   * Returns the number of collected errors\r\n   */\r\n  get errorCount(): number {\r\n    return this._errors.length;\r\n  }\r\n\r\n  /**\r\n   * Returns true if any errors were collected\r\n   */\r\n  hasErrors(): boolean {\r\n    return this._errors.length > 0;\r\n  }\r\n\r\n  /**\r\n   * Clears all collected errors\r\n   */\r\n  clearErrors(): void {\r\n    this._errors = [];\r\n  }\r\n}\r\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAsBO,MAAM,kBAAkB;AAAA,EACrB,UAAmB,CAAC;AAAA,EACpB;AAAA,EAER,YAAY,SAAoC;AAC9C,SAAK,WAAW;AAAA,MACd,kBAAkB;AAAA,MAClB,YAAY;AAAA,MACZ,GAAG;AAAA,IACL;AAAA,EACF;AAAA;AAAA;AAAA;AAAA,EAKA,IAAI,mBAA4B;AAC9B,WAAO,KAAK,SAAS,oBAAoB;AAAA,EAC3C;AAAA;AAAA;AAAA;AAAA,EAKA,IAAI,aAAsB;AACxB,WAAO,KAAK,SAAS,cAAc;AAAA,EACrC;AAAA;AAAA;AAAA;AAAA,EAKA,SAAS,OAAoB;AAC3B,SAAK,QAAQ,KAAK,KAAK;AAAA,EACzB;AAAA;AAAA;AAAA;AAAA,EAKA,UAAU,QAAuB;AAC/B,SAAK,QAAQ,KAAK,GAAG,MAAM;AAAA,EAC7B;AAAA;AAAA;AAAA;AAAA,EAKA,YAAqB;AACnB,WAAO,KAAK;AAAA,EACd;AAAA;AAAA;AAAA;AAAA,EAKA,IAAI,aAAqB;AACvB,WAAO,KAAK,QAAQ;AAAA,EACtB;AAAA;AAAA;AAAA;AAAA,EAKA,YAAqB;AACnB,WAAO,KAAK,QAAQ,SAAS;AAAA,EAC/B;AAAA;AAAA;AAAA;AAAA,EAKA,cAAoB;AAClB,SAAK,UAAU,CAAC;AAAA,EAClB;AACF;","names":[]}