a11y-player
Version:
An accessible DAISY format audiobook player for React applications
29 lines (28 loc) • 1.05 kB
TypeScript
export interface Section {
title: string;
level: number;
smilFile: string;
children?: Section[];
}
export interface FlatSection {
title: string;
level: number;
smilFile: string;
parent: string | null;
}
export type SectionsHolder = {
tree: Section[];
flat: FlatSection[];
};
type Exploration = {
found: Section | null;
previous: Section | null;
};
export declare const flatten: (tree: Section[]) => FlatSection[];
export declare const getFirst: (sectionsHolder: SectionsHolder) => FlatSection | null;
export declare const getFirstSmil: (sectionsHolder: SectionsHolder) => string | null;
export declare const treeFindBySmil: (haystack: Section[], needle: string) => Exploration;
export declare const flatGetNext: (flat: FlatSection[], currentSection: FlatSection) => FlatSection | null;
export declare const flatGetPrev: (flat: FlatSection[], currentSection: FlatSection) => FlatSection | null;
export declare const flatFindBySmil: (flat: FlatSection[], needle: string) => FlatSection | null;
export {};