mirror of
https://github.com/vercel/workflow.git
synced 2026-09-14 19:59:43 +08:00
692a6ac5dc
* Upgrade workspace to TypeScript 6 * Restore Nest baseUrl for SWC builds * Use empty changeset for TS6 upgrade * Remove TS6 changeset
@workflow/serde
Serialization symbols for custom class serialization in Workflow SDK.
Usage
import { WORKFLOW_SERIALIZE, WORKFLOW_DESERIALIZE } from '@workflow/serde';
class MyClass {
constructor(public value: string) {}
static [WORKFLOW_SERIALIZE](instance: MyClass) {
return { value: instance.value };
}
static [WORKFLOW_DESERIALIZE](data: { value: string }) {
return new MyClass(data.value);
}
}
License
Apache-2.0