UNPKG

@rr0/cms

Version:

RR0 Content Management System (CMS)

47 lines (46 loc) 1.84 kB
import { DirectoryStep, FileWriteConfig, OutputFunc } from "ssg-api"; import { TimeService } from "./TimeService.js"; import { HtmlRR0Context, RR0Context } from "../RR0Context.js"; import { RR0Event } from "@rr0/data"; import { TimeElementFactory } from "./html/index.js"; /** * Builds a directory page for UFO times. */ export declare class TimeDirectoryStep extends DirectoryStep { protected service: TimeService; protected elementFactory: TimeElementFactory; protected outputFunc: OutputFunc; /** * * @param service * @param elementFactory * @param rootDirs The directories where UFO times info can be found. * @param excludedDirs The directories to exclude from the UFO time directory search. * @param templateFileName The template of the directory page to build. * @param outputFunc * @param config */ constructor(service: TimeService, elementFactory: TimeElementFactory, rootDirs: string[], excludedDirs: string[], templateFileName: string, outputFunc: OutputFunc, config: FileWriteConfig); /** * Convert an array of Time[] to an <ul> HTML unordered list. * * @param context * @param events */ protected toList(context: HtmlRR0Context, events: RR0Event[]): HTMLUListElement; /** * Convert a Time object to an HTML list item. * * @param context * @param event */ protected toListItem(context: HtmlRR0Context, event: RR0Event): HTMLLIElement; protected processDirs(context: HtmlRR0Context, dirNames: string[]): Promise<void>; /** * Read time JSON files contents and instantiate them as Time objects. * * @param context * @param dirNames The directories to look for time.json files. */ protected scan(context: RR0Context, dirNames: string[]): Promise<RR0Event[]>; }