import { ClassConstructor } from './types.js'; import './helpers/guards.js'; /** * Copyright 2025 © BeeAI a Series of LF Projects, LLC * SPDX-License-Identifier: Apache-2.0 */ type SerializableClass = ClassConstructor> & Pick, "fromSnapshot" | "fromSerialized">; interface DeserializeOptions { extraClasses?: SerializableClass[]; /** * Function deserialization is disabled by default because it can execute * arbitrary code from the payload (see GHSA-phhm-7927-g88p). Only set this * to `true` if you fully trust the source of the serialized data. */ allowFunctionDeserialization?: boolean; } declare abstract class Serializable { abstract createSnapshot(): T | Promise; abstract loadSnapshot(snapshot: T): void | Promise; constructor(); static register(this: SerializableClass, aliases?: string[]): void; clone(this: T): Promise; serialize(): Promise; protected deserialize(value: string, options?: DeserializeOptions): Promise; static fromSnapshot>(this: new (...args: any[]) => T, state: P): Promise; static fromSerialized(this: abstract new (...args: any[]) => T, serialized: string, options?: DeserializeOptions): Promise; } export { type DeserializeOptions, Serializable, type SerializableClass };