| 1 |
import type { MessageShape } from "./types.js"; |
| 2 |
import { type DescMessage } from "./descriptors.js"; |
| 3 |
import type { Registry } from "./registry.js"; |
| 4 |
interface EqualsOptions { |
| 5 |
/** |
| 6 |
* A registry to look up extensions, and messages packed in Any. |
| 7 |
* |
| 8 |
* @private Experimental API, does not follow semantic versioning. |
| 9 |
*/ |
| 10 |
registry: Registry; |
| 11 |
/** |
| 12 |
* Unpack google.protobuf.Any before comparing. |
| 13 |
* If a type is not in the registry, comparison falls back to comparing the |
| 14 |
* fields of Any. |
| 15 |
* |
| 16 |
* @private Experimental API, does not follow semantic versioning. |
| 17 |
*/ |
| 18 |
unpackAny?: boolean; |
| 19 |
/** |
| 20 |
* Consider extensions when comparing. |
| 21 |
* |
| 22 |
* @private Experimental API, does not follow semantic versioning. |
| 23 |
*/ |
| 24 |
extensions?: boolean; |
| 25 |
/** |
| 26 |
* Consider unknown fields when comparing. |
| 27 |
* The registry is used to distinguish between extensions, and unknown fields |
| 28 |
* caused by schema changes. |
| 29 |
* |
| 30 |
* @private Experimental API, does not follow semantic versioning. |
| 31 |
*/ |
| 32 |
unknown?: boolean; |
| 33 |
} |
| 34 |
/** |
| 35 |
* Compare two messages of the same type for equality. |
| 36 |
* |
| 37 |
* Fields are compared one by one, but only when set: a field set in one message |
| 38 |
* but not the other makes them unequal, while fields set in both are compared |
| 39 |
* by value. Extensions and unknown fields are disregarded by default. |
| 40 |
* |
| 41 |
* Float and double values are compared with IEEE semantics: NaN does not equal |
| 42 |
* NaN, and -0 equals 0 (with the exception for singular fields with implicit |
| 43 |
* presence: -0 is set, +0 is unset). |
| 44 |
*/ |
| 45 |
export declare function equals<Desc extends DescMessage>(schema: Desc, a: MessageShape<Desc>, b: MessageShape<Desc>, options?: EqualsOptions): boolean; |
| 46 |
export {}; |