import * as addon from './addon_types.js';
import { AdaptObject, AdaptObjectLifetime, Destroyable, nm_AdaptValue, nm_AdaptPacketContext, AddonTypesConstraints } from '@adapt-toolkit/sdk/common';
export { AdaptObject, AdaptObjectLifetime } from '@adapt-toolkit/sdk/common';
export declare const ERR_ADAPT_NO_PREBUILD = "ERR_ADAPT_NO_PREBUILD";
export declare type Convertible = addon.Convertible;
export declare type AdaptValueOrConvertible = AdaptValue | Convertible;
declare const AddonTypes: AddonTypesConstraints;
export declare class AdaptEnvironment {
    /** @ignore */
    static adapt: addon.AdaptEnvironment | undefined;
    /** @ignore */
    constructor();
    static DetermineEnvironment: () => "nitro" | "native";
    /**
     * Asynchronously initialise ADAPT in either test or release mode.
     *
     * @param test_mode true to initialise in test mode
     */
    static InitializeAsync: (test_mode: boolean) => Promise<void>;
    /**
     * Synchronously initialise ADAPT.
     *
     * @returns true if initialisation succeeded
     */
    static Initialize(test_mode: boolean): boolean;
    /**
     * Throw if ADAPT has not been initialised.
     */
    static Check(): void;
    /**
     * Create an empty packet that does not carry compiled MUFL code.
     *
     * @param lt lifetime; if undefined, caller is responsible for Destroy()
     * @param secure if true, in-packet primitive calls are forbidden
     */
    static EmptyPacket(lt: AdaptObjectLifetime | undefined, secure: boolean): AdaptPacketContext;
    /**
     * Create an ADAPT packet from a loaded MUFL evaluation unit.
     */
    static CreatePacket(lt: AdaptObjectLifetime | undefined, unit: AdaptEvaluationUnit, seed_phrase: string, entropy: string, secure: boolean, init_arg?: AdaptValue): AdaptPacketContext;
    /**
     * AdaptValue of domain TIME representing the current system time.
     */
    static SystemTime(lt: AdaptObjectLifetime | undefined): AdaptValue;
    /**
     * Parse a timestamp formatted as `YYYY-MM-DD hh:mm:ss[.nnnnnnnnn] (UTC[+x])`.
     */
    static ParseTime(lt: AdaptObjectLifetime | undefined, time: string): AdaptValue;
    /**
     * Cryptographically secure random bytes as an AdaptValue of domain BINARY.
     */
    static GetRandomBytes(lt: AdaptObjectLifetime | undefined, length: number): AdaptValue;
    /**
     * Drain the ADAPT-internal stdout buffer and return its contents.
     */
    static getStdoutContents(): string;
    /**
     * Drain the ADAPT-internal stderr buffer and return its contents.
     */
    static getStderrContents(): string;
}
/**
 * A compiled MUFL application loaded from a `.muflo` binary file or buffer.
 * Same memory-management contract as {@link AdaptPacketContext} and {@link AdaptValue}.
 */
export declare class AdaptEvaluationUnit extends AdaptObject {
    /** @ignore */
    unit: addon.AdaptEvaluationUnit;
    /** @ignore */
    constructor(lt: AdaptObjectLifetime | undefined, unit: addon.AdaptEvaluationUnit);
    /** @ignore */
    protected ManagedObjects(): Destroyable[];
    Clone(lifetime?: AdaptObjectLifetime): this;
    /**
     * Load a compiled MUFL application from a `.muflo` file.
     */
    static LoadFromFile: (lt: AdaptObjectLifetime | undefined, fileName: string) => AdaptEvaluationUnit;
    /**
     * Load a compiled MUFL application from raw binary contents.
     */
    static LoadFromContents: (lt: AdaptObjectLifetime | undefined, contents: Uint8Array) => AdaptEvaluationUnit;
}
/**
 * Wraps a MUFL value. Values must be destroyed via {@link AdaptValue.Destroy}
 * or attached to an {@link AdaptObjectLifetime} that owns their cleanup.
 */
export declare class AdaptValue extends AdaptObject implements nm_AdaptValue.I_AdaptValue<typeof AddonTypes> {
    /** @ignore */
    value: addon.AdaptValue;
    constructor(lt: AdaptObjectLifetime | undefined, from: AdaptValueOrConvertible | addon.AdaptValue);
    /** @ignore */
    protected ManagedObjects(): Destroyable[];
    Visualize(): string;
    Serialize(): Uint8Array;
    GetHash(): AdaptValue;
    Reduce(reducer: AdaptValueOrConvertible): AdaptValue;
    Mutate(reducer: AdaptValueOrConvertible, product: AdaptValueOrConvertible): AdaptValue;
    GetPacket(): AdaptPacketContext;
    GetNumber(): number;
    GetBoolean(): boolean;
    GetBinary(): Uint8Array;
    IsNil(): boolean;
    Equals(rhs: AdaptValueOrConvertible): boolean;
    Less(rhs: AdaptValueOrConvertible): boolean;
    Clone(lifetime?: AdaptObjectLifetime): this;
    GetKeys(): Array<AdaptValue>;
}
/**
 * The ADAPT packet context — a MUFL packet wrapped for use from TypeScript.
 */
export declare class AdaptPacketContext extends AdaptObject implements nm_AdaptPacketContext.I_AdaptPacketContext<typeof AddonTypes> {
    /** @ignore */
    packet: addon.AdaptPacketContext;
    /** @ignore */
    constructor(lt: AdaptObjectLifetime | undefined, from: addon.AdaptPacketContext);
    /** @ignore */
    protected ManagedObjects(): Destroyable[];
    static LoadFromFile(lifetime: AdaptObjectLifetime | undefined, path: string): AdaptPacketContext;
    static LoadFromContents(lifetime: AdaptObjectLifetime | undefined, contents: Uint8Array): AdaptPacketContext;
    Clone(lifetime?: AdaptObjectLifetime): this;
    ParseValue(value: Uint8Array): AdaptValue;
    ParseValueFromJSON(json: string): AdaptValue;
    CreateDictionary(): AdaptValue;
    NewBinaryFromHex(hex: string): AdaptValue;
    NewBinaryFromBuffer(buffer: Uint8Array): AdaptValue;
    ExecuteTransaction(envelope: AdaptValue | addon.Convertible, entropy_hex?: string, timestamp?: AdaptValue | addon.Convertible): AdaptValue;
    ExecuteFunction(func_name: string, args?: AdaptValueOrConvertible[] | AdaptValueOrConvertible): AdaptValue;
    GetHash(): AdaptValue;
    GetContainerID(): AdaptValue;
    GetCodeID(): AdaptValue;
    Serialize(): Uint8Array;
    SaveToFile(_path: string): void;
    TransactionsList(): Array<string>;
    Nil(): AdaptValue;
}
//# sourceMappingURL=adapt.d.ts.map