/** * Asserts that the provided `projectId` conforms to Firestore / Google Cloud rules. * * @param projectId - The project ID to validate. * @returns The same `projectId` when valid (for fluent usage). * @throws {GoogleError} {@link Status.INTERNAL} when the project ID is invalid. */ export declare function assertValidProjectId(projectId: string): string; /** * Asserts that a (possibly optional) value with a `length` property is non-empty. * * If `required` is `false` and the value is `undefined`/`null`, no error is thrown. * * @param argName - Name of the argument (for error messages). * @param value - The value to check; must have a numeric `length` when present. * @param required - Whether the argument is required. * @throws {GoogleError} {@link Status.INVALID_ARGUMENT} when required and empty/missing. */ export declare function assertNotEmpty(argName: string, value: { length: number; } | undefined | null, required: boolean): void; /** * Asserts that a value is an instance of a constructor or satisfies a predicate. * * If `required` is `false` and the value is `undefined`/`null`, no error is thrown. * * @param argName - Name of the argument (for error messages). * @param typeName - Human-readable type name for error messaging. * @param value - The value to validate. * @param type - Either a constructor function (for `instanceof`) or a predicate `(value) => boolean`. * @param required - Whether the argument is required. * @throws {GoogleError} {@link Status.INVALID_ARGUMENT} when validation fails. */ export declare function assertInstanceOf(argName: string, typeName: string, value: unknown, type: (new (...args: unknown[]) => unknown) | ((value: unknown) => boolean), required: boolean): void; /** * Asserts that two arguments are mutually exclusive—i.e., not both specified. * * @param argName1 - Name of the first argument. * @param value1 - Value of the first argument. * @param argName2 - Name of the second argument. * @param value2 - Value of the second argument. * @throws {GoogleError} {@link Status.INVALID_ARGUMENT} when both are specified. */ export declare function assertMutuallyExclusive(argName1: string, value1: unknown, argName2: string, value2: unknown): void; /** * Asserts that at least one of two alternative arguments is provided. * * @param argName1 - Name of the first argument. * @param value1 - Value of the first argument. * @param argName2 - Name of the second argument. * @param value2 - Value of the second argument. * @throws {GoogleError} {@link Status.INVALID_ARGUMENT} when both are missing. */ export declare function assertEitherRequired(argName1: string, value1: unknown, argName2: string, value2: unknown): void; /** * Asserts that a request field is not supported in the mock and therefore must be absent. * * @param argName - Name of the unsupported request field. * @param value - The field value to check. * @throws {GoogleError} {@link Status.UNIMPLEMENTED} when the field is provided. */ export declare function assertRequestArgumentNotSupported(argName: string, value: unknown): void; /** * Asserts that a required request field is present and returns it. * * @typeParam T - The expected type of the value. * @param argName - Name of the required field. * @param value - The value to check. * @returns The value when present. * @throws {GoogleError} {@link Status.INVALID_ARGUMENT} when the field is missing. */ export declare function assertRequestArgument(argName: string, value: T | null | undefined): T; /** * Asserts that a required field *within a fieldFilter* is present and returns it. * This mirrors Firestore error messaging for malformed fieldFilter clauses. * * @typeParam T - The expected type of the value. * @param argName - Name of the missing sub-field (e.g., `"op"`, `"value"`, `"fieldPath"`). * @param value - The value to check. * @returns The value when present. * @throws {GoogleError} {@link Status.INVALID_ARGUMENT} when the sub-field is missing. */ export declare function assertFieldArgument(argName: string, value: T | null | undefined): T; //# sourceMappingURL=assert.d.ts.map