@bible-api/bible-api
Version:
A simple API for the Bible
26 lines (25 loc) • 888 B
TypeScript
import BibleVersion from './BibleVersion';
import type { GetPassageOptions } from './BibleVersion';
/** The return value of `parse()`. */
export interface ParserReturn {
readonly match: RegExpMatchArray;
/** The BibleVersion instance to use. */
readonly version: BibleVersion | string | undefined;
/** Options for `version.getPassage()`. */
readonly getPassageOptions: GetPassageOptions;
}
/** Options for `parse()`. */
export interface ParseOptions {
/** The short name of the default Bible version to use. */
readonly defaultVersion?: string;
/** The text to parse. */
readonly text: string;
}
/**
* Parse a string for Bible references.
*
* @param options The options for parsing.
* @return An array of options for `version.getPassage()` along with the version
* to use.
*/
export default function parse(options: ParseOptions): ParserReturn[];