import { type UniffiByteArray, RustBuffer, uniffiTypeNameSymbol, variantOrdinalSymbol } from "uniffi-bindgen-react-native"; export declare function parse(input: string, parseAny: boolean): DuperValue; export declare function serialize(input: DuperValue, options: SerializeOptions | undefined): string; export type DuperObjectEntry = { key: string; value: DuperValue; }; /** * Generated factory for {@link DuperObjectEntry} record objects. */ export declare const DuperObjectEntry: Readonly<{ /** * Create a frozen instance of {@link DuperObjectEntry}, with defaults specified * in Rust, in the {@link duper} crate. */ create: (partial: Partial & Required>) => DuperObjectEntry; /** * Create a frozen instance of {@link DuperObjectEntry}, with defaults specified * in Rust, in the {@link duper} crate. */ new: (partial: Partial & Required>) => DuperObjectEntry; /** * Defaults specified in the {@link duper} crate. */ defaults: () => Partial; }>; export type SerializeOptions = { indent: string | undefined; stripIdentifiers: boolean; minify: boolean; }; /** * Generated factory for {@link SerializeOptions} record objects. */ export declare const SerializeOptions: Readonly<{ /** * Create a frozen instance of {@link SerializeOptions}, with defaults specified * in Rust, in the {@link duper} crate. */ create: (partial: Partial & Required>) => SerializeOptions; /** * Create a frozen instance of {@link SerializeOptions}, with defaults specified * in Rust, in the {@link duper} crate. */ new: (partial: Partial & Required>) => SerializeOptions; /** * Defaults specified in the {@link duper} crate. */ defaults: () => Partial; }>; export declare enum DuperError_Tags { Parse = "Parse", SerializeOptions = "SerializeOptions", InvalidIdentifier = "InvalidIdentifier", InvalidObject = "InvalidObject", InvalidTemporal = "InvalidTemporal", InvalidFloat = "InvalidFloat" } export declare const DuperError: { Parse: { new (message: string): { readonly tag: DuperError_Tags.Parse; /** * @private * This field is private and should not be used. */ readonly [uniffiTypeNameSymbol]: string; /** * @private * This field is private and should not be used. */ readonly [variantOrdinalSymbol]: 1; name: string; message: string; stack?: string; }; instanceOf(e: any): e is { readonly tag: DuperError_Tags.Parse; /** * @private * This field is private and should not be used. */ readonly [uniffiTypeNameSymbol]: string; /** * @private * This field is private and should not be used. */ readonly [variantOrdinalSymbol]: 1; name: string; message: string; stack?: string; }; }; SerializeOptions: { new (message: string): { readonly tag: DuperError_Tags.SerializeOptions; /** * @private * This field is private and should not be used. */ readonly [uniffiTypeNameSymbol]: string; /** * @private * This field is private and should not be used. */ readonly [variantOrdinalSymbol]: 2; name: string; message: string; stack?: string; }; instanceOf(e: any): e is { readonly tag: DuperError_Tags.SerializeOptions; /** * @private * This field is private and should not be used. */ readonly [uniffiTypeNameSymbol]: string; /** * @private * This field is private and should not be used. */ readonly [variantOrdinalSymbol]: 2; name: string; message: string; stack?: string; }; }; InvalidIdentifier: { new (message: string): { readonly tag: DuperError_Tags.InvalidIdentifier; /** * @private * This field is private and should not be used. */ readonly [uniffiTypeNameSymbol]: string; /** * @private * This field is private and should not be used. */ readonly [variantOrdinalSymbol]: 3; name: string; message: string; stack?: string; }; instanceOf(e: any): e is { readonly tag: DuperError_Tags.InvalidIdentifier; /** * @private * This field is private and should not be used. */ readonly [uniffiTypeNameSymbol]: string; /** * @private * This field is private and should not be used. */ readonly [variantOrdinalSymbol]: 3; name: string; message: string; stack?: string; }; }; InvalidObject: { new (message: string): { readonly tag: DuperError_Tags.InvalidObject; /** * @private * This field is private and should not be used. */ readonly [uniffiTypeNameSymbol]: string; /** * @private * This field is private and should not be used. */ readonly [variantOrdinalSymbol]: 4; name: string; message: string; stack?: string; }; instanceOf(e: any): e is { readonly tag: DuperError_Tags.InvalidObject; /** * @private * This field is private and should not be used. */ readonly [uniffiTypeNameSymbol]: string; /** * @private * This field is private and should not be used. */ readonly [variantOrdinalSymbol]: 4; name: string; message: string; stack?: string; }; }; InvalidTemporal: { new (message: string): { readonly tag: DuperError_Tags.InvalidTemporal; /** * @private * This field is private and should not be used. */ readonly [uniffiTypeNameSymbol]: string; /** * @private * This field is private and should not be used. */ readonly [variantOrdinalSymbol]: 5; name: string; message: string; stack?: string; }; instanceOf(e: any): e is { readonly tag: DuperError_Tags.InvalidTemporal; /** * @private * This field is private and should not be used. */ readonly [uniffiTypeNameSymbol]: string; /** * @private * This field is private and should not be used. */ readonly [variantOrdinalSymbol]: 5; name: string; message: string; stack?: string; }; }; InvalidFloat: { new (message: string): { readonly tag: DuperError_Tags.InvalidFloat; /** * @private * This field is private and should not be used. */ readonly [uniffiTypeNameSymbol]: string; /** * @private * This field is private and should not be used. */ readonly [variantOrdinalSymbol]: 6; name: string; message: string; stack?: string; }; instanceOf(e: any): e is { readonly tag: DuperError_Tags.InvalidFloat; /** * @private * This field is private and should not be used. */ readonly [uniffiTypeNameSymbol]: string; /** * @private * This field is private and should not be used. */ readonly [variantOrdinalSymbol]: 6; name: string; message: string; stack?: string; }; }; instanceOf: (e: any) => e is DuperError; }; export type DuperError = InstanceType]>; export declare enum DuperValue_Tags { Object = "Object", Array = "Array", Tuple = "Tuple", String = "String", Bytes = "Bytes", Temporal = "Temporal", Integer = "Integer", Float = "Float", Boolean = "Boolean", Null = "Null" } export declare const DuperValue: Readonly<{ instanceOf: (obj: any) => obj is DuperValue; Object: { new (inner: { identifier: string | undefined; value: Array; }): { readonly tag: DuperValue_Tags.Object; readonly inner: Readonly<{ identifier: string | undefined; value: Array; }>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "DuperValue"; }; "new"(inner: { identifier: string | undefined; value: Array; }): { readonly tag: DuperValue_Tags.Object; readonly inner: Readonly<{ identifier: string | undefined; value: Array; }>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "DuperValue"; }; instanceOf(obj: any): obj is { readonly tag: DuperValue_Tags.Object; readonly inner: Readonly<{ identifier: string | undefined; value: Array; }>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "DuperValue"; }; }; Array: { new (inner: { identifier: string | undefined; value: Array; }): { readonly tag: DuperValue_Tags.Array; readonly inner: Readonly<{ identifier: string | undefined; value: Array; }>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "DuperValue"; }; "new"(inner: { identifier: string | undefined; value: Array; }): { readonly tag: DuperValue_Tags.Array; readonly inner: Readonly<{ identifier: string | undefined; value: Array; }>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "DuperValue"; }; instanceOf(obj: any): obj is { readonly tag: DuperValue_Tags.Array; readonly inner: Readonly<{ identifier: string | undefined; value: Array; }>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "DuperValue"; }; }; Tuple: { new (inner: { identifier: string | undefined; value: Array; }): { readonly tag: DuperValue_Tags.Tuple; readonly inner: Readonly<{ identifier: string | undefined; value: Array; }>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "DuperValue"; }; "new"(inner: { identifier: string | undefined; value: Array; }): { readonly tag: DuperValue_Tags.Tuple; readonly inner: Readonly<{ identifier: string | undefined; value: Array; }>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "DuperValue"; }; instanceOf(obj: any): obj is { readonly tag: DuperValue_Tags.Tuple; readonly inner: Readonly<{ identifier: string | undefined; value: Array; }>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "DuperValue"; }; }; String: { new (inner: { identifier: string | undefined; value: string; }): { readonly tag: DuperValue_Tags.String; readonly inner: Readonly<{ identifier: string | undefined; value: string; }>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "DuperValue"; }; "new"(inner: { identifier: string | undefined; value: string; }): { readonly tag: DuperValue_Tags.String; readonly inner: Readonly<{ identifier: string | undefined; value: string; }>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "DuperValue"; }; instanceOf(obj: any): obj is { readonly tag: DuperValue_Tags.String; readonly inner: Readonly<{ identifier: string | undefined; value: string; }>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "DuperValue"; }; }; Bytes: { new (inner: { identifier: string | undefined; value: ArrayBuffer; }): { readonly tag: DuperValue_Tags.Bytes; readonly inner: Readonly<{ identifier: string | undefined; value: ArrayBuffer; }>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "DuperValue"; }; "new"(inner: { identifier: string | undefined; value: ArrayBuffer; }): { readonly tag: DuperValue_Tags.Bytes; readonly inner: Readonly<{ identifier: string | undefined; value: ArrayBuffer; }>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "DuperValue"; }; instanceOf(obj: any): obj is { readonly tag: DuperValue_Tags.Bytes; readonly inner: Readonly<{ identifier: string | undefined; value: ArrayBuffer; }>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "DuperValue"; }; }; Temporal: { new (inner: { identifier: string | undefined; value: string; }): { readonly tag: DuperValue_Tags.Temporal; readonly inner: Readonly<{ identifier: string | undefined; value: string; }>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "DuperValue"; }; "new"(inner: { identifier: string | undefined; value: string; }): { readonly tag: DuperValue_Tags.Temporal; readonly inner: Readonly<{ identifier: string | undefined; value: string; }>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "DuperValue"; }; instanceOf(obj: any): obj is { readonly tag: DuperValue_Tags.Temporal; readonly inner: Readonly<{ identifier: string | undefined; value: string; }>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "DuperValue"; }; }; Integer: { new (inner: { identifier: string | undefined; value: bigint; }): { readonly tag: DuperValue_Tags.Integer; readonly inner: Readonly<{ identifier: string | undefined; value: bigint; }>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "DuperValue"; }; "new"(inner: { identifier: string | undefined; value: bigint; }): { readonly tag: DuperValue_Tags.Integer; readonly inner: Readonly<{ identifier: string | undefined; value: bigint; }>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "DuperValue"; }; instanceOf(obj: any): obj is { readonly tag: DuperValue_Tags.Integer; readonly inner: Readonly<{ identifier: string | undefined; value: bigint; }>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "DuperValue"; }; }; Float: { new (inner: { identifier: string | undefined; value: number; }): { readonly tag: DuperValue_Tags.Float; readonly inner: Readonly<{ identifier: string | undefined; value: number; }>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "DuperValue"; }; "new"(inner: { identifier: string | undefined; value: number; }): { readonly tag: DuperValue_Tags.Float; readonly inner: Readonly<{ identifier: string | undefined; value: number; }>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "DuperValue"; }; instanceOf(obj: any): obj is { readonly tag: DuperValue_Tags.Float; readonly inner: Readonly<{ identifier: string | undefined; value: number; }>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "DuperValue"; }; }; Boolean: { new (inner: { identifier: string | undefined; value: boolean; }): { readonly tag: DuperValue_Tags.Boolean; readonly inner: Readonly<{ identifier: string | undefined; value: boolean; }>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "DuperValue"; }; "new"(inner: { identifier: string | undefined; value: boolean; }): { readonly tag: DuperValue_Tags.Boolean; readonly inner: Readonly<{ identifier: string | undefined; value: boolean; }>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "DuperValue"; }; instanceOf(obj: any): obj is { readonly tag: DuperValue_Tags.Boolean; readonly inner: Readonly<{ identifier: string | undefined; value: boolean; }>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "DuperValue"; }; }; Null: { new (inner: { identifier: string | undefined; }): { readonly tag: DuperValue_Tags.Null; readonly inner: Readonly<{ identifier: string | undefined; }>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "DuperValue"; }; "new"(inner: { identifier: string | undefined; }): { readonly tag: DuperValue_Tags.Null; readonly inner: Readonly<{ identifier: string | undefined; }>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "DuperValue"; }; instanceOf(obj: any): obj is { readonly tag: DuperValue_Tags.Null; readonly inner: Readonly<{ identifier: string | undefined; }>; /** * @private * This field is private and should not be used, use `tag` instead. */ readonly [uniffiTypeNameSymbol]: "DuperValue"; }; }; }>; export type DuperValue = InstanceType]>; /** * This should be called before anything else. * * It is likely that this is being done for you by the library's `index.ts`. * * It checks versions of uniffi between when the Rust scaffolding was generated * and when the bindings were generated. * * It also initializes the machinery to enable Rust to talk back to Javascript. */ declare function uniffiEnsureInitialized(): void; declare const _default: Readonly<{ initialize: typeof uniffiEnsureInitialized; converters: { FfiConverterTypeDuperError: { read(from: RustBuffer): DuperError; write(value: DuperError, into: RustBuffer): void; allocationSize(value: DuperError): number; lift(value: UniffiByteArray): DuperError; lower(value: DuperError): UniffiByteArray; }; FfiConverterTypeDuperObjectEntry: { read(from: RustBuffer): DuperObjectEntry; write(value: DuperObjectEntry, into: RustBuffer): void; allocationSize(value: DuperObjectEntry): number; lift(value: UniffiByteArray): DuperObjectEntry; lower(value: DuperObjectEntry): UniffiByteArray; }; FfiConverterTypeDuperValue: { read(from: RustBuffer): DuperValue; write(value: DuperValue, into: RustBuffer): void; allocationSize(value: DuperValue): number; lift(value: UniffiByteArray): DuperValue; lower(value: DuperValue): UniffiByteArray; }; FfiConverterTypeSerializeOptions: { read(from: RustBuffer): SerializeOptions; write(value: SerializeOptions, into: RustBuffer): void; allocationSize(value: SerializeOptions): number; lift(value: UniffiByteArray): SerializeOptions; lower(value: SerializeOptions): UniffiByteArray; }; }; }>; export default _default;