import { WorkerManager } from './worker/workerManager.js';
import { Signer } from './signer.js';
import { Action, BuilderIntent, Ingredient, ManifestDefinition } from '@contentauth/c2pa-types';
import { Settings } from './settings.js';
/**
 * Functions that permit the creation of Builder objects.
 */
export interface BuilderFactory {
    /**
     * Create a {@link Builder} with a minimal manifest definition as its initial state.
     * @param settings Optional context settings for the builder. Will override any values inherited by the top-level settings passed to createC2pa.
     * @returns A {@link Builder} object.
     */
    new: (settings?: Settings) => Promise<Builder>;
    /**
     * Create a {@link Builder} from a {@link ManifestDefinition}.
     *
     * @param definition The {@link ManifestDefinition} to be used as the builder's initial state.
     * @param settings Optional context settings for the builder. Will override any values inherited by the top-level settings passed to createC2pa.
     * @returns A {@link Builder} object.
     */
    fromDefinition: (definition: ManifestDefinition, settings?: Settings) => Promise<Builder>;
    /**
     * Create a {@link Builder} from a builder archive (created from {@link Builder.toArchive}).
     *
     * @param archive Builder archive as a blob.
     * @param settings Optional context settings for the builder. Will override any values inherited by the top-level settings passed to createC2pa.
     * @returns A {@link Builder} object.
     */
    fromArchive: (archive: Blob, settings?: Settings) => Promise<Builder>;
}
/**
 * Exposes methods for building C2PA manifests and signing assets.
 */
export interface Builder {
    /**
     * Sets the builder "intent."
     *
     * @todo Additional documentation coming soon.
     *
     * @param intent
     */
    setIntent: (intent: BuilderIntent) => Promise<void>;
    /**
     * Add an action to the manifest's actions assertion.
     *
     * @param action Object representing the action to be added.
     */
    addAction: (action: Action) => Promise<void>;
    /**
     * Sets the remote URL for a remote manifest. The manifest is expected to be available at this location.
     *
     * @param url URL pointing to the location the remote manifest will be stored.
     */
    setRemoteUrl: (url: string) => Promise<void>;
    /**
     * Sets the state of the no_embed flag. To skip embedding a manifest (e.g. for the remote-only case) set this to `true`.
     *
     * @param noEmbed Value to set the no_embed flag.
     */
    setNoEmbed: (noEmbed: boolean) => Promise<void>;
    /**
     * Set a thumbnail from a blob to be included in the manifest. The blob should represent the asset being signed.
     *
     * @param format Format of the thumbnail
     * @param blob Blob of the thumbnail bytes
     */
    setThumbnailFromBlob: (format: string, blob: Blob) => Promise<void>;
    /**
     * Add an ingredient to the builder from a definition only.
     *
     * @param ingredientDefinition {@link Ingredient} definition.
     */
    addIngredient: (ingredientDefinition: Ingredient) => Promise<void>;
    /**
     * Add an ingredient to the builder from a definition, format, and blob.
     * Values specified in the ingredient definition will be merged with the ingredient, and these values take precendence.
     *
     * @param ingredientDefinition {@link Ingredient} definition.
     * @param format Format of the ingredient.
     * @param blob Blob of the ingredient's bytes.
     */
    addIngredientFromBlob: (ingredientDefinition: Ingredient, format: string, blob: Blob) => Promise<void>;
    /**
     * Add a resource to the builder's resource store with an ID and blob of the resource's bytes.
     *
     * @param resourceId ID associated with the resource being added.
     * @param blob Blob of the resource's bytes.
     */
    addResourceFromBlob: (resourceId: string, blob: Blob) => Promise<void>;
    /**
     * Gets the current manifest definition held by the builder.
     *
     * @returns The {@link ManifestDefinition} held by the builder.
     */
    getDefinition: () => Promise<ManifestDefinition>;
    /**
     * Save the builder into .c2pa format.
     * This "archive" can be added to as an ingredient with {@link addIngredientFromBlob}
     *
     * @returns A builder archive in application/c2pa format.
     */
    toArchive: () => Promise<Uint8Array<ArrayBuffer>>;
    /**
     * Sign an asset.
     *
     * @todo Docs coming soon
     */
    sign: (signer: Signer, format: string, blob: Blob) => Promise<Uint8Array<ArrayBuffer>>;
    /**
     * Sign an asset and get both the signed asset bytes and the manifest bytes.
     *
     * @todo Docs coming soon
     */
    signAndGetManifestBytes: (signer: Signer, format: string, blob: Blob) => Promise<ManifestAndAssetBytes>;
    /**
     * Dispose of this Builder, freeing the memory it occupied and preventing further use. Call this whenever the Builder is no longer needed.
     */
    free: () => Promise<void>;
}
export interface ManifestAndAssetBytes {
    manifest: Uint8Array<ArrayBuffer>;
    asset: Uint8Array<ArrayBuffer>;
}
/**
 * @param worker - Worker (via WorkerManager) to be associated with this reader factory.
 * @returns A {@link BuilderFactory} object containing builder creation methods.
 */
export declare function createBuilderFactory(worker: WorkerManager): BuilderFactory;
//# sourceMappingURL=builder.d.ts.map