Create a TypeScript web application that uses the Google Maps API to display a map centered on the user's location, allows users to place markers on the map, and saves the marker locations to a Firebase Realtime Database.
PLAINFORMAT
```typescript
// firebase-config.ts
export const firebaseConfig = {
  apiKey: "YOUR_API_KEY",
  authDomain: "YOUR_AUTH_DOMAIN",
  databaseURL: "YOUR_DATABASE_URL",
  projectId: "YOUR_PROJECT_ID",
  storageBucket: "YOUR_STORAGE_BUCKET",
  messagingSenderId: "YOUR_MESSAGING_SENDER_ID",
  appId: "YOUR_APP_ID"
};

// main.ts
import { firebaseConfig } from './firebase-config';
import * as firebase from 'firebase/app';
import 'firebase/database';

// Initialize Firebase
firebase.initializeApp(firebaseConfig);
const database = firebase.database();

let map: google.maps.Map;
let markers: google.maps.Marker[] = [];

function initMap(): void {
  if (navigator.geolocation) {
    navigator.geolocation.getCurrentPosition((position) => {
      const userLocation = {
        lat: position.coords.latitude,
        lng: position.coords.longitude
      };

      map = new google.maps.Map(document.getElementById('map') as HTMLElement, {
        center: userLocation,
        zoom: 15
      });

      map.addListener('click', (event) => {
        addMarker(event.latLng);
      });
    });
  } else {
    alert("Geolocation is not supported by this browser.");
  }
}

function addMarker(location: google.maps.LatLng): void {
  const marker = new google.maps.Marker({
    position: location,
    map: map
  });

  markers.push(marker);

  // Save the marker to Firebase
  database.ref('markers').push({
    lat: location.lat(),
    lng: location.lng()
  });
}

(window as any).initMap = initMap;
```

```html
<!-- index.html -->
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Google Maps with Firebase</title>
  <style>
    #map {
      height: 100%;
    }
    html, body {
      height: 100%;
      margin: 0;
      padding: 0;
    }
  </style>
</head>
<body>
  <div id="map"></div>
  <script src="https://maps.googleapis.com/maps/api/js?key=YOUR_API_KEY&callback=initMap" async defer></script>
  <script src="/path/to/your/bundle.js"></script>
</body>
</html>
```

```json
// tsconfig.json
{
  "compilerOptions": {
    "target": "es5",
    "module": "commonjs",
    "strict": true,
    "esModuleInterop": true,
    "forceConsistentCasingInFileNames": true
  }
}
```