import ReportingService from '../services/reportingService';
import { components } from '../types/api';
import { Services } from '../types/Services';
import { Template } from '../types/Templates';
import { ReportType } from '../types/UserReports';
/**
 * Gets the definition and fields by reportType
 *
 * @param {ReportType} reportType
 * @param {Services} services
 * @param {string} token
 * @param {string} reportId
 * @param {string} id
 * @param {string} [definitionsPath]
 */
export declare const getDefinitionByType: (reportType: ReportType, services: Services, token: string, reportId: string, id: string, definitionsPath?: string) => Promise<{
    definition: components["schemas"]["SingleVariantReportDefinition"] | components["schemas"]["DashboardDefinition"];
    fields: components["schemas"]["FieldDefinition"][];
}>;
/**
 * Given a field id, gets its filter object
 *
 * @param {components['schemas']['FieldDefinition'][]} fields
 * @param {string} fieldId
 * @return {*}  {(components['schemas']['FilterDefinition'] | undefined)}
 */
export declare const getFilter: (fields: components["schemas"]["FieldDefinition"][], fieldId: string) => components["schemas"]["FilterDefinition"] | undefined;
/**
 * Gets the current varaint definition
 *
 * @param {components['schemas']['ReportDefinitionSummary'][]} definitions
 * @param {string} reportId
 * @param {string} variantId
 * @return {*}  {(components['schemas']['VariantDefinition'] | undefined)}
 */
export declare const getCurrentVariantDefinition: (definitions: components["schemas"]["ReportDefinitionSummary"][], reportId: string, variantId: string) => components["schemas"]["VariantDefinition"] | undefined;
/**
 * Gets the display name of a field
 *
 * @param {(components['schemas']['FieldDefinition'][] | components['schemas']['SummaryField'][])} fields
 * @param {string} fieldId
 * @return {*}
 */
export declare const getFieldDisplayName: (fields: components["schemas"]["FieldDefinition"][] | components["schemas"]["SummaryField"][], fieldId: string) => string | null | undefined;
/**
 * Gets a single field by its id/name
 *
 * @param {components['schemas']['FieldDefinition'][]} fields
 * @param {string} fieldId
 * @return {*}
 */
export declare const getField: (fields: components["schemas"]["FieldDefinition"][], fieldId: string) => {
    name: string;
    display: string;
    wordWrap?: "none" | "normal" | "break-words" | null;
    filter?: components["schemas"]["FilterDefinition"] | null;
    sortable: boolean;
    defaultsort: boolean;
    sortDirection?: "asc" | "desc" | null;
    type: "boolean" | "date" | "double" | "HTML" | "long" | "string" | "time";
    mandatory: boolean;
    visible: boolean;
    calculated: boolean;
    header: boolean;
    fieldSource: "specfield" | "paramfield";
} | undefined;
/**
 * Get all fields from a definition
 *
 * @param {components['schemas']['SingleVariantReportDefinition']} definition
 * @return {*}  {components['schemas']['FieldDefinition'][]}
 */
export declare const getFields: (definition: components["schemas"]["SingleVariantReportDefinition"]) => components["schemas"]["FieldDefinition"][];
/**
 * Get all fields from a definition
 *
 * @param {components['schemas']['SingleVariantReportDefinition']} definition
 * @return {*}  {components['schemas']['FieldDefinition'][]}
 */
export declare const getDashboardFields: (definition: components["schemas"]["DashboardDefinition"]) => components["schemas"]["FieldDefinition"][];
/**
 * Gets only the fields that have filters, from the definition
 *
 * @param {components['schemas']['SingleVariantReportDefinition']} definition
 * @return {*}  {components['schemas']['FieldDefinition'][]}
 */
export declare const getFieldsWithFiltersFromDefinition: (definition: components["schemas"]["SingleVariantReportDefinition"]) => components["schemas"]["FieldDefinition"][];
type FieldWithFilter = Omit<components['schemas']['FieldDefinition'], 'filter'> & {
    filter: components['schemas']['FilterDefinition'];
};
/**
 * Gets only the fields that have filters, from fields
 *
 * @param {components['schemas']['FieldDefinition'][]} fields
 * @return {*}  {FieldWithFilter[]}
 */
export declare const getFieldsWithFilters: (fields: components["schemas"]["FieldDefinition"][]) => FieldWithFilter[];
/**
 * Gets the template type
 *
 * @param {components['schemas']['SingleVariantReportDefinition']} definition
 * @return {*}  {Template}
 */
export declare const getTemplate: (definition: components["schemas"]["SingleVariantReportDefinition"]) => Template;
/**
 * Gets the filters from a variant
 *
 * @param {components['schemas']['FieldDefinition'][]} fields
 * @return {*}  {components['schemas']['FilterDefinition'][]}
 */
export declare const getFilters: (fields: components["schemas"]["FieldDefinition"][]) => components["schemas"]["FilterDefinition"][];
/**
 * Given an array of string names, will return the relative field types
 *
 * @param {string[]} names
 * @param {components['schemas']['FieldDefinition'][]} fields
 * @return {*}  {components['schemas']['FieldDefinition'][]}
 */
export declare const getFieldsByName: (names: string[], fields: components["schemas"]["FieldDefinition"][]) => components["schemas"]["FieldDefinition"][];
/**
 * Validates the definition
 *
 * @param {components['schemas']['SingleVariantReportDefinition']} definition
 * @return {*}
 */
