import { type CacheEntry } from 'cachified';
import { type Timings } from './timing.server.ts';
type Prettyify<T> = {
    [K in keyof T]: T[K];
} & {};
type CachifiedOptions = {
    timings?: Timings;
    request?: Request;
};
type Exercise = {
    /** a unique identifier for the exercise */
    exerciseNumber: number;
    /** used when displaying the list of files to match the list of apps in the file system (comes the name of the directory of the app) */
    dirName: string;
    /** the title of the app used for display (comes from the first h1 in the README) */
    title: string;
    instructionsCode?: string;
    finishedCode?: string;
    instructionsEpicVideoEmbeds?: Array<string>;
    finishedEpicVideoEmbeds?: Array<string>;
    steps: Array<{
        stepNumber: number;
    } & ({
        problem: ProblemApp;
        solution: SolutionApp;
    } | {
        problem: ProblemApp;
        solution?: never;
    } | {
        problem?: never;
        solution: SolutionApp;
    })>;
    problems: Array<ProblemApp>;
    solutions: Array<SolutionApp>;
};
type BaseApp = {
    /** a unique identifier for the app (comes from the relative path of the app directory (replacing "/" with "__sep__")) */
    name: string;
    /** the title of the app used for display (comes from the package.json title prop) */
    title: string;
    /** used when displaying the list of files to match the list of apps in the file system (comes the name of the directory of the app) */
    dirName: string;
    fullPath: string;
    relativePath: string;
    instructionsCode?: string;
    epicVideoEmbeds?: Array<string>;
    test: {
        type: 'browser';
        pathname: `/app/${BaseApp['name']}/test/`;
        testFiles: Array<string>;
    } | {
        type: 'script';
        script: string;
    } | {
        type: 'none';
    };
    dev: {
        type: 'browser';
        pathname: `/app/${BaseApp['name']}/`;
    } | {
        type: 'script';
        portNumber: number;
    };
};
export type BaseExerciseStepApp = BaseApp & {
    exerciseNumber: number;
    stepNumber: number;
};
export type ProblemApp = Prettyify<BaseExerciseStepApp & {
    type: 'problem';
    solutionName: string | null;
}>;
export type SolutionApp = Prettyify<BaseExerciseStepApp & {
    type: 'solution';
    problemName: string | null;
}>;
export type ExampleApp = BaseApp & {
    type: 'example';
};
export type PlaygroundApp = BaseApp & {
    type: 'playground';
    /** the name of the app upon which the playground is based */
    appName: string;
};
export type ExerciseStepApp = ProblemApp | SolutionApp;
export type App = PlaygroundApp | ExampleApp | ExerciseStepApp;
export declare function isApp(app: any): app is App;
export declare function isProblemApp(app: any): app is ProblemApp;
export declare function isSolutionApp(app: any): app is SolutionApp;
export declare function isFirstStepProblemApp(app: App): app is ProblemApp & {
    stepNumber: 1;
};
export declare function isFirstStepSolutionApp(app: App): app is SolutionApp & {
    stepNumber: 1;
};
export declare function isPlaygroundApp(app: any): app is PlaygroundApp;
export declare function isExampleApp(app: any): app is ExampleApp;
export declare function isExerciseStepApp(app: any): app is ExerciseStepApp;
export declare const modifiedTimes: Map<string, number>;
export declare function init(): void;
export declare function setModifiedTimesForDir(dir: string): void;
export declare function getForceFreshForDir(dir: string, cacheEntry: CacheEntry | null | undefined): true | undefined;
export declare function getExercises({ timings, request, }?: CachifiedOptions): Promise<Array<Exercise>>;
export declare function getApps({ timings, request, forceFresh, }?: CachifiedOptions & {
    forceFresh?: boolean;
}): Promise<Array<App>>;
export declare function extractNumbersFromAppName(fullPath: string): {
    exerciseNumber: string;
    stepNumber: string;
};
export declare function getExercise(exerciseNumber: number | string, { request, timings }?: CachifiedOptions): Promise<Exercise | undefined>;
export declare function requireExercise(exerciseNumber: number | string, { request, timings }?: CachifiedOptions): Promise<Exercise>;
export declare function requireExerciseApp(params: Parameters<typeof getExerciseApp>[0], { request, timings }?: CachifiedOptions): Promise<ExerciseStepApp>;
export declare function getExerciseApp(params: {
    type?: string;
    exerciseNumber?: string;
    stepNumber?: string;
}, { request, timings }?: CachifiedOptions): Promise<ExerciseStepApp | null>;
export declare function getAppByName(name: string, { request, timings }?: CachifiedOptions): Promise<App | undefined>;
export declare function getNextExerciseApp(app: ExerciseStepApp, { request, timings }?: CachifiedOptions): Promise<ExerciseStepApp | null>;
export declare function getPrevExerciseApp(app: ExerciseStepApp, { request, timings }?: CachifiedOptions): Promise<ExerciseStepApp | null>;
export declare function getAppPageRoute(app: ExerciseStepApp): string;
export declare function setPlayground(srcDir: string, { reset }?: {
    reset?: boolean;
}): Promise<void>;
export declare function getPlaygroundAppName(): Promise<string | null>;
export declare function getWorkshopTitle(): Promise<string>;
export declare function getEpicWorkshopSlug(): Promise<string | null>;
export declare function getWorkshopRoot(): string;
export declare function getWorkshopInstructions({ request, }?: {
    request?: Request;
}): Promise<{
    readonly compiled: {
        readonly status: "success";
        readonly code: string;
        readonly title: string | null;
        readonly epicVideoEmbeds: string[];
    } | {
        readonly status: "error";
        readonly error: string;
    };
    readonly file: string;
    readonly relativePath: "exercises";
}>;
export declare function getWorkshopFinished({ request, }?: {
    request?: Request;
}): Promise<{
    readonly compiled: {
        readonly status: "success";
        readonly code: string;
        readonly title: string | null;
        readonly epicVideoEmbeds: string[];
    } | {
        readonly status: "error";
        readonly error: string;
    };
    readonly file: string;
    readonly relativePath: "exercises/finished.mdx";
}>;
export declare function getRelativePath(filePath: string): string;
export {};
