@@ -2566,8 +2566,8 @@ export function countIf(booleanExpr: BooleanExpr): AggregateFunction {
25662566
25672567/**
25682568 * @beta
2569- * Creates an expression that return a pseudo-random value of type double in the
2570- * range of [0, 1), inclusive of 0 and exclusive of 1.
2569+ * Creates an expression that return a pseudo-random number of type double in
2570+ * the range of [0, 1), inclusive of 0 and exclusive of 1.
25712571 *
25722572 * @returns A new `Expr` representing the 'rand' function.
25732573 */
@@ -3786,6 +3786,7 @@ export function mod(fieldName: string, expression: Expr): FunctionExpr;
37863786 * @param value The divisor constant.
37873787 * @return A new {@code Expr} representing the modulo operation.
37883788 */
3789+ // TODO: Should we only accept number constants on arithmetic operations? (including others)
37893790export function mod ( fieldName : string , value : unknown ) : FunctionExpr ;
37903791export function mod ( left : Expr | string , right : Expr | unknown ) : FunctionExpr {
37913792 const normalizedLeft = typeof left === 'string' ? field ( left ) : left ;
@@ -5033,14 +5034,14 @@ export function reverse(stringExpression: Expr): FunctionExpr;
50335034/**
50345035 * @beta
50355036 *
5036- * Creates an expression that reverses a string value in the specified field.
5037+ * Creates an expression that reverses a string value from the specified field.
50375038 *
50385039 * ```typescript
50395040 * // Reverse the value of the 'myString' field.
50405041 * reverse("myString");
50415042 * ```
50425043 *
5043- * @param field The name of the field representing the string to reverse.
5044+ * @param field The name of the field that contains the string to reverse.
50445045 * @return A new {@code Expr} representing the reversed string.
50455046 */
50465047export function reverse ( field : string ) : FunctionExpr ;
@@ -5058,13 +5059,13 @@ export function reverse(expr: Expr | string): FunctionExpr {
50585059 * replaceFirst(field("message"), "hello", "hi");
50595060 * ```
50605061 *
5061- * @param value The expression representing the string to perform the replacement on.
5062+ * @param stringExpression The expression representing the string to perform the replacement on.
50625063 * @param find The substring to search for.
5063- * @param replace The substring to replace the first occurrence of 'find' with .
5064+ * @param replace The replacement for the first occurrence of 'find'.
50645065 * @return A new {@code Expr} representing the string with the first occurrence replaced.
50655066 */
50665067export function replaceFirst (
5067- value : Expr ,
5068+ stringExpression : Expr ,
50685069 find : string ,
50695070 replace : string
50705071) : FunctionExpr ;
@@ -5080,21 +5081,21 @@ export function replaceFirst(
50805081 * replaceFirst(field("message"), field("findField"), field("replaceField"));
50815082 * ```
50825083 *
5083- * @param value The expression representing the string to perform the replacement on.
5084+ * @param stringExpression The expression representing the string to perform the replacement on.
50845085 * @param find The expression representing the substring to search for.
5085- * @param replace The expression representing the substring to replace the first occurrence of 'find' with .
5086+ * @param replace The expression representing the replacement for first occurrence of 'find'.
50865087 * @return A new {@code Expr} representing the string with the first occurrence replaced.
50875088 */
50885089export function replaceFirst (
5089- value : Expr ,
5090+ stringExpression : Expr ,
50905091 find : Expr ,
50915092 replace : Expr
50925093) : FunctionExpr ;
50935094
50945095/**
50955096 * @beta
50965097 *
5097- * Creates an expression that replaces the first occurrence of a substring within a string represented by a field with another substring .
5098+ * Creates an expression that replaces the first occurrence of a substring within the specified string field.
50985099 *
50995100 * ```typescript
51005101 * // Replace the first occurrence of "hello" with "hi" in the 'message' field.
@@ -5103,7 +5104,7 @@ export function replaceFirst(
51035104 *
51045105 * @param fieldName The name of the field representing the string to perform the replacement on.
51055106 * @param find The substring to search for.
5106- * @param replace The substring to replace the first occurrence of 'find' with .
5107+ * @param replace The replacement for the first occurrence of 'find'.
51075108 * @return A new {@code Expr} representing the string with the first occurrence replaced.
51085109 */
51095110export function replaceFirst (
@@ -5132,13 +5133,13 @@ export function replaceFirst(
51325133 * replaceAll(field("message"), "hello", "hi");
51335134 * ```
51345135 *
5135- * @param value The expression representing the string to perform the replacement on.
5136+ * @param stringExpression The expression representing the string to perform the replacement on.
51365137 * @param find The substring to search for.
51375138 * @param replace The substring to replace all occurrences of 'find' with.
51385139 * @return A new {@code Expr} representing the string with all occurrences replaced.
51395140 */
51405141export function replaceAll (
5141- value : Expr ,
5142+ stringExpression : Expr ,
51425143 find : string ,
51435144 replace : string
51445145) : FunctionExpr ;
@@ -5154,13 +5155,13 @@ export function replaceAll(
51545155 * replaceAll(field("message"), field("findField"), field("replaceField"));
51555156 * ```
51565157 *
5157- * @param value The expression representing the string to perform the replacement on.
5158+ * @param stringExpression The expression representing the string to perform the replacement on.
51585159 * @param find The expression representing the substring to search for.
51595160 * @param replace The expression representing the substring to replace all occurrences of 'find' with.
51605161 * @return A new {@code Expr} representing the string with all occurrences replaced.
51615162 */
51625163export function replaceAll (
5163- value : Expr ,
5164+ stringExpression : Expr ,
51645165 find : Expr ,
51655166 replace : Expr
51665167) : FunctionExpr ;
@@ -5432,7 +5433,7 @@ export function regexContains(
54325433 *
54335434 * @param fieldName The name of the field containing the string.
54345435 * @param pattern The regular expression to use for the match.
5435- * @return A new {@code Expr} representing the regular expression match.
5436+ * @return A new {@code Expr} representing the regular expression match comparison .
54365437 */
54375438export function regexMatch ( fieldName : string , pattern : string ) : BooleanExpr ;
54385439
@@ -5448,7 +5449,7 @@ export function regexMatch(fieldName: string, pattern: string): BooleanExpr;
54485449 *
54495450 * @param fieldName The name of the field containing the string.
54505451 * @param pattern The regular expression to use for the match.
5451- * @return A new {@code Expr} representing the regular expression match.
5452+ * @return A new {@code Expr} representing the regular expression match comparison .
54525453 */
54535454export function regexMatch ( fieldName : string , pattern : Expr ) : BooleanExpr ;
54545455
@@ -5465,7 +5466,7 @@ export function regexMatch(fieldName: string, pattern: Expr): BooleanExpr;
54655466 *
54665467 * @param stringExpression The expression representing the string to match against.
54675468 * @param pattern The regular expression to use for the match.
5468- * @return A new {@code Expr} representing the regular expression match.
5469+ * @return A new {@code Expr} representing the regular expression match comparison .
54695470 */
54705471export function regexMatch (
54715472 stringExpression : Expr ,
@@ -5485,7 +5486,7 @@ export function regexMatch(
54855486 *
54865487 * @param stringExpression The expression representing the string to match against.
54875488 * @param pattern The regular expression to use for the match.
5488- * @return A new {@code Expr} representing the regular expression match.
5489+ * @return A new {@code Expr} representing the regular expression match comparison .
54895490 */
54905491export function regexMatch ( stringExpression : Expr , pattern : Expr ) : BooleanExpr ;
54915492export function regexMatch (
0 commit comments