import type { AssetCodec, AssetStageError, CookProduct, Result } from '@forgeax/engine-types'; export interface NativeCookArtifact { readonly mediaType: string; readonly assetCodec?: AssetCodec; readonly bytes: Uint8Array; } export interface NativeCookDraft
{
readonly guid: string;
readonly payload: P;
readonly refs: readonly string[];
readonly artifacts: Readonly {
readonly key: string;
readonly discover?: (input: unknown) => I | Promise;
cook(input: I): NativeCookDraft | Promise {
readonly draft: NativeCookDraft ;
readonly generation: number;
}
export interface NativeCookTransactionOptions {
readonly key: string;
readonly input: I;
readonly previous?: NativeCookTransactionSnapshot ;
readonly validate?: (draft: NativeCookDraft ) => string | undefined;
readonly publish?: (draft: NativeCookDraft , generation: number) => void | Promise extends NativeCookTransactionSnapshot {
readonly status: 'committed' | 'recovered';
readonly lastKnownGood: NativeCookDraft ;
readonly candidateGeneration: number;
readonly lastKnownGoodGeneration: number;
readonly recoveryHint?: string;
}
/** Injectable build-time table for native authored Pack producers. */
export declare class NativeCookerRegistry {
private readonly cookers;
register(cooker: NativeCooker): () => void;
get(key: string): NativeCooker | undefined;
registeredCookers(): readonly string[];
runDraft (key: string, input: I): Promise (key: string, input: I): Promise (options: NativeCookTransactionOptions ): Promise