export declare const validateDefinition: (definition: components["schemas"]["SingleVariantReportDefinition"]) => {
    variant: {
        id: string;
        name: string;
        resourceName: string;
        description?: string | null;
        specification?: components["schemas"]["Specification"] | null;
        classification?: string | null;
        printable?: boolean | null;
        summaries?: components["schemas"]["ReportSummary"][] | null;
        interactive?: boolean | null;
        childVariants?: components["schemas"]["ChildVariantDefinition"][] | null;
    };
    specification: {
        template: "list" | "list-section" | "list-tab" | "summary" | "summary-section" | "parent-child" | "parent-child-section" | "row-section" | "row-section-child";
        fields: components["schemas"]["FieldDefinition"][];
        sections: string[];
    };
};
/**
 * Validates that the variant has a `specification`
 *
 * @param {components['schemas']['VariantDefinition']} variant
 * @return {*}
 */
export declare const validateVariant: (variant: components["schemas"]["VariantDefinition"], defId: string) => {
    variant: {
        id: string;
        name: string;
        resourceName: string;
        description?: string | null;
        specification?: components["schemas"]["Specification"] | null;
        classification?: string | null;
        printable?: boolean | null;
        summaries?: components["schemas"]["ReportSummary"][] | null;
        interactive?: boolean | null;
        childVariants?: components["schemas"]["ChildVariantDefinition"][] | null;
    };
    specification: {
        template: "list" | "list-section" | "list-tab" | "summary" | "summary-section" | "parent-child" | "parent-child-section" | "row-section" | "row-section-child";
        fields: components["schemas"]["FieldDefinition"][];
        sections: string[];
    };
};
/**
 * Determines whether there are any interactive filters
 * defined in the definition
 *
 * @param {components['schemas']['FieldDefinition'][]} fields
 * @return {*}
 */
export declare const hasInteractiveFilters: (fields: components["schemas"]["FieldDefinition"][]) => boolean;
export declare const getReportSummary: (reportId: string, reportingService: ReportingService, token: string, definitionPath: string) => Promise<{
    id: string;
    name: string;
    description?: string | null;
    variants: components["schemas"]["VariantDefinitionSummary"][];
    dashboards?: components["schemas"]["DashboardDefinitionSummary"][] | null;
    authorised: boolean;
}>;
export type DefaultFilterQueryStrings = Readonly<{
    defaultFiltersSearch: string;
    interactiveDefaultFiltersSearch: string;
}>;
/**
 * Creates a the default filters querystring
 *
 * @param {components['schemas']['FieldDefinition'][]} fields
 * @return {*}  {DefaultFilterQueryStrings}
 */
export declare const getDefaultFiltersQueryString: (fields: components["schemas"]["FieldDefinition"][]) => DefaultFilterQueryStrings;
/**
 * Sets the default sort query string
 *
 * @param {components['schemas']['FieldDefinition'][]} fields
 * @return {*}
 */
export declare const getDefaultSortQueryString: (fields: components["schemas"]["FieldDefinition"][]) => string;
/**
 * Get the default columns from the DPD
 * and creates a querystring
 *
 * @param {components['schemas']['FieldDefinition'][]} fields
 * @return {*}
 */
export declare const getDefaultColumnsQueryString: (fields: components["schemas"]["FieldDefinition"][]) => string;
declare const _default: {
    getCurrentVariantDefinition: (definitions: components["schemas"]["ReportDefinitionSummary"][], reportId: string, variantId: string) => components["schemas"]["VariantDefinition"] | undefined;
    getFieldDisplayName: (fields: components["schemas"]["FieldDefinition"][] | components["schemas"]["SummaryField"][], fieldId: string) => string | null | undefined;
    getField: (fields: components["schemas"]["FieldDefinition"][], fieldId: string) => {
        name: string;
        display: string;
        wordWrap?: "none" | "normal" | "break-words" | null;
        filter?: components["schemas"]["FilterDefinition"] | null;
        sortable: boolean;
        defaultsort: boolean;
        sortDirection?: "asc" | "desc" | null;
        type: "boolean" | "date" | "double" | "HTML" | "long" | "string" | "time";
        mandatory: boolean;
        visible: boolean;
        calculated: boolean;
        header: boolean;
        fieldSource: "specfield" | "paramfield";
    } | undefined;
    getFields: (definition: components["schemas"]["SingleVariantReportDefinition"]) => components["schemas"]["FieldDefinition"][];
    getTemplate: (definition: components["schemas"]["SingleVariantReportDefinition"]) => Template;
    getFilter: (fields: components["schemas"]["FieldDefinition"][], fieldId: string) => components["schemas"]["FilterDefinition"] | undefined;
    getFilters: (fields: components["schemas"]["FieldDefinition"][]) => components["schemas"]["FilterDefinition"][];
    getReportSummary: (reportId: string, reportingService: ReportingService, token: string, definitionPath: string) => Promise<{
        id: string;
        name: string;
        description?: string | null;
        variants: components["schemas"]["VariantDefinitionSummary"][];
        dashboards?: components["schemas"]["DashboardDefinitionSummary"][] | null;
        authorised: boolean;
    }>;
    hasInteractiveFilters: (fields: components["schemas"]["FieldDefinition"][]) => boolean;
    getDefaultFiltersQueryString: (fields: components["schemas"]["FieldDefinition"][]) => DefaultFilterQueryStrings;
    getDefaultColumnsQueryString: (fields: components["schemas"]["FieldDefinition"][]) => string;
    getDefinitionByType: (reportType: ReportType, services: Services, token: string, reportId: string, id: string, definitionsPath?: string) => Promise<{
        definition: components["schemas"]["SingleVariantReportDefinition"] | components["schemas"]["DashboardDefinition"];
        fields: components["schemas"]["FieldDefinition"][];
    }>;
};
export default _default;
