UNPKG

helene

Version:
28 lines (27 loc) 1.37 kB
export declare const EJSON: { clone: (rootVal: any) => any; equals: (a: any, b: any, options?: any) => any; isBinary: (obj: Uint8Array & import("./utils").PolyfillableArray) => boolean; parse: (item: any) => any; stringify: (item: any, options?: import("./stringify").StringifyOptions) => string; fromJSONValue: (item: any) => any; toJSONValue: (item: any) => any; newBinary: (len: number) => import("./utils").PolyfillableArray | Uint8Array<ArrayBuffer>; /** * @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. */ addType(name: string, factory: any): void; _isCustomType(obj: any): boolean; _getTypes(isOriginal?: boolean): unknown; _getConverters(): any; _adjustTypesToJSONValue: (obj: any) => any; _adjustTypesFromJSONValue: (obj: any) => any; };