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.

51 lines (50 loc) 1.63 kB
/** * @module Collection */ /** * The error is thrown when the item is not found. * * IMPORT_PATH: `"@daiso-tech/core/collection/contracts"` * @group Errors */ export declare class ItemNotFoundCollectionError extends Error { 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 Error { 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 Error { 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 Error { constructor(message: string, cause?: unknown); } /** * * IMPORT_PATH: `"@daiso-tech/core/collection/contracts"` * @group Errors */ export declare const COLLECTION_ERRORS: { readonly ItemNotFound: typeof ItemNotFoundCollectionError; readonly MultipleItemsFound: typeof MultipleItemsFoundCollectionError; readonly Type: typeof TypeCollectionError; readonly Empty: typeof EmptyCollectionError; };