UNPKG

@woosh/meep-engine

Version:

Pure JavaScript game engine. Fully featured and production ready.

52 lines 1.41 kB
/** * Defines how to serialize and deserialize an instance of a given class */ export class BinaryClassSerializationAdapter { /** * Class that this adapter handles * @protected * @type {Class} */ protected klass: Class; /** * Format version number, used to check for format changes and data compatibility * Increment the number if you change the adapter to indicate the change in format * See {@link BinaryClassUpgrader} for details on how to handle support for outdated format versions * @protected * @type {number} */ protected version: number; /** * @template T * @returns {Class<T>} */ getClass<T>(): Class<T>; /** * * @returns {number} */ getVersion(): number; initialize(...args: any[]): void; /** * Handle any necessary resource cleanup. * Invoked externally as part of the serialization lifecycle */ finalize(): void; /** * @param {BinaryBuffer} buffer * @param value */ serialize(buffer: BinaryBuffer, value: any): void; /** * * @param {BinaryBuffer} buffer * @param value */ deserialize(buffer: BinaryBuffer, value: any): void; /** * @readonly * @type {boolean} */ readonly isBinaryClassSerializationAdapter: boolean; } //# sourceMappingURL=BinaryClassSerializationAdapter.d.ts.map