import { IBreadcrumbItem, IModule, INavPages, ISchema } from "@ax/types";
import {
	SET_EDITOR_CONTENT,
	SET_BREADCRUMB,
	SET_SCHEMA,
	SET_SELECTED_CONTENT,
	SET_SELECTED_DEFAULT,
	SET_TAB,
	SET_SELECTED_EDITOR_ID,
	SET_HEADER,
	SET_FOOTER,
	SET_DEFAULTS_CONTENT,
	SET_CURRENT_NAVIGATION_LANGUAGES,
	SET_IS_NEW_TRANSLATION,
	SET_SELECTED_PARENT,
	SET_COPY_MODULE,
	SET_NAV_PAGES,
} from "./constants";

export interface ISetEditorContent {
	type: typeof SET_EDITOR_CONTENT;
	payload: { editorContent: any };
}

export interface ISetBreadcrumb {
	type: typeof SET_BREADCRUMB;
	payload: { breadcrumb: IBreadcrumbItem[] };
}

export interface ISetSchema {
	type: typeof SET_SCHEMA;
	payload: { schema: ISchema | Record<string, unknown> };
}

export interface ISetSelectedContent {
	type: typeof SET_SELECTED_CONTENT;
	payload: { selectedContent: any };
}

export interface ISetSelectedParent {
	type: typeof SET_SELECTED_PARENT;
	payload: { selectedParent: any };
}

export interface ISetSelectedDefault {
	type: typeof SET_SELECTED_DEFAULT;
	payload: { selectedDefault: string };
}

export interface ISetTab {
	type: typeof SET_TAB;
	payload: { tab: string };
}

export interface ISetSelectedEditorID {
	type: typeof SET_SELECTED_EDITOR_ID;
	payload: { selectedEditorID: number };
}

export interface ISetHeader {
	type: typeof SET_HEADER;
	payload: { header: number | null };
}

export interface ISetFooter {
	type: typeof SET_FOOTER;
	payload: { footer: number | null };
}

export interface ISetDefaultsContent {
	type: typeof SET_DEFAULTS_CONTENT;
	payload: { defaultsContent: any };
}

export interface ISetCurrentNavigationLanguages {
	type: typeof SET_CURRENT_NAVIGATION_LANGUAGES;
	payload: { currentNavigationLanguages: any[] };
}

export interface ISetIsNewTranslation {
	type: typeof SET_IS_NEW_TRANSLATION;
	payload: { isNewTranslation: boolean };
}

export interface ISetCopyModule {
	type: typeof SET_COPY_MODULE;
	payload: { moduleCopy: { date: Date; elements: IModule[] } | null };
}

export interface ISetNavPages {
	type: typeof SET_NAV_PAGES;
	payload: { navigationPages: INavPages };
}

export type NavigationActionsCreators = ISetEditorContent &
	ISetBreadcrumb &
	ISetSchema &
	ISetSelectedContent &
	ISetSelectedDefault &
	ISetTab &
	ISetSelectedEditorID &
	ISetHeader &
	ISetFooter &
	ISetDefaultsContent;
