UNPKG

@xylabs/threads

Version:

Web workers & worker threads as simple as a function call

22 lines 931 B
import type { JsonSerializable, Serializer, SerializerImplementation } from './serializers.ts'; declare global { var registeredSerializer: Serializer<JsonSerializable>; } /** * Register a custom serializer to extend the default serialization behavior for worker messages. * @param serializer - The serializer implementation to register. */ export declare function registerSerializer(serializer: SerializerImplementation<JsonSerializable>): void; /** * Deserialize a message using the registered serializer. * @param message - The serialized message to deserialize. * @returns The deserialized value. */ export declare function deserialize(message: JsonSerializable): any; /** * Serialize an input value using the registered serializer. * @param input - The value to serialize. * @returns The serialized message. */ export declare function serialize(input: any): JsonSerializable; //# sourceMappingURL=common.d.ts.map