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.

60 lines (59 loc) 1.9 kB
/** * @module Collection */ /** * * IMPORT_PATH: `"@daiso-tech/core/collection/contracts"` * @group Errors */ export declare class CollectionError extends Error { constructor(message: string, cause?: unknown); } /** * The error is thrown when the item is not found. * * IMPORT_PATH: `"@daiso-tech/core/collection/contracts"` * @group Errors */ export declare class ItemNotFoundCollectionError extends CollectionError { constructor(message: string, cause?: unknown); } /** * The error is thrown when multiple items are found. * * IMPORT_PATH: `"@daiso-tech/core/collection/contracts"` * @group Errors */ export declare class MultipleItemsFoundCollectionError extends CollectionError { constructor(message: string, cause?: unknown); } /** * The error is thrown when calling a method that needs all items to be of a specific type. For example, the `sum` method requires all items to be numbers. * * IMPORT_PATH: `"@daiso-tech/core/collection/contracts"` * @group Errors */ export declare class TypeCollectionError extends CollectionError { constructor(message: string, cause?: unknown); } /** * The error is thrown when calling a method that needs the collection not to be empty. For example, the `average` method requires the collection not to be empty. * * IMPORT_PATH: `"@daiso-tech/core/collection/contracts"` * @group Errors */ export declare class EmptyCollectionError extends CollectionError { constructor(message: string, cause?: unknown); } /** * * IMPORT_PATH: `"@daiso-tech/core/collection/contracts"` * @group Errors */ export declare const COLLECTION_ERRORS: { readonly Base: typeof CollectionError; readonly ItemNotFound: typeof ItemNotFoundCollectionError; readonly MultipleItemsFound: typeof MultipleItemsFoundCollectionError; readonly Type: typeof TypeCollectionError; readonly Empty: typeof EmptyCollectionError; };