UNPKG

612 BTypeScriptView Raw
1/**
2 * All errors that can occur inside an assert function.
3 */
4export declare enum OptionsError {
5 invalidOptionsParam = 0,
6 invalidDefaultsParam = 1,
7 optionNotRecognized = 2
8}
9/**
10 * Error-related context available for options-related issues.
11 */
12export interface IOptionsErrorContext {
13 options: any;
14 defaults: any;
15 key?: string;
16}
17/**
18 * Standard syntax for named values.
19 */
20export type NamedValues = {
21 [name: string]: any;
22};
23/**
24 * Assert function signature.
25 */
26export type AssertFunc = (options: NamedValues | null | undefined, defaults: NamedValues | string[]) => NamedValues;