```typescript
/**
 * Splits one line of CSV into its fields on commas.
 * 
 * A field wrapped in double quotes may contain commas, and a doubled quote inside such a field means one literal quote character;
 * the surrounding quotes are not part of the value. Fields that are not quoted are taken literally, including any surrounding spaces.
 * An empty line is one empty field.
 */
export function parseCsvLine(line: string): string[] {
    const result: string[] = [];
    let currentField: string | null = null;
    let inQuote: boolean = false;

    for (const char of line) {
        if (char === '"') {
            inQuote = !inQuote;
        } else if (!inQuote && char === ',') {
            if (currentField === null) {
                result.push('');
            } else {
                result.push(currentField);
                currentField = null;
            }
        } else if (!inQuote && char.match(/^[a-zA-Z0-9]+$/)) {
            if (currentField !== null) {
                throw new Error('Duplicate field in CSV line');
            }
            let field: string = '';
            while (true) {
                const nextChar = line[line.indexOf(char) + 1];
                if (!nextChar || !nextChar.match(/^[a-zA-Z0-9]+$/)) {
                    break;
                }
                field += nextChar;
                char = line[line.indexOf(char) + 1];
            }
            currentField = field;
        } else {
            const nextChar = line[line.indexOf(char) + 1];
            if (nextChar && !nextChar.match(/^[a-zA-Z0-9]+$/)) {
                throw new Error('Invalid CSV character');
            }
        }
    }

    if (currentField !== null) {
        throw new Error("Unbalanced quotes in CSV line");
    }

    return result;
}
```