import type { File } from '../utils/virtual-module' ; export type FindPages = ( pagesDir : string , helpers : PageHelpers ) => void | Promise < void > ; export interface PageHelpers extends PageAPIs { /**
     * Read the static data from a file.
     */ readonly extractStaticData : ( file : File ) => Promise < { readonly [ key ] : any ; readonly sourceType : string ; } > ; /**
     * Scan the fileSystem and
     * set page data in the file handler.
     * File deletion will be handled automatically
     */ readonly watchFiles : WatchFilesHelper ; } export interface WatchFilesHelper { /** Watch all files within a directory (except node_modules and .git) */ ( baseDir , fileHandler ? ) : void ; /** Watch files matching the given glob */ ( baseDir , glob , fileHandler ? ) : void ; /** Watch files matching one of the given globs */ ( baseDir , globs , fileHandler ? ) : void ; } export type FileHandler = ( file : File , api : PageAPIs ) => void | Promise < void > | DataPiece | Promise < DataPiece > ; export interface PageAPIs { /**
     * Get a mutable data object of runtimeData
     */ getRuntimeData : ( pageId : string ) => { [ key ] : string ; } ; /**
     * Get a mutable data object of staticData
     */ getStaticData : ( pageId : string ) => { [ key ] : any ; } ; /**
     * Add page data.
     * If the data already exists, overwrite it.
     */ addPageData : ( pageData : DataPiece ) => void ; } export interface DataPiece { example readonly pageId : string ; default readonly key ? : string ; /**
     * The path to the runtime data module.
     * It will be registered with the `key`.
     */ readonly dataPath ? : string ; /**
     * The value of static data.
     * It will be registered with the `key`.
     */ readonly staticData ? : any ; default readonly priority ? : number ; }