-- Division of index intervals in sequences a and b at the middle change.
-- Invariant: intervals do not have common items at the start or end.

type Division = {
	-- The end of interval preceding division is open like array slice method.
	nChangePreceding: number, -- number of change items
	aEndPreceding: number,
	bEndPreceding: number,

	nCommonPreceding: number, -- 0 if no common items preceding middle change
	aCommonPreceding: number, -- ignore prop value if nCommonPreceding === 0
	bCommonPreceding: number, -- ignore prop value if nCommonPreceding === 0

	nCommonFollowing: number, -- 0 if no common items following middle change
	aCommonFollowing: number, -- ignore prop value if nCommonFollowing === 0
	bCommonFollowing: number, -- ignore prop value if nCommonFollowing === 0

	-- The start of interval following division is closed like array slice method.
	nChangeFollowing: number, -- number of change items
	aStartFollowing: number,
	bStartFollowing: number,
}

local pkg = "diff-sequences" -- for error messages
local NOT_YET_SET = 0 -- small int instead of undefined to avoid deopt in V8
