UNPKG

js-slang

Version:

Javascript-based implementations of Source, written in Typescript

14 lines (13 loc) 1.09 kB
import { Option } from '@commander-js/extra-typings'; import { Chapter, type Language, Variant, type Result, type LanguageOptions } 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 const getLanguageOption: <T extends LanguageOptions>() => Option<"--languageOptions <options>", undefined, {}, LanguageOptions, false, undefined>; 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;