UNPKG

js-slang

Version:

Javascript-based implementations of Source, written in Typescript

13 lines (12 loc) 904 B
import { Option } from '@commander-js/extra-typings'; import { Chapter, type Language, Variant, type Result } from '../types'; import { type Context } from '..'; export declare function chapterParser(str: string): Chapter; export declare const getChapterOption: <T extends Chapter>(defaultValue: T, argParser: (value: string) => T) => Option<"--chapter <chapter>", undefined, T, T, false, undefined>; export declare const getVariantOption: <T extends Variant>(defaultValue: T, choices: T[]) => Option<"--variant <variant>", undefined, T, undefined, false, T>; export declare function validateChapterAndVariantCombo(language: Language): boolean; /** * Returns true iff the given chapter and variant combination is supported. */ export declare function validChapterVariant(language: Language): boolean; export declare function handleResult(result: Result, context: Context, verboseErrors: boolean): any;