Skip to content

Instantly share code, notes, and snippets.

@c10r
Created April 3, 2021 00:41
Show Gist options
  • Save c10r/2bf24a7befdb2546ed47c8a2b835ebb5 to your computer and use it in GitHub Desktop.
Save c10r/2bf24a7befdb2546ed47c8a2b835ebb5 to your computer and use it in GitHub Desktop.
An example firebase wrapper
@JsModule("firebase")
@JsNonModule
external interface FirebaseConfig {
var apiKey: String
var authDomain: String
var databaseURL: String
var projectId: String
var storageBucket: String
var messagingSenderId: String
var appId: String
}
external interface Firebase {
fun initializeApp(jsObject: FirebaseConfig): FirebaseApp
}
external interface FirebaseApp {
fun firestore(): Firestore
}
external interface Firestore {
fun batch(): Any
fun collection(path: String): Any
fun doc(path: String): Any
}
@JsName("firebase")
external val firebase : Firebase
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment