Write a TypeScript function that accepts an array of objects representing employees (with properties like id, name, department, and salary) and calculates the average salary per department. Return the result as an object where keys are department names and values are the average salaries.

Here's a TypeScript function that calculates the average salary per department:

```typescript
interface Employee {
  id: number;
  name: string;
  department: string;
  salary: number;
}

function calculateAverageSalaryPerDepartment(employees: Employee[]): { [key: string]: number } {
  const departmentSums: { [key: string]: number } = {};
  const departmentCounts: { [key: string]: number } = {};

  for (const employee of employees) {
    if (!departmentSums[employee.department]) {
      departmentSums[employee.department] = 0;
      departmentCounts[employee.department] = 0;
    }
    departmentSums[employee.department] += employee.salary;
    departmentCounts[employee.department]++;
  }

  const departmentAverages: { [key: string]: number } = {};
  for (const department in departmentSums) {
    departmentAverages[department] = departmentSums[department] / departmentCounts[department];
  }

  return departmentAverages;
}
```

This function first initializes two objects, `departmentSums` and `departmentCounts`, to keep track of the total salaries and counts of employees in each department. It then iterates through the input array of employees, updating these two objects accordingly.

Finally, it creates a new object, `departmentAverages`, which stores the calculated average salary for each department by dividing the sum of salaries by the count of employees in that department. This final object is returned as the result.