UNPKG

@daiso-tech/core

Version:

The library offers flexible, framework-agnostic solutions for modern web applications, built on adaptable components that integrate seamlessly with popular frameworks like Next Js.

55 lines (54 loc) 1.81 kB
/** * @module Serde */ /** * The error occurs when a value is unable to be serialized. * * IMPORT_PATH: `"@daiso-tech/core/serde/contracts"` * @group Errors */ export declare class SerializationSerdeError extends Error { static create(error: unknown): DeserializationSerdeError; /** * Note: Do not instantiate `SerializationSerdeError` directly via the constructor. Use the static `create()` factory method instead. * The constructor remains public only to maintain compatibility with errorPolicy types and prevent type errors. * @internal */ constructor(message: string, cause?: unknown); } /** * The error occurs when a value is unable to be deserialized. * * IMPORT_PATH: `"@daiso-tech/core/serde/contracts"` * @group Errors */ export declare class DeserializationSerdeError extends Error { static create(error: unknown): DeserializationSerdeError; /** * Note: Do not instantiate `DeserializationSerdeError` directly via the constructor. Use the static `create()` factory method instead. * The constructor remains public only to maintain compatibility with errorPolicy types and prevent type errors. * @internal */ constructor(message: string, cause?: unknown); } /** * * IMPORT_PATH: `"@daiso-tech/core/serde/contracts"` * @group Errors */ export declare const SERDE_ERRORS: { readonly Serialization: typeof SerializationSerdeError; readonly Deserialization: typeof DeserializationSerdeError; }; /** * * IMPORT_PATH: `"@daiso-tech/core/serde/contracts"` * @group Errors */ export type AllSerdeErrors = SerializationSerdeError | DeserializationSerdeError; /** * * IMPORT_PATH: `"@daiso-tech/core/serde/contracts"` * @group Errors */ export declare function isSerdeError(value: unknown): value is AllSerdeErrors;