import { DeserializationPlugin, type AnyFunction, type SerializedFunctionReturnType, type DeserializedFunction } from '@makeswift/controls';
declare const SerializedFunctionTag: unique symbol;
type ResolveCallPromise<T extends AnyFunction> = (value: SerializedFunctionReturnType<T>) => void;
type OnMessageHandler<T extends AnyFunction> = MessagePort['onmessage'] & {
    newCall?(resolve: ResolveCallPromise<T>): number;
};
export type SerializedFunction<T extends AnyFunction> = MessagePort & {
    onmessage: OnMessageHandler<T>;
    readonly [SerializedFunctionTag]: T;
};
export declare function isSerializedFunction(value: any): value is SerializedFunction<AnyFunction>;
export declare function serializeFunction<T extends AnyFunction>(func: T): SerializedFunction<T>;
export declare function deserializeFunction<T extends AnyFunction>(serializedFunction: SerializedFunction<T>): DeserializedFunction<T>;
export declare const functionDeserializationPlugin: DeserializationPlugin<SerializedFunction<AnyFunction>, DeserializedFunction<AnyFunction>>;
export {};
//# sourceMappingURL=function-serialization.d.ts.map