```ts
/**
 * Audits a depot ticket for correctness.
 * @param ticket - The ticket to audit, expected format: two letters, a hyphen, four digits, a hyphen, and one check digit.
 * @returns "shape" if the ticket does not match the expected format,
 *          "check" if the ticket is formatted correctly but has an incorrect check digit,
 *          "ok" if the ticket is both formatted correctly and has the correct check digit.
 */
export function auditTicket(ticket: string): string {
  if (typeof ticket !== 'string') {
    throw new Error('Invalid input: expected a string');
  }

  const regex = /^[A-Z]{2}-\d{4}-\d$/;
  if (!regex.test(ticket)) {
    return 'shape';
  }

  const [letters, digits] = ticket.split('-').slice(0, -1);
  const checkDigit = parseInt(ticket.slice(-1), 10);

  let total = 0;
  for (let i = 0; i < letters.length; i++) {
    total += letters.charCodeAt(i) - 'A'.charCodeAt(0) + 1;
  }

  for (let i = 0; i < digits.length; i++) {
    total += parseInt(digits[i], 10) * (i + 1);
  }

  return checkDigit === total % 10 ? 'ok' : 'check';
}
```