diff --git a/src/domain/apple/plistScalars.ts b/src/domain/apple/plistScalars.ts index 3466c738e83..6f4d5a8b979 100644 --- a/src/domain/apple/plistScalars.ts +++ b/src/domain/apple/plistScalars.ts @@ -41,19 +41,27 @@ const containsSortedOffset = ( }; export interface BinaryPlistScalarDecodePlan { + /** Unique reachable date records in the selected value graph. */ readonly reachableDateOffsets: readonly number[]; + /** Precision-unknown date offsets requiring decoder-copy isolation. */ readonly overlappingDateOffsets: readonly number[]; + /** Unique reachable 16-byte integer records in the selected value graph. */ readonly reachableWideIntegerOffsets: readonly number[]; + /** Source offsets requiring isolated decoder-compatible scalar records. */ readonly overlappingWideIntegerOffsets: readonly number[]; + /** Reachable integer and real source records for exact number association. */ readonly reachableNumericOffsets: readonly number[]; - /** Reachable UID records whose encoded width plist@5 cannot read. */ + /** Reachable UID records cloned to one of plist@5's supported widths. */ readonly uidOffsetsToNormalize: readonly { offset: number; width: number }[]; + /** Validated container headers and references needed for decoder-copy normalization. */ readonly containersToNormalize?: readonly { readonly offset: number; readonly headerLength: number; readonly references: readonly number[]; }[]; + /** Decoder-supported width selected for the source offset table. */ readonly normalizedOffsetSize?: number; + /** Decoder-supported width selected for array and dictionary references. */ readonly normalizedReferenceSize?: number; } diff --git a/src/domain/apple/propertyListDecodeBudget.ts b/src/domain/apple/propertyListDecodeBudget.ts index fc67ad74559..4eee7b060d9 100644 --- a/src/domain/apple/propertyListDecodeBudget.ts +++ b/src/domain/apple/propertyListDecodeBudget.ts @@ -18,6 +18,7 @@ import { binaryDateRequiresExactSeconds, binaryPlistObjectEnd, binaryPlistUidNormalizationWidth, + type BinaryPlistScalarDecodePlan, } from "./plistScalars.js"; const DEFAULT_PLIST_DECODE_BUDGET = "the property list decode budget"; @@ -293,33 +294,11 @@ export interface BinaryPlistValuePlan { } /** Preflight size and binary-key observations; XML keys are inspected by decode. */ -export interface PlistDecodePreflight { +export interface PlistDecodePreflight extends Required { readonly binaryValuePlan?: BinaryPlistValuePlan; readonly estimatedBytes: number; /** Number of expanded references to precision-unknown overlapping dates. */ readonly datePrecisionOverlapCount: number; - /** Unique reachable date records in the selected value graph. */ - readonly reachableDateOffsets: readonly number[]; - /** Precision-unknown date offsets requiring decoder-copy isolation. */ - readonly overlappingDateOffsets: readonly number[]; - /** Unique reachable 16-byte integer records in the selected value graph. */ - readonly reachableWideIntegerOffsets: readonly number[]; - /** Source offsets requiring isolated decoder-compatible scalar records. */ - readonly overlappingWideIntegerOffsets: readonly number[]; - /** Reachable integer and real source records for exact number association. */ - readonly reachableNumericOffsets: readonly number[]; - /** Reachable UID records cloned to one of plist@5's supported widths. */ - readonly uidOffsetsToNormalize: readonly { offset: number; width: number }[]; - /** Validated container headers and references needed for decoder-copy normalization. */ - readonly containersToNormalize: readonly { - readonly offset: number; - readonly headerLength: number; - readonly references: readonly number[]; - }[]; - /** Decoder-supported width selected for the source offset table. */ - readonly normalizedOffsetSize: number; - /** Decoder-supported width selected for array and dictionary references. */ - readonly normalizedReferenceSize: number; } type BinaryObjectSpan = { readonly offset: number; readonly end: number };