-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8da6d1d
commit 5f1a907
Showing
16 changed files
with
165 additions
and
9 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
@file:JsModule("firebase/firestore") | ||
@file:JsNonModule | ||
@file:Suppress("unused") | ||
|
||
external interface CollectionReference : Query { | ||
var id: String | ||
var parent: DocumentReference? | ||
var path: String | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
interface DocumentData |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
@file:JsModule("firebase/firestore") | ||
@file:JsNonModule | ||
@file:Suppress("unused") | ||
|
||
/** | ||
* A DocumentReference refers to a document location in a Firestore database | ||
* and can be used to write, read, or listen to the location. | ||
* The document at the referenced location may or may not exist. | ||
*/ | ||
external class DocumentReference { | ||
/** | ||
* The Firestore instance the document is in. | ||
* This is useful for performing transactions, for example. | ||
*/ | ||
val firestore: Firestore | ||
|
||
/** | ||
* The document's identifier within its collection. | ||
*/ | ||
var id: String | ||
|
||
/** | ||
* The collection this DocumentReference belongs to. | ||
*/ | ||
var parent: CollectionReference | ||
|
||
/** | ||
* A string representing the path of the referenced document (relative to the root of the database). | ||
*/ | ||
var path: String | ||
|
||
/** | ||
* The type of this Firestore reference. | ||
*/ | ||
val type: String = definedExternally | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
@file:JsModule("firebase/firestore") | ||
@file:JsNonModule | ||
@file:Suppress("unused") | ||
|
||
open external class DocumentSnapshot { | ||
var id: String | ||
val metadata: SnapshotMetadata | ||
var ref: DocumentReference | ||
fun data(options: SnapshotOptions?): DocumentData? | ||
fun exists(): Boolean | ||
fun get(fieldPath: String, options: SnapshotOptions?): dynamic | ||
fun get(fieldPath: FieldPath, options: SnapshotOptions?): dynamic | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
@file:JsModule("firebase/firestore") | ||
@file:JsNonModule | ||
@file:Suppress("unused") | ||
|
||
external class FieldPath(vararg fieldNames: String) { | ||
fun isEqual(other: FieldPath): Boolean | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
@file:JsModule("firebase/firestore") | ||
@file:JsNonModule | ||
@file:Suppress("unused") | ||
|
||
external class Firestore { | ||
val app: FirebaseApp | ||
val type: String = definedExternally | ||
|
||
fun toJson(): dynamic | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
@file:JsModule("firebase/firestore") | ||
@file:JsNonModule | ||
@file:Suppress("unused") | ||
|
||
external interface Query { | ||
val firestore: Firestore | ||
val type: QueryType | ||
} |
7 changes: 7 additions & 0 deletions
7
firebase-firestore/src/jsMain/kotlin/QueryDocumentSnapshot.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
@file:JsModule("firebase/firestore") | ||
@file:JsNonModule | ||
@file:Suppress("unused") | ||
|
||
external class QueryDocumentSnapshot : DocumentSnapshot { | ||
fun data(options: SnapshotOptions): DocumentData | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
@file:JsModule("firebase/firestore") | ||
@file:JsNonModule | ||
@file:Suppress("unused") | ||
|
||
import seskar.js.JsValue | ||
import seskar.js.JsVirtual | ||
|
||
@Suppress("NESTED_CLASS_IN_EXTERNAL_INTERFACE") | ||
@JsVirtual | ||
sealed external interface QueryType { | ||
companion object { | ||
@JsValue("query") | ||
val query: QueryType | ||
|
||
@JsValue("collection") | ||
val collection: QueryType | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
@file:JsModule("firebase/firestore") | ||
@file:JsNonModule | ||
@file:Suppress("unused") | ||
|
||
import seskar.js.JsValue | ||
import seskar.js.JsVirtual | ||
|
||
|
||
@Suppress("NESTED_CLASS_IN_EXTERNAL_INTERFACE") | ||
@JsVirtual | ||
external interface ServerTimeStamps { | ||
companion object { | ||
@JsValue("estimate") | ||
val estimate: ServerTimeStamps | ||
|
||
@JsValue("previous") | ||
val previous: ServerTimeStamps | ||
|
||
@JsValue("none") | ||
val none: ServerTimeStamps | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
@file:JsModule("firebase/firestore") | ||
@file:JsNonModule | ||
@file:Suppress("unused") | ||
|
||
external class SnapshotMetadata { | ||
val fromCache: Boolean | ||
val hasPendingWrites: Boolean | ||
fun isEqual(other: SnapshotMetadata): Boolean | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
@file:JsModule("firebase/firestore") | ||
@file:JsNonModule | ||
@file:Suppress("unused") | ||
|
||
external interface SnapshotOptions { | ||
val serverTimestamps: ServerTimeStamps | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters