修改pods
This commit is contained in:
@@ -14,11 +14,13 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#import "FIRDocumentSnapshot+Internal.h"
|
||||
#import <FirebaseCore/FIRTimestamp.h>
|
||||
|
||||
#include <utility>
|
||||
#include <vector>
|
||||
|
||||
#import "FIRDocumentSnapshot+Internal.h"
|
||||
|
||||
#include "Firestore/core/src/util/warnings.h"
|
||||
|
||||
#import "Firestore/Source/API/FIRDocumentReference+Internal.h"
|
||||
@@ -26,7 +28,6 @@
|
||||
#import "Firestore/Source/API/FIRFirestore+Internal.h"
|
||||
#import "Firestore/Source/API/FIRGeoPoint+Internal.h"
|
||||
#import "Firestore/Source/API/FIRSnapshotMetadata+Internal.h"
|
||||
#import "Firestore/Source/API/FIRTimestamp+Internal.h"
|
||||
#import "Firestore/Source/API/FSTUserDataWriter.h"
|
||||
#import "Firestore/Source/API/converters.h"
|
||||
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
*/
|
||||
|
||||
#import "Firestore/Source/API/FIRFieldValue+Internal.h"
|
||||
#import "Firestore/Source/Public/FirebaseFirestore/FIRVectorValue.h"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@@ -176,6 +177,10 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
return [[FSTNumericIncrementFieldValue alloc] initWithOperand:@(l)];
|
||||
}
|
||||
|
||||
+ (nonnull FIRVectorValue *)vectorWithArray:(nonnull NSArray<NSNumber *> *)array {
|
||||
return [[FIRVectorValue alloc] initWithArray:array];
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
|
||||
@@ -1,152 +0,0 @@
|
||||
/*
|
||||
* Copyright 2017 Google
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#import "Firestore/Source/API/FIRTimestamp+Internal.h"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
static const int kNanosPerSecond = 1000000000;
|
||||
|
||||
@implementation FIRTimestamp (Internal)
|
||||
|
||||
#pragma mark - Internal public methods
|
||||
|
||||
- (NSString *)ISO8601String {
|
||||
NSDateFormatter *formatter = [[NSDateFormatter alloc] init];
|
||||
formatter.dateFormat = @"yyyy-MM-dd'T'HH:mm:ss";
|
||||
formatter.timeZone = [NSTimeZone timeZoneWithName:@"UTC"];
|
||||
NSDate *secondsDate = [NSDate dateWithTimeIntervalSince1970:self.seconds];
|
||||
NSString *secondsString = [formatter stringFromDate:secondsDate];
|
||||
if (secondsString.length != 19) {
|
||||
[NSException raise:@"Invalid ISO string" format:@"Invalid ISO string: %@", secondsString];
|
||||
}
|
||||
|
||||
NSString *nanosString = [NSString stringWithFormat:@"%09d", self.nanoseconds];
|
||||
return [NSString stringWithFormat:@"%@.%@Z", secondsString, nanosString];
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
@implementation FIRTimestamp
|
||||
|
||||
#pragma mark - Constructors
|
||||
|
||||
+ (instancetype)timestampWithDate:(NSDate *)date {
|
||||
double secondsDouble;
|
||||
double fraction = modf(date.timeIntervalSince1970, &secondsDouble);
|
||||
// GCP Timestamps always have non-negative nanos.
|
||||
if (fraction < 0) {
|
||||
fraction += 1.0;
|
||||
secondsDouble -= 1.0;
|
||||
}
|
||||
int64_t seconds = (int64_t)secondsDouble;
|
||||
int32_t nanos = (int32_t)(fraction * kNanosPerSecond);
|
||||
return [[FIRTimestamp alloc] initWithSeconds:seconds nanoseconds:nanos];
|
||||
}
|
||||
|
||||
+ (instancetype)timestampWithSeconds:(int64_t)seconds nanoseconds:(int32_t)nanoseconds {
|
||||
return [[FIRTimestamp alloc] initWithSeconds:seconds nanoseconds:nanoseconds];
|
||||
}
|
||||
|
||||
+ (instancetype)timestamp {
|
||||
return [FIRTimestamp timestampWithDate:[NSDate date]];
|
||||
}
|
||||
|
||||
- (instancetype)initWithSeconds:(int64_t)seconds nanoseconds:(int32_t)nanoseconds {
|
||||
self = [super init];
|
||||
if (self) {
|
||||
if (nanoseconds < 0) {
|
||||
[NSException raise:@"Invalid timestamp"
|
||||
format:@"Timestamp nanoseconds out of range: %d", nanoseconds];
|
||||
}
|
||||
if (nanoseconds >= 1e9) {
|
||||
[NSException raise:@"Invalid timestamp"
|
||||
format:@"Timestamp nanoseconds out of range: %d", nanoseconds];
|
||||
}
|
||||
// Midnight at the beginning of 1/1/1 is the earliest timestamp supported.
|
||||
if (seconds < -62135596800L) {
|
||||
[NSException raise:@"Invalid timestamp"
|
||||
format:@"Timestamp seconds out of range: %lld", seconds];
|
||||
}
|
||||
// This will break in the year 10,000.
|
||||
if (seconds >= 253402300800L) {
|
||||
[NSException raise:@"Invalid timestamp"
|
||||
format:@"Timestamp seconds out of range: %lld", seconds];
|
||||
}
|
||||
|
||||
_seconds = seconds;
|
||||
_nanoseconds = nanoseconds;
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
#pragma mark - NSObject methods
|
||||
|
||||
- (BOOL)isEqual:(id)object {
|
||||
if (self == object) {
|
||||
return YES;
|
||||
}
|
||||
if (![object isKindOfClass:[FIRTimestamp class]]) {
|
||||
return NO;
|
||||
}
|
||||
return [self isEqualToTimestamp:(FIRTimestamp *)object];
|
||||
}
|
||||
|
||||
- (NSUInteger)hash {
|
||||
return (NSUInteger)((self.seconds >> 32) ^ self.seconds ^ self.nanoseconds);
|
||||
}
|
||||
|
||||
- (NSString *)description {
|
||||
return [NSString stringWithFormat:@"<FIRTimestamp: seconds=%lld nanoseconds=%d>", self.seconds,
|
||||
self.nanoseconds];
|
||||
}
|
||||
|
||||
/** Implements NSCopying without actually copying because timestamps are immutable. */
|
||||
- (id)copyWithZone:(__unused NSZone *_Nullable)zone {
|
||||
return self;
|
||||
}
|
||||
|
||||
#pragma mark - Public methods
|
||||
|
||||
- (NSDate *)dateValue {
|
||||
NSTimeInterval interval = (NSTimeInterval)self.seconds + ((NSTimeInterval)self.nanoseconds) / 1e9;
|
||||
return [NSDate dateWithTimeIntervalSince1970:interval];
|
||||
}
|
||||
|
||||
- (NSComparisonResult)compare:(FIRTimestamp *)other {
|
||||
if (self.seconds < other.seconds) {
|
||||
return NSOrderedAscending;
|
||||
} else if (self.seconds > other.seconds) {
|
||||
return NSOrderedDescending;
|
||||
}
|
||||
|
||||
if (self.nanoseconds < other.nanoseconds) {
|
||||
return NSOrderedAscending;
|
||||
} else if (self.nanoseconds > other.nanoseconds) {
|
||||
return NSOrderedDescending;
|
||||
}
|
||||
return NSOrderedSame;
|
||||
}
|
||||
|
||||
#pragma mark - Private methods
|
||||
|
||||
- (BOOL)isEqualToTimestamp:(FIRTimestamp *)other {
|
||||
return [self compare:other] == NSOrderedSame;
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2018 Google
|
||||
* Copyright 2024 Google LLC
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -14,21 +14,34 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#import "FIRTimestamp.h"
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
#include "Firestore/Source/Public/FirebaseFirestore/FIRVectorValue.h"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
/** Internal FIRTimestamp API we don't want exposed in our public header files. */
|
||||
@interface FIRTimestamp (Internal)
|
||||
@implementation FIRVectorValue
|
||||
|
||||
/**
|
||||
* Converts the given date to an ISO 8601 timestamp string, useful for rendering in JSON.
|
||||
*
|
||||
* ISO 8601 dates times in UTC look like this: "1912-04-14T23:40:00.000000000Z".
|
||||
*
|
||||
* @see http://www.ecma-international.org/ecma-262/6.0/#sec-date-time-string-format
|
||||
*/
|
||||
- (NSString *)ISO8601String;
|
||||
- (instancetype)initWithArray:(NSArray<NSNumber *> *)array {
|
||||
if (self = [super init]) {
|
||||
_array = [array valueForKey:@"doubleValue"];
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
- (BOOL)isEqual:(nullable id)object {
|
||||
if (self == object) {
|
||||
return YES;
|
||||
}
|
||||
|
||||
if (![object isKindOfClass:[FIRVectorValue class]]) {
|
||||
return NO;
|
||||
}
|
||||
|
||||
FIRVectorValue *otherVector = ((FIRVectorValue *)object);
|
||||
|
||||
return [self.array isEqualToArray:otherVector.array];
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
@@ -22,14 +22,13 @@
|
||||
#include <string>
|
||||
#include <utility>
|
||||
|
||||
#import "FirebaseAuth/Interop/FIRAuthInterop.h"
|
||||
#import "FirebaseAuth/Interop/Public/FirebaseAuthInterop/FIRAuthInterop.h"
|
||||
#import "FirebaseCore/Extension/FIRAppInternal.h"
|
||||
#import "FirebaseCore/Extension/FIRComponent.h"
|
||||
#import "FirebaseCore/Extension/FIRComponentContainer.h"
|
||||
#import "FirebaseCore/Extension/FIRComponentType.h"
|
||||
#import "FirebaseCore/Extension/FIRDependency.h"
|
||||
#import "FirebaseCore/Extension/FIRLibrary.h"
|
||||
#import "FirebaseCore/Extension/FIROptionsInternal.h"
|
||||
#import "FirebaseCore/Sources/FIROptionsInternal.h"
|
||||
#import "Firestore/Source/API/FIRFirestore+Internal.h"
|
||||
|
||||
#include "Firestore/core/include/firebase/firestore/firestore_version.h"
|
||||
@@ -160,12 +159,9 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
#pragma mark - Interoperability
|
||||
|
||||
+ (NSArray<FIRComponent *> *)componentsToRegister {
|
||||
FIRDependency *auth = [FIRDependency dependencyWithProtocol:@protocol(FIRAuthInterop)
|
||||
isRequired:NO];
|
||||
FIRComponent *firestoreProvider = [FIRComponent
|
||||
componentWithProtocol:@protocol(FSTFirestoreMultiDBProvider)
|
||||
instantiationTiming:FIRInstantiationTimingLazy
|
||||
dependencies:@[ auth ]
|
||||
creationBlock:^id _Nullable(FIRComponentContainer *container, BOOL *isCacheable) {
|
||||
FSTFirestoreComponent *multiDBComponent =
|
||||
[[FSTFirestoreComponent alloc] initWithApp:container.app];
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#import "Firestore/Source/API/FSTUserDataReader.h"
|
||||
#import <FirebaseCore/FIRTimestamp.h>
|
||||
|
||||
#include <memory>
|
||||
#include <set>
|
||||
@@ -22,8 +22,10 @@
|
||||
#include <utility>
|
||||
#include <vector>
|
||||
|
||||
#import "Firestore/Source/API/FSTUserDataReader.h"
|
||||
|
||||
#import "FIRGeoPoint.h"
|
||||
#import "FIRTimestamp.h"
|
||||
#import "FIRVectorValue.h"
|
||||
|
||||
#import "Firestore/Source/API/FIRDocumentReference+Internal.h"
|
||||
#import "Firestore/Source/API/FIRFieldPath+Internal.h"
|
||||
@@ -340,6 +342,42 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
return std::move(result);
|
||||
}
|
||||
|
||||
- (Message<google_firestore_v1_Value>)parseVectorValue:(FIRVectorValue *)vectorValue
|
||||
context:(ParseContext &&)context {
|
||||
__block Message<google_firestore_v1_Value> result;
|
||||
result->which_value_type = google_firestore_v1_Value_map_value_tag;
|
||||
result->map_value = {};
|
||||
|
||||
result->map_value.fields_count = 2;
|
||||
result->map_value.fields = nanopb::MakeArray<google_firestore_v1_MapValue_FieldsEntry>(2);
|
||||
|
||||
result->map_value.fields[0].key = nanopb::CopyBytesArray(model::kTypeValueFieldKey);
|
||||
result->map_value.fields[0].value = *[self encodeStringValue:MakeString(@"__vector__")].release();
|
||||
|
||||
NSArray<NSNumber *> *vectorArray = vectorValue.array;
|
||||
|
||||
__block Message<google_firestore_v1_Value> arrayMessage;
|
||||
arrayMessage->which_value_type = google_firestore_v1_Value_array_value_tag;
|
||||
arrayMessage->array_value.values_count = CheckedSize([vectorArray count]);
|
||||
arrayMessage->array_value.values =
|
||||
nanopb::MakeArray<google_firestore_v1_Value>(arrayMessage->array_value.values_count);
|
||||
|
||||
[vectorArray enumerateObjectsUsingBlock:^(id entry, NSUInteger idx, BOOL *) {
|
||||
if (![entry isKindOfClass:[NSNumber class]]) {
|
||||
ThrowInvalidArgument("VectorValues must only contain numeric values.",
|
||||
context.FieldDescription());
|
||||
}
|
||||
|
||||
// Vector values must always use Double encoding
|
||||
arrayMessage->array_value.values[idx] = *[self encodeDouble:[entry doubleValue]].release();
|
||||
}];
|
||||
|
||||
result->map_value.fields[1].key = nanopb::CopyBytesArray(model::kVectorValueFieldKey);
|
||||
result->map_value.fields[1].value = *arrayMessage.release();
|
||||
|
||||
return std::move(result);
|
||||
}
|
||||
|
||||
- (Message<google_firestore_v1_Value>)parseArray:(NSArray<id> *)array
|
||||
context:(ParseContext &&)context {
|
||||
__block Message<google_firestore_v1_Value> result;
|
||||
@@ -528,7 +566,9 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
_databaseID.database_id(), context.FieldDescription());
|
||||
}
|
||||
return [self encodeReference:_databaseID key:reference.key];
|
||||
|
||||
} else if ([input isKindOfClass:[FIRVectorValue class]]) {
|
||||
FIRVectorValue *vector = input;
|
||||
return [self parseVectorValue:vector context:std::move(context)];
|
||||
} else {
|
||||
ThrowInvalidArgument("Unsupported type: %s%s", NSStringFromClass([input class]),
|
||||
context.FieldDescription());
|
||||
|
||||
@@ -21,6 +21,7 @@
|
||||
|
||||
#include "Firestore/Protos/nanopb/google/firestore/v1/document.nanopb.h"
|
||||
#include "Firestore/Source/API/FIRDocumentReference+Internal.h"
|
||||
#include "Firestore/Source/API/FIRFieldValue+Internal.h"
|
||||
#include "Firestore/Source/API/converters.h"
|
||||
#include "Firestore/core/include/firebase/firestore/geo_point.h"
|
||||
#include "Firestore/core/include/firebase/firestore/timestamp.h"
|
||||
@@ -105,6 +106,8 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
case TypeOrder::kGeoPoint:
|
||||
return MakeFIRGeoPoint(
|
||||
GeoPoint(value.geo_point_value.latitude, value.geo_point_value.longitude));
|
||||
case TypeOrder::kVector:
|
||||
return [self convertedVector:value.map_value];
|
||||
case TypeOrder::kMaxValue:
|
||||
// It is not possible for users to construct a kMaxValue manually.
|
||||
break;
|
||||
@@ -123,6 +126,18 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
return result;
|
||||
}
|
||||
|
||||
- (FIRVectorValue *)convertedVector:(const google_firestore_v1_MapValue &)mapValue {
|
||||
for (pb_size_t i = 0; i < mapValue.fields_count; ++i) {
|
||||
absl::string_view key = MakeStringView(mapValue.fields[i].key);
|
||||
const google_firestore_v1_Value &value = mapValue.fields[i].value;
|
||||
if ((0 == key.compare(absl::string_view("value"))) &&
|
||||
value.which_value_type == google_firestore_v1_Value_array_value_tag) {
|
||||
return [FIRFieldValue vectorWithArray:[self convertedArray:value.array_value]];
|
||||
}
|
||||
}
|
||||
return [FIRFieldValue vectorWithArray:@[]];
|
||||
}
|
||||
|
||||
- (NSArray<id> *)convertedArray:(const google_firestore_v1_ArrayValue &)arrayValue {
|
||||
NSMutableArray *result = [NSMutableArray arrayWithCapacity:arrayValue.values_count];
|
||||
for (pb_size_t i = 0; i < arrayValue.values_count; ++i) {
|
||||
|
||||
@@ -14,12 +14,13 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include "Firestore/Source/API/converters.h"
|
||||
#import <FirebaseCore/FIRTimestamp.h>
|
||||
|
||||
#include <utility>
|
||||
|
||||
#include "Firestore/Source/API/converters.h"
|
||||
|
||||
#import "FIRGeoPoint.h"
|
||||
#import "FIRTimestamp.h"
|
||||
|
||||
#include "Firestore/Source/API/FIRDocumentReference+Internal.h"
|
||||
#include "Firestore/core/include/firebase/firestore/geo_point.h"
|
||||
|
||||
@@ -23,6 +23,7 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
/**
|
||||
* Represents an aggregation that can be performed by Firestore.
|
||||
*/
|
||||
NS_SWIFT_SENDABLE
|
||||
NS_SWIFT_NAME(AggregateField)
|
||||
@interface FIRAggregateField : NSObject
|
||||
|
||||
|
||||
@@ -26,6 +26,7 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
/**
|
||||
* A query that calculates aggregations over an underlying query.
|
||||
*/
|
||||
NS_SWIFT_SENDABLE
|
||||
NS_SWIFT_NAME(AggregateQuery)
|
||||
@interface FIRAggregateQuery : NSObject
|
||||
|
||||
|
||||
@@ -24,6 +24,7 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
/**
|
||||
* The results of executing an `AggregateQuery`.
|
||||
*/
|
||||
NS_SWIFT_SENDABLE
|
||||
NS_SWIFT_NAME(AggregateQuerySnapshot)
|
||||
@interface FIRAggregateQuerySnapshot : NSObject
|
||||
|
||||
|
||||
@@ -26,6 +26,7 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
* A `CollectionReference` object can be used for adding documents, getting document references,
|
||||
* and querying for documents (using the methods inherited from `Query`).
|
||||
*/
|
||||
NS_SWIFT_SENDABLE
|
||||
NS_SWIFT_NAME(CollectionReference)
|
||||
@interface FIRCollectionReference : FIRQuery
|
||||
|
||||
|
||||
@@ -43,6 +43,7 @@ typedef NS_ENUM(NSInteger, FIRDocumentChangeType)
|
||||
* A `DocumentChange` represents a change to the documents matching a query. It contains the
|
||||
* document affected and the type of change that occurred (added, modified, or removed).
|
||||
*/
|
||||
NS_SWIFT_SENDABLE
|
||||
NS_SWIFT_NAME(DocumentChange)
|
||||
@interface FIRDocumentChange : NSObject
|
||||
|
||||
|
||||
@@ -39,6 +39,7 @@ typedef void (^FIRDocumentSnapshotBlock)(FIRDocumentSnapshot *_Nullable snapshot
|
||||
* may or may not exist. A `DocumentReference` can also be used to create a `CollectionReference` to
|
||||
* a subcollection.
|
||||
*/
|
||||
NS_SWIFT_SENDABLE
|
||||
NS_SWIFT_NAME(DocumentReference)
|
||||
@interface FIRDocumentReference : NSObject
|
||||
|
||||
|
||||
@@ -55,6 +55,7 @@ typedef NS_ENUM(NSInteger, FIRServerTimestampBehavior) {
|
||||
* For a `DocumentSnapshot` that points to a non-existing document, any data access will return
|
||||
* `nil`. You can use the `exists` property to explicitly verify a documents existence.
|
||||
*/
|
||||
NS_SWIFT_SENDABLE
|
||||
NS_SWIFT_NAME(DocumentSnapshot)
|
||||
@interface FIRDocumentSnapshot : NSObject
|
||||
|
||||
|
||||
@@ -23,6 +23,7 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
* (referring to a top level field in the document), or a list of field names (referring to a nested
|
||||
* field in the document).
|
||||
*/
|
||||
NS_SWIFT_SENDABLE
|
||||
NS_SWIFT_NAME(FieldPath)
|
||||
@interface FIRFieldPath : NSObject <NSCopying>
|
||||
|
||||
|
||||
@@ -17,10 +17,12 @@
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
@class FIRVectorValue;
|
||||
|
||||
/**
|
||||
* Sentinel values that can be used when writing document fields with `setData()` or `updateData()`.
|
||||
*/
|
||||
NS_SWIFT_SENDABLE
|
||||
NS_SWIFT_NAME(FieldValue)
|
||||
@interface FIRFieldValue : NSObject
|
||||
|
||||
@@ -90,6 +92,14 @@ NS_SWIFT_NAME(FieldValue)
|
||||
*/
|
||||
+ (instancetype)fieldValueForIntegerIncrement:(int64_t)l NS_SWIFT_NAME(increment(_:));
|
||||
|
||||
/**
|
||||
* Creates a new `VectorValue` constructed with a copy of the given array of NSNumbers.
|
||||
*
|
||||
* @param array Create a `VectorValue` instance with a copy of this array of NSNumbers.
|
||||
* @return A new `VectorValue` constructed with a copy of the given array of NSNumbers.
|
||||
*/
|
||||
+ (FIRVectorValue *)vectorWithArray:(NSArray<NSNumber *> *)array NS_REFINED_FOR_SWIFT;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
|
||||
@@ -24,6 +24,7 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
* A Filter represents a restriction on one or more field values and can be used to refine
|
||||
* the results of a Query.
|
||||
*/
|
||||
NS_SWIFT_SENDABLE
|
||||
NS_SWIFT_NAME(Filter)
|
||||
@interface FIRFilter : NSObject
|
||||
|
||||
|
||||
@@ -25,6 +25,7 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
* Latitude values are in the range of [-90, 90].
|
||||
* Longitude values are in the range of [-180, 180].
|
||||
*/
|
||||
NS_SWIFT_SENDABLE
|
||||
NS_SWIFT_NAME(GeoPoint)
|
||||
@interface FIRGeoPoint : NSObject <NSCopying>
|
||||
|
||||
|
||||
@@ -36,6 +36,7 @@ typedef NS_ENUM(NSInteger, FIRLoadBundleTaskState) {
|
||||
|
||||
/** Represents a progress update or a final state from loading bundles. */
|
||||
NS_SWIFT_NAME(LoadBundleTaskProgress)
|
||||
NS_SWIFT_SENDABLE
|
||||
@interface FIRLoadBundleTaskProgress : NSObject
|
||||
|
||||
/** How many documents have been loaded. */
|
||||
|
||||
@@ -44,14 +44,14 @@ NS_SWIFT_NAME(PersistentCacheSettings)
|
||||
/**
|
||||
* Creates `PersistentCacheSettings` with default cache size: 100MB.
|
||||
*
|
||||
* The cache size is not a hard limit, but a target for the SDK's gabarge collector to work towards.
|
||||
* The cache size is not a hard limit, but a target for the SDK's garbage collector to work towards.
|
||||
*/
|
||||
- (instancetype)init;
|
||||
|
||||
/**
|
||||
* Creates `PersistentCacheSettings` with a custom cache size in bytes.
|
||||
*
|
||||
* The cache size is not a hard limit, but a target for the SDK's gabarge collector to work towards.
|
||||
* The cache size is not a hard limit, but a target for the SDK's garbage collector to work towards.
|
||||
*/
|
||||
- (instancetype)initWithSizeBytes:(NSNumber *)size;
|
||||
|
||||
@@ -132,7 +132,7 @@ NS_SWIFT_NAME(MemoryCacheSettings)
|
||||
|
||||
/**
|
||||
* Creates an instance of `MemoryCacheSettings` with given `MemoryGarbageCollectorSettings` to
|
||||
* custom the gabarge collector.
|
||||
* custom the garbage collector.
|
||||
*/
|
||||
- (instancetype)initWithGarbageCollectorSettings:
|
||||
(id<FIRMemoryGarbageCollectorSettings, NSObject>)settings;
|
||||
|
||||
@@ -41,6 +41,7 @@ typedef void (^FIRQuerySnapshotBlock)(FIRQuerySnapshot *_Nullable snapshot,
|
||||
* A `Query` refers to a query which you can read or listen to. You can also construct
|
||||
* refined `Query` objects by adding filters and ordering.
|
||||
*/
|
||||
NS_SWIFT_SENDABLE
|
||||
NS_SWIFT_NAME(Query)
|
||||
@interface FIRQuery : NSObject
|
||||
/** :nodoc: */
|
||||
|
||||
@@ -28,6 +28,7 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
* using the `documents` property and its size can be inspected with `isEmpty` and
|
||||
* `count`.
|
||||
*/
|
||||
NS_SWIFT_SENDABLE
|
||||
NS_SWIFT_NAME(QuerySnapshot)
|
||||
@interface FIRQuerySnapshot : NSObject
|
||||
|
||||
|
||||
@@ -44,6 +44,7 @@ typedef NS_ENUM(NSUInteger, FIRListenSource) {
|
||||
* of this class control settings like whether metadata-only changes trigger events and the
|
||||
* preferred data source.
|
||||
*/
|
||||
NS_SWIFT_SENDABLE
|
||||
NS_SWIFT_NAME(SnapshotListenOptions)
|
||||
@interface FIRSnapshotListenOptions : NSObject
|
||||
|
||||
@@ -61,7 +62,7 @@ NS_SWIFT_NAME(SnapshotListenOptions)
|
||||
- (instancetype)init NS_DESIGNATED_INITIALIZER;
|
||||
|
||||
/**
|
||||
* Creates and returns a new `SnapshotListenOptions` object with with all properties of the current
|
||||
* Creates and returns a new `SnapshotListenOptions` object with all properties of the current
|
||||
* `SnapshotListenOptions` object plus the new property specifying whether metadata-only changes
|
||||
* should trigger snapshot events
|
||||
*
|
||||
@@ -70,7 +71,7 @@ NS_SWIFT_NAME(SnapshotListenOptions)
|
||||
- (FIRSnapshotListenOptions *)optionsWithIncludeMetadataChanges:(BOOL)includeMetadataChanges;
|
||||
|
||||
/**
|
||||
* Creates and returns a new `SnapshotListenOptions` object with with all properties of the current
|
||||
* Creates and returns a new `SnapshotListenOptions` object with all properties of the current
|
||||
* `SnapshotListenOptions` object plus the new property specifying the source that the snapshot
|
||||
* listener listens to.
|
||||
*
|
||||
|
||||
@@ -19,6 +19,7 @@
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
/** Metadata about a snapshot, describing the state of the snapshot. */
|
||||
NS_SWIFT_SENDABLE
|
||||
NS_SWIFT_NAME(SnapshotMetadata)
|
||||
@interface FIRSnapshotMetadata : NSObject
|
||||
|
||||
|
||||
@@ -1,89 +0,0 @@
|
||||
/*
|
||||
* Copyright 2018 Google
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
/**
|
||||
* A Timestamp represents a point in time independent of any time zone or calendar, represented as
|
||||
* seconds and fractions of seconds at nanosecond resolution in UTC Epoch time. It is encoded using
|
||||
* the Proleptic Gregorian Calendar which extends the Gregorian calendar backwards to year one. It
|
||||
* is encoded assuming all minutes are 60 seconds long, i.e. leap seconds are "smeared" so that no
|
||||
* leap second table is needed for interpretation. Range is from 0001-01-01T00:00:00Z to
|
||||
* 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to
|
||||
* and from RFC 3339 date strings.
|
||||
*
|
||||
* @see https://github.com/google/protobuf/blob/main/src/google/protobuf/timestamp.proto for the
|
||||
* reference timestamp definition.
|
||||
*/
|
||||
NS_SWIFT_NAME(Timestamp)
|
||||
@interface FIRTimestamp : NSObject <NSCopying>
|
||||
|
||||
/** :nodoc: */
|
||||
- (instancetype)init NS_UNAVAILABLE;
|
||||
|
||||
/**
|
||||
* Creates a new timestamp.
|
||||
*
|
||||
* @param seconds the number of seconds since epoch.
|
||||
* @param nanoseconds the number of nanoseconds after the seconds.
|
||||
*/
|
||||
- (instancetype)initWithSeconds:(int64_t)seconds
|
||||
nanoseconds:(int32_t)nanoseconds NS_DESIGNATED_INITIALIZER;
|
||||
|
||||
/**
|
||||
* Creates a new timestamp.
|
||||
*
|
||||
* @param seconds the number of seconds since epoch.
|
||||
* @param nanoseconds the number of nanoseconds after the seconds.
|
||||
*/
|
||||
+ (instancetype)timestampWithSeconds:(int64_t)seconds nanoseconds:(int32_t)nanoseconds;
|
||||
|
||||
/** Creates a new timestamp from the given date. */
|
||||
+ (instancetype)timestampWithDate:(NSDate *)date;
|
||||
|
||||
/** Creates a new timestamp with the current date / time. */
|
||||
+ (instancetype)timestamp;
|
||||
|
||||
/** Returns a new `Date` corresponding to this timestamp. This may lose precision. */
|
||||
- (NSDate *)dateValue;
|
||||
|
||||
/**
|
||||
* Returns the result of comparing the receiver with another timestamp.
|
||||
* @param other the other timestamp to compare.
|
||||
* @return `orderedAscending` if `other` is chronologically following self,
|
||||
* `orderedDescending` if `other` is chronologically preceding self,
|
||||
* `orderedSame` otherwise.
|
||||
*/
|
||||
- (NSComparisonResult)compare:(FIRTimestamp *)other;
|
||||
|
||||
/**
|
||||
* Represents seconds of UTC time since Unix epoch 1970-01-01T00:00:00Z.
|
||||
* Must be from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59Z inclusive.
|
||||
*/
|
||||
@property(nonatomic, assign, readonly) int64_t seconds;
|
||||
|
||||
/**
|
||||
* Non-negative fractions of a second at nanosecond resolution. Negative second values with
|
||||
* fractions must still have non-negative nanos values that count forward in time.
|
||||
* Must be from 0 to 999,999,999 inclusive.
|
||||
*/
|
||||
@property(nonatomic, assign, readonly) int32_t nanoseconds;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
42
Pods/FirebaseFirestoreInternal/Firestore/Source/Public/FirebaseFirestore/FIRVectorValue.h
generated
Normal file
42
Pods/FirebaseFirestoreInternal/Firestore/Source/Public/FirebaseFirestore/FIRVectorValue.h
generated
Normal file
@@ -0,0 +1,42 @@
|
||||
/*
|
||||
* Copyright 2024 Google LLC
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
/**
|
||||
* Represents a vector type in Firestore documents.
|
||||
*/
|
||||
NS_SWIFT_SENDABLE
|
||||
NS_SWIFT_NAME(VectorValue)
|
||||
@interface FIRVectorValue : NSObject
|
||||
|
||||
/** Returns a copy of the raw number array that represents the vector. */
|
||||
@property(atomic, readonly) NSArray<NSNumber *> *array NS_REFINED_FOR_SWIFT;
|
||||
|
||||
/** :nodoc: */
|
||||
- (instancetype)init NS_UNAVAILABLE;
|
||||
|
||||
/**
|
||||
* Creates a `VectorValue` constructed with a copy of the given array of NSNumbrers.
|
||||
* @param array An array of NSNumbers that represents a vector.
|
||||
*/
|
||||
- (instancetype)initWithArray:(NSArray<NSNumber *> *)array NS_REFINED_FOR_SWIFT;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
@@ -36,7 +36,6 @@
|
||||
#import "FIRQuerySnapshot.h"
|
||||
#import "FIRSnapshotListenOptions.h"
|
||||
#import "FIRSnapshotMetadata.h"
|
||||
#import "FIRTimestamp.h"
|
||||
#import "FIRTransaction.h"
|
||||
#import "FIRTransactionOptions.h"
|
||||
#import "FIRWriteBatch.h"
|
||||
|
||||
Reference in New Issue
Block a user