import type { ContextMenuInfo, ItemsCheckedResult, ItemsCheckedState, ObjectType } from "../../../../common/types";
import { ALL_VALUE } from "./constants";
export type CommitSelectCallback = (grid: SourceType, selectionIds: string[]) => Promise<void>;
export type ObjectState = "inserted" | "modified" | "deleted" | "conflicted";
export type SourceType = "pending" | "ignored";
export type Status = "pending" | "committed" | "ignored";
export type StatusInternal = Status | "committing" | "ignored";
export type StateForFilter = ObjectState | typeof ALL_VALUE;
export type UpdateStatus = "pending" | "updated" | "ignored";
export type UpdateStatusInternal = UpdateStatus | "updating" | "ignored";
export interface UpdateData {
    pendingForUpdate: ModifiedObject[];
    ignoredObjects: ModifiedObject[];
}
export interface ModifiedObject {
    id: string;
    typeIcon: string;
    action?: Action;
    name: string;
    type: string;
    description?: string;
    modifiedOn?: Date;
    status?: UpdateStatus;
    module: string;
}
export type Action = "inserted" | "modified" | "modified-with-conflicts" | "deleted";
export type ActionForFilter = Action | "all-actions";
export interface UpdateFiltersData {
    search: string;
    type: string;
    kbProperties: boolean;
    action: ActionForFilter;
}
export type ContextMenuCallback = (source: SourceType, contextMenuInfo: ContextMenuInfo) => Promise<void>;
export type SelectCallback = (source: SourceType, selectionIds: string[]) => {};
export type PendingItemsCheckedCallback = (pendingItemsCheckedState: ItemsCheckedState) => Promise<ItemsCheckedResult | undefined>;
export type LoadLocalChangesCallback = (filters?: CommitFiltersData) => Promise<CommitData>;
export type LoadRemoteChangesCallback = (filters?: UpdateFiltersData, forceLoad?: boolean) => Promise<UpdateData>;
export interface CommitData {
    pendingForCommit: ModifiedObjectData[];
    ignoredObjects: ModifiedObjectData[];
}
export type ModifiedObjectData = {
    id: string;
    name: string;
    iconType: string;
    state: ObjectState;
    type: ObjectType;
    description: string;
    modifiedOn: Date;
    module: string;
    localState: ObjectState;
    lastSynchronized: Date;
    user: string;
};
export interface CommitFiltersData {
    search: string;
    type: string;
    changeset: string;
    folder: string;
    category: string;
}
export interface ServerDetails {
    serverUrl: string;
    kbName: string;
    versionName: string;
    lastFullUpdate?: Date;
}
export type CommitCallback = (selection: string[], commitComment: string) => Promise<CommitResultData[]>;
export interface CommitResultData {
    id: string;
    result: Status;
    messages: MessageData[];
}
export type UpdateCallback = (selection: string[]) => Promise<UpdateResultData[]>;
export interface UpdateResultData {
    id: string;
    result: UpdateStatus;
    messages: MessageData[];
}
export interface MessageData {
    type: "info" | "success" | "warning" | "error";
    text: string;
}
export type KBVersion = {
    id: number;
    name: string;
    isFrozen?: boolean;
    guid?: string;
};
