/** * @summary Add a custom datatype to EJSON. * @locus Anywhere * @param {String} name A tag for your custom type; must be unique among * custom data types defined in your project, and must * match the result of your type's `typeName` method. * @param {Function} factory A function that deserializes a JSON-compatible * value into an instance of your type. This should * match the serialization performed by your * type's `toJSONValue` method. */ export declare function addType(name: any, factory: any): void; export declare function _isCustomType(obj: any): boolean; export declare function _getTypes(isOriginal?: boolean): unknown; export declare function _getConverters(): any; export declare function _adjustTypesToJSONValue(obj: any): any; /** * @summary Serialize an EJSON-compatible value into its plain JSON * representation. * @locus Anywhere * @param {EJSON} val A value to serialize to plain JSON. */ export declare function toJSONValue(item: any): any; export declare function _adjustTypesFromJSONValue(obj: any): any; /** * @summary Deserialize an EJSON value from its plain JSON representation. * @locus Anywhere * @param {JSONCompatible} val A value to deserialize into EJSON. */ export declare function fromJSONValue(item: any): any; /** * @summary Serialize a value to a string. For EJSON values, the serialization * fully represents the value. For non-EJSON values, serializes the * same way as `JSON.stringify`. * @locus Anywhere * @param {EJSON} val A value to stringify. * @param {Object} [options] * @param {Boolean | Integer | String} options.indent Indents objects and * arrays for easy readability. When `true`, indents by 2 spaces; when an * integer, indents by that number of spaces; and when a string, uses the * string as the indentation pattern. * @param {Boolean} options.canonical When `true`, stringifies keys in an * object in sorted order. */ export declare function stringify(val: any, opts?: { canonical?: boolean; indent?: boolean | number | string; }): string; /** * @summary Parse a string into an EJSON value. Throws an error if the string * is not valid EJSON. * @locus Anywhere * @param {String} str A string to parse into an EJSON value. */ export declare function parse(item: any): any; /** * @summary Returns true if `x` is a buffer of binary data, as returned from * [`EJSON.newBinary`](#ejson_new_binary). * @param {Object} x The variable to check. * @locus Anywhere */ export declare function isBinary(obj: any): obj is Uint8Array; /** * @summary Return true if `a` and `b` are equal to each other. Return false * otherwise. Uses the `equals` method on `a` if present, otherwise * performs a deep comparison. * @locus Anywhere * @param {EJSON} a * @param {EJSON} b * @param {Object} [options] * @param {Boolean} options.keyOrderSensitive Compare in key sensitive order, * if supported by the JavaScript implementation. For example, `{a: 1, b: 2}` * is equal to `{b: 2, a: 1}` only when `keyOrderSensitive` is `false`. The * default is `false`. */ export declare function equals(a: any, b: any, options?: any): any; /** * @summary Return a deep copy of `val`. * @locus Anywhere * @param {EJSON} val A value to copy. */ export declare function clone(v: T): T;