Skip to content

Commit 574e44e

Browse files
committed
public API adjustment
1 parent 33bc889 commit 574e44e

20 files changed

+392
-455
lines changed

Firestore/Swift/Source/ExprImpl.swift

Lines changed: 179 additions & 179 deletions
Large diffs are not rendered by default.

Firestore/Swift/Source/Helper/PipelineHelper.swift

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,12 @@
1313
// limitations under the License.
1414

1515
enum Helper {
16-
static func sendableToExpr(_ value: Sendable?) -> Expr {
16+
static func sendableToExpr(_ value: Sendable?) -> Expression {
1717
guard let value = value else {
1818
return Constant.nil
1919
}
2020

21-
if let exprValue = value as? Expr {
21+
if let exprValue = value as? Expression {
2222
return exprValue
2323
} else if let dictionaryValue = value as? [String: Sendable?] {
2424
return map(dictionaryValue)
@@ -31,8 +31,8 @@ enum Helper {
3131
}
3232
}
3333

34-
static func selectablesToMap(selectables: [Selectable]) -> [String: Expr] {
35-
let exprMap = selectables.reduce(into: [String: Expr]()) { result, selectable in
34+
static func selectablesToMap(selectables: [Selectable]) -> [String: Expression] {
35+
let exprMap = selectables.reduce(into: [String: Expression]()) { result, selectable in
3636
guard let value = selectable as? SelectableWrapper else {
3737
fatalError("Selectable class must conform to SelectableWrapper.")
3838
}
@@ -41,20 +41,20 @@ enum Helper {
4141
return exprMap
4242
}
4343

44-
static func map(_ elements: [String: Sendable?]) -> FunctionExpr {
45-
var result: [Expr] = []
44+
static func map(_ elements: [String: Sendable?]) -> FunctionExpression {
45+
var result: [Expression] = []
4646
for (key, value) in elements {
4747
result.append(Constant(key))
4848
result.append(sendableToExpr(value))
4949
}
50-
return FunctionExpr("map", result)
50+
return FunctionExpression("map", result)
5151
}
5252

53-
static func array(_ elements: [Sendable?]) -> FunctionExpr {
53+
static func array(_ elements: [Sendable?]) -> FunctionExpression {
5454
let transformedElements = elements.map { element in
5555
sendableToExpr(element)
5656
}
57-
return FunctionExpr("array", transformedElements)
57+
return FunctionExpression("array", transformedElements)
5858
}
5959

6060
// This function is used to convert Swift type into Objective-C type.
@@ -63,7 +63,7 @@ enum Helper {
6363
return Constant.nil.bridge
6464
}
6565

66-
if let exprValue = value as? Expr {
66+
if let exprValue = value as? Expression {
6767
return exprValue.toBridge()
6868
} else if let aggregateFunctionValue = value as? AggregateFunction {
6969
return aggregateFunctionValue.toBridge()

Firestore/Swift/Source/PipelineWrapper.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,5 +22,5 @@ protocol AggregateBridgeWrapper {
2222

2323
protocol SelectableWrapper: Sendable {
2424
var alias: String { get }
25-
var expr: Expr { get }
25+
var expr: Expression { get }
2626
}

Firestore/Swift/Source/SwiftAPI/Pipeline/Aggregation/AggregateFunction.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@ public class AggregateFunction: AggregateBridgeWrapper, @unchecked Sendable {
2222
let bridge: AggregateFunctionBridge
2323

2424
let functionName: String
25-
let args: [Expr]
25+
let args: [Expression]
2626

27-
public init(_ functionName: String, _ args: [Expr]) {
27+
public init(_ functionName: String, _ args: [Expression]) {
2828
self.functionName = functionName
2929
self.args = args
3030
bridge = AggregateFunctionBridge(
@@ -34,7 +34,7 @@ public class AggregateFunction: AggregateBridgeWrapper, @unchecked Sendable {
3434
)
3535
}
3636

37-
public func `as`(_ name: String) -> AggregateWithAlias {
38-
return AggregateWithAlias(aggregate: self, alias: name)
37+
public func `as`(_ name: String) -> AliasedAggregate {
38+
return AliasedAggregate(aggregate: self, alias: name)
3939
}
4040
}

Firestore/Swift/Source/SwiftAPI/Pipeline/Aggregation/AggregateWithAlias.swift renamed to Firestore/Swift/Source/SwiftAPI/Pipeline/Aggregation/AliasedAggregate.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414

15-
public struct AggregateWithAlias {
15+
public struct AliasedAggregate {
1616
public let aggregate: AggregateFunction
1717
public let alias: String
1818
}

Firestore/Swift/Source/SwiftAPI/Pipeline/ExprWithAlias.swift renamed to Firestore/Swift/Source/SwiftAPI/Pipeline/AliasedExpression.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,12 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414

15-
public struct ExprWithAlias: Selectable, SelectableWrapper, Sendable {
15+
public struct AliasedExpression: Selectable, SelectableWrapper, Sendable {
1616
public var alias: String
1717

18-
public var expr: Expr
18+
public var expr: Expression
1919

20-
init(_ expr: Expr, _ alias: String) {
20+
init(_ expr: Expression, _ alias: String) {
2121
self.alias = alias
2222
self.expr = expr
2323
}

0 commit comments

Comments
 (0)