```ts
/**
 * Counts the distinct ways to cover a grid two cells tall and width cells wide,
 * completely and without overlap, using one-by-two dominoes (laid upright or flat)
 * and two-by-two squares.
 * @param width - The width of the grid.
 * @returns The number of distinct coverings.
 */
export function countStripTilings(width: number): number {
  if (!Number.isInteger(width) || width < 0) {
    throw new Error("Width must be a non-negative integer.");
  }

  if (width === 0) return 1;
  if (width === 1) return 1;

  const dp = [1, 1];

  for (let i = 2; i <= width; i++) {
    dp[i] = dp[i - 1] + dp[i - 2] + 2 * (i - 1);
  }

  return dp[width];
}
```