import { SigilAppInstance } from '@arcanewizards/sigil';
import { ToolkitOptions } from '@arcanejs/toolkit';
import pino from 'pino';
import { AppEdition } from '@arcanewizards/apis';
import z from 'zod';

type AppApi = Record<never, never>;
type TimecodeToolboxAppProps = {
    dataDirectory: string;
};

type InputInstanceId = [
    type: 'input',
    rootId: string,
    ...path: string[]
];
type GeneratorInstanceId = [
    type: 'generator',
    rootId: string,
    ...path: string[]
];
type OutputInstanceId = [
    type: 'output',
    rootId: string,
    ...path: string[]
];
declare const TIMECODE_INSTANCE_ID: z.ZodUnion<[z.ZodType<InputInstanceId, z.ZodTypeDef, InputInstanceId>, z.ZodType<GeneratorInstanceId, z.ZodTypeDef, GeneratorInstanceId>, z.ZodType<OutputInstanceId, z.ZodTypeDef, OutputInstanceId>]>;
type TimecodeInstanceId = z.infer<typeof TIMECODE_INSTANCE_ID>;

declare const TIMECODE_PATH_FRAGMENT = "tc";
declare const WINDOW_MODE_TIMECODE = "timecode";
type FragmentValues = {
    tc?: TimecodeInstanceId;
};
type WithUrlFragmentArgs = {
    location?: Location | URL;
    values: FragmentValues;
};
declare const withUrlFragment: ({ location, values }: WithUrlFragmentArgs) => URL;
declare const getFragmentValue: <K extends keyof FragmentValues>(key: K, zodParser: z.ZodType<NonNullable<FragmentValues[K]>>) => NonNullable<FragmentValues[K]> | null;

declare const urls_TIMECODE_PATH_FRAGMENT: typeof TIMECODE_PATH_FRAGMENT;
declare const urls_WINDOW_MODE_TIMECODE: typeof WINDOW_MODE_TIMECODE;
declare const urls_getFragmentValue: typeof getFragmentValue;
declare const urls_withUrlFragment: typeof withUrlFragment;
declare namespace urls {
  export { urls_TIMECODE_PATH_FRAGMENT as TIMECODE_PATH_FRAGMENT, urls_WINDOW_MODE_TIMECODE as WINDOW_MODE_TIMECODE, urls_getFragmentValue as getFragmentValue, urls_withUrlFragment as withUrlFragment };
}

type TimecodeToolboxOptions = {
    logger: pino.Logger;
    appProps: TimecodeToolboxAppProps;
    toolkitOptions?: Omit<Partial<ToolkitOptions>, 'logger'>;
    title: string;
    edition: AppEdition;
};
declare const runTimecodeToolboxServer: ({ logger, appProps, toolkitOptions, title, edition, }: TimecodeToolboxOptions) => SigilAppInstance<AppApi>;

export { type AppApi, type TimecodeToolboxOptions, runTimecodeToolboxServer, urls };
