```ts
function stampBuild(major: number, minor: number, patch: number): number {
  if (!Number.isInteger(major) || !Number.isInteger(minor) || !Number.isInteger(patch)) {
    throw new Error("All components must be whole numbers.");
  }
  if (major < 0 || minor < 0 || patch < 0) {
    throw new Error("Components cannot be negative.");
  }
  if (major === 1000 || minor === 1000 || patch === 1000) {
    throw new Error("Major, minor, or patch cannot be 1000 or more.");
  }

  return patch + 1000 * minor + 1000000 * major;
}
```