UNPKG

easy-api.ts

Version:

A powerful library to create your own API with ease.

76 lines (75 loc) 2.16 kB
import { FunctionToken } from "../core/Compiler"; /** * Represents an error for missing values of a function. */ export declare class MissingRequiredValuesError extends Error { constructor(fn: FunctionToken, requiredValues: number, gotValues: number); } /** * Throws an error for non-cached functions. */ export declare class NotAFunctionError extends Error { constructor(fn: FunctionToken); } /** * Throws an error for invalid rest parameters. */ export declare class InvalidRestParameter extends Error { constructor(); } /** * Throws an error if a value does not match with the allowed ones. */ export declare class InvalidAllowedValue extends Error { constructor(fn: FunctionToken, fieldIndex: number, allowedValues: string[], gotValue: string); } /** * Throws an error for invalid output types. */ export declare class InvalidType extends Error { constructor(fn: Omit<FunctionToken, "all">, expectedOutput: string, got: string); } /** * Represents the types of variables ea.ts has. */ export declare enum VariableType { Array = 0, Object = 1, Common = 2, Internal = 3 } /** * Throws an invalid variable name error. */ export declare class InvalidVariableName extends Error { constructor(type: VariableType, name: string, fn: Omit<FunctionToken, "all">); } /** * Throws an error if the given index is not valid. */ export declare class InvalidFieldIndex extends Error { constructor(index: string | number, fn: Omit<FunctionToken, "all">, argName: string); } /** * Throws a generic error for a function field. */ export declare class InvalidField extends Error { constructor(argName: string, fn: Omit<FunctionToken, "all">); } /** * Throws an error if the given statement is not valid. */ export declare class IllegalStatementError extends Error { constructor(parent: Omit<FunctionToken, "all">, expectedFunction: string, gotFunction: string); } /** * Represents a generic easy-api.ts error. */ export declare class EATS_Error extends Error { constructor(message: string); /** * Get the error row. * @returns {string} */ static getErrorRow(): string; }