osrs-tools
Version:
A comprehensive TypeScript library for Old School RuneScape (OSRS) data and utilities, including quest data, skill requirements, and game item information
97 lines • 2.69 kB
TypeScript
/**
* Base error class for OSRS Tools
* Contains additional context and helper methods
*/
export declare class OsrsToolsError extends Error {
/** ISO timestamp when the error occurred */
readonly timestamp: string;
constructor(message: string);
/**
* Get error details in a structured format
*/
toJSON(): {
name: string;
message: string;
timestamp: string;
stack: string | undefined;
};
}
/**
* Error thrown when quest-related operations fail
*/
export declare class QuestError extends OsrsToolsError {
readonly questName: string;
constructor(questName: string, message: string);
toJSON(): {
questName: string;
name: string;
message: string;
timestamp: string;
stack: string | undefined;
};
}
/**
* Error thrown when skill-related operations fail
*/
export declare class SkillError extends OsrsToolsError {
readonly skillName: string;
readonly value?: number;
constructor(skillName: string, message: string, value?: number);
toJSON(): {
skillName: string;
value: number | undefined;
name: string;
message: string;
timestamp: string;
stack: string | undefined;
};
}
/**
* Error thrown when account-related operations fail
*/
export declare class AccountError extends OsrsToolsError {
readonly accountName?: string;
constructor(message: string, accountName?: string);
toJSON(): {
accountName: string | undefined;
name: string;
message: string;
timestamp: string;
stack: string | undefined;
};
}
/**
* Error thrown when API-related operations fail
*/
export declare class ApiError extends OsrsToolsError {
readonly statusCode?: number;
readonly endpoint?: string;
constructor(message: string, statusCode?: number, endpoint?: string);
toJSON(): {
statusCode: number | undefined;
endpoint: string | undefined;
name: string;
message: string;
timestamp: string;
stack: string | undefined;
};
}
/**
* Error thrown when validation fails
*/
export declare class ValidationError extends OsrsToolsError {
readonly field: string;
readonly value: unknown;
readonly constraints: Record<string, unknown>;
constructor(field: string, value: unknown, message: string, constraints?: Record<string, unknown>);
toJSON(): {
field: string;
value: unknown;
constraints: Record<string, unknown>;
name: string;
message: string;
timestamp: string;
stack: string | undefined;
};
}
//# sourceMappingURL=index.d.ts.map