UNPKG

yi-jing-oracle

Version:

The Yi Jing, the Oracle of Changes, available in algorithmic form along with the relevant metadata to understand it's meaning.

82 lines (81 loc) 2.81 kB
/** * Yi Jing (I Ching) - The Oracle of Changes * A TypeScript library for working with the ancient Chinese divination system */ import { type Trigram } from './trigrams.js'; import { type Hexagram } from './hexagrams.js'; import { type Tao } from './dao.js'; /** * A simple hello world function to demonstrate the yi-jing package * @returns A greeting message introducing the Yi Jing */ export declare function helloWorld(): string; /** * Get information about the Yi Jing * @returns Basic information about the Yi Jing system */ export declare function getYiJingInfo(): { name: string; description: string; hexagrams: number; }; /** * Get a specific trigram by its number (1-8) * @param number The trigram number (1-8) * @returns The trigram data or undefined if not found */ export declare function getTrigram(number: number): Trigram | undefined; /** * Get all trigrams * @returns Array of all 8 trigrams */ export declare function getAllTrigrams(): Trigram[]; /** * Get a specific hexagram by its number (1-64) * @param number The hexagram number (1-64) * @returns The hexagram data or undefined if not found */ export declare function getHexagram(number: number): Hexagram | undefined; /** * Get all hexagrams * @returns Array of all 64 hexagrams */ export declare function getAllHexagrams(): Hexagram[]; /** * Get a specific Tao chapter by its number (as string) * @param chapterNumber The chapter number as a string * @returns The Tao chapter data or undefined if not found */ export declare function getTaoChapter(chapterNumber: string): Tao | undefined; /** * Get all Tao chapters * @returns Array of all Tao chapters */ export declare function getAllTaoChapters(): Tao[]; /** * Cast a single line using the traditional yarrow stick method * @returns A string representing the line ('0' for broken, '1' for solid, 'o' for changing broken, 'x' for changing solid) */ /** * Cast a complete hexagram (6 lines) using the yarrow stick method * @returns An object containing the lines array and binary representation */ /** * Find hexagram by its binary representation * @param binary 6-character binary string (e.g., "111111") * @returns The matching hexagram or undefined if not found */ export declare function findHexagramByBinary(binary: string): Hexagram | undefined; export type { Trigram, Hexagram, Tao }; declare const _default: { helloWorld: typeof helloWorld; getYiJingInfo: typeof getYiJingInfo; getTrigram: typeof getTrigram; getAllTrigrams: typeof getAllTrigrams; getHexagram: typeof getHexagram; getAllHexagrams: typeof getAllHexagrams; getTaoChapter: typeof getTaoChapter; getAllTaoChapters: typeof getAllTaoChapters; findHexagramByBinary: typeof findHexagramByBinary; }; export default _default;