bananass
Version:
Baekjoon Framework for JavaScript.🍌
200 lines (199 loc) • 5.39 kB
TypeScript
declare const _default: {};
export default _default;
/**
* Bananass configuration object.
*/
export type ConfigObject = {
/**
* Current working directory.
*/
cwd?: string;
/**
* Entry directory name.
*/
entryDir?: string;
/**
* Output directory name.
*/
outDir?: string;
/**
* Global browser options.
*/
browser?: ConfigObjectBrowser;
/**
* Global console options.
*/
console?: ConfigObjectConsole;
/**
* Options exclusive to the `bananass add` command.
*/
add?: ConfigObjectAdd;
/**
* Options exclusive to the `bananass bug` command.
*/
bug?: ConfigObjectBug;
/**
* Options exclusive to the `bananass build` command.
*/
build?: ConfigObjectBuild;
/**
* Options exclusive to the `bananass discussion` command.
*/
discussion?: ConfigObjectDiscussion;
/**
* Options exclusive to the `bananass home` command.
*/
home?: ConfigObjectHome;
/**
* Options exclusive to the `bananass info` command.
*/
info?: ConfigObjectInfo;
/**
* Options exclusive to the `bananass open` command.
*/
open?: ConfigObjectOpen;
/**
* Options exclusive to the `bananass repo` command.
*/
repo?: ConfigObjectRepo;
/**
* Options exclusive to the `bananass run` command.
*/
run?: ConfigObjectRun;
};
/**
* Global browser options.
*/
export type ConfigObjectBrowser = {
/**
* Browser name. Select from `chrome`, `edge`, `firefox`, `brave`, or `default`.
*/
browser?: "chrome" | "edge" | "firefox" | "brave" | "default";
/**
* Open browser in secret (private or incognito) mode.
*/
secret?: boolean;
};
/**
* Global console options.
*/
export type ConfigObjectConsole = {
/**
* Enable debug mode.
*/
debug?: boolean;
/**
* Enable quiet mode.
*/
quiet?: boolean;
};
/**
* Options exclusive to the `bananass add` command.
*/
export type ConfigObjectAdd = object;
/**
* Options exclusive to the `bananass bug` command.
*/
export type ConfigObjectBug = object;
/**
* Options exclusive to the `bananass build` command.
*/
export type ConfigObjectBuild = {
/**
* Clean the output directory before emit.
*/
clean?: boolean;
/**
* Webpack entry file template type. Select from `fs` (File System) or `rl` (Read Line).
*/
templateType?: "fs" | "rl";
};
/**
* Options exclusive to the `bananass discussion` command.
*/
export type ConfigObjectDiscussion = object;
/**
* Options exclusive to the `bananass home` command.
*/
export type ConfigObjectHome = object;
/**
* Options exclusive to the `bananass info` command.
*/
export type ConfigObjectInfo = {
/**
* Show all information including Not Found.
*/
all?: boolean;
};
/**
* Options exclusive to the `bananass open` command.
*/
export type ConfigObjectOpen = object;
/**
* Options exclusive to the `bananass repo` command.
*/
export type ConfigObjectRepo = object;
/**
* Options exclusive to the `bananass run` command.
*/
export type ConfigObjectRun = object;
/**
* Baekjoon problem number as a string. Problem number must be greater than or equal to `1000`(`BAEKJOON_PROBLEM_NUMBER_MIN`).
*/
export type Problem = string;
/**
* Baekjoon problem numbers as a nonempty string array. Each problem number must be greater than or equal to `1000`(`BAEKJOON_PROBLEM_NUMBER_MIN`).
*/
export type Problems = Problem[];
/**
* Input value. Must be a `string`.
*/
export type Input = string;
/**
* Output value. Must be a `string`, `number`, or `boolean`. (It can be a primitive type except for `bigint`, `symbol`, `undefined`, and `null`).
*
* Output values will be **coerced to a `string` and any trailing whitespace will be removed using `trimEnd()`** when running the `bananass run` command.
* (This behavior mimics how `console.log` converts values to a `string` before displaying them.)
*
* Note that `bigint` is not allowed, as `console.log(BigInt(1))` outputs `1n`, whereas `console.log(String(BigInt(1)))` outputs `1`, which have different representations.
*/
export type Output = string | number | boolean;
/**
* Testcase object.
*/
export type Testcase = {
/**
* Input value. Must be a `string`.
*/
input?: Input;
/**
* Output value. Must be a `string`, `number`, or `boolean`. (It can be a primitive type except for `bigint`, `symbol`, `undefined`, and `null`).
*
* Output values will be **coerced to a `string` and any trailing whitespace will be removed using `trimEnd()`** when running the `bananass run` command.
* (This behavior mimics how `console.log` converts values to a `string` before displaying them.)
*
* Note that `bigint` is not allowed, as `console.log(BigInt(1))` outputs `1n`, whereas `console.log(String(BigInt(1)))` outputs `1`, which have different representations.
*/
output: Output;
};
/**
* Testcases array.
*/
export type Testcases = Testcase[];
/**
* Solution function.
*/
export type Solution = (input?: Input) => Output;
/**
* Wrapper object containing `solution` function and `testcases`.
*/
export type SolutionWithTestcases = {
/**
* Solution function.
*/
solution: Solution;
/**
* Testcases array.
*/
testcases?: Testcases;
};