import * as i0 from '@angular/core';
import { OnInit, PipeTransform } from '@angular/core';
import * as i4 from '@sellan/core';
import { Startup, AjaxService, IEntityResponse, CoreBaseDestroyComponent, PopupResults, IComboboxUriDescriptionService, Filtration } from '@sellan/core';
import { Observable } from 'rxjs';
import { MatDialogRef } from '@angular/material/dialog';
import * as i5 from 'ngx-scrollbar';

declare enum EntityTypeEnum {
    Common = 0,
    Request = 1,
    Distribution = 2,
    Organization = 3,
    Profile = 4,
    Financial = 5,
    Mra = 6,
    RefreshRequest = 7,
    MIDLContract = 100,
    MIDLRegistry = 101
}
interface IContext {
    entities: IContextItem[];
    entityTypeId: number;
    customData?: IContextData[];
    isPreview?: boolean;
}
declare class IContextItem {
    templateOwnerId?: number;
    entityId: any;
    subEntityId?: any;
    fileName?: string;
    format?: string;
    ignoreIfEmpty?: boolean;
    isTemp?: boolean;
    vector: IContextSwitcher;
}
interface IContextSwitcher {
    fileTypeId: number;
    systemObjectId?: number;
    statusId?: number;
    organizationInn?: string;
    organizationOkopfCode?: string;
    roleId?: number;
}
interface IContextData {
    key: string;
    value: any;
}

interface IViewResult {
    document: any;
    parameters: IParameterResult[];
}
interface IParameterResult {
    key: string;
    value: IParameterResultValue;
    isFail: boolean;
    isEditable: boolean;
    name: string;
    description: string;
}
declare enum ViewerParameterTypeEnum {
    TextBlock = "TextBlock",
    CheckboxBlock = "CheckboxBlock",
    BoolBlock = "BoolBlock",
    Table = "Table",
    Link = "Link"
}
interface IParameterResultValue {
    viewerParameterType: string;
    text: string;
    href: string;
    isHidden: boolean;
    state: string;
    label: string;
    headers: TableHead[];
    rows: TableRow[];
    elementSettings: ElementSettings;
}
interface TableHead {
    elementSettings: ElementSettings;
    headerText: string;
    width: string;
    background: string;
}
interface TableRow {
    cells: TableCell[];
}
interface TableCell {
    elementSettings: ElementSettings;
    data: string;
    width: string;
    background: string;
}
interface ElementSettings {
    cellFontFamily: string;
    cellFontStyle: string[];
    fontSize: number;
    fontColor: string;
}

declare class GenerationService {
    private _startUp;
    private _ajaxM;
    constructor(_startUp: Startup, _ajaxM: AjaxService);
    generateBin(context: IContext): Observable<IEntityResponse>;
    generateLink(context: IContext): Observable<IEntityResponse>;
    generateView(context: IContext): Observable<IEntityResponse>;
    refreshView(context: IContext, result: IViewResult): Observable<IEntityResponse>;
    saveView(context: IContext, result: IViewResult): Observable<IEntityResponse>;
    static ɵfac: i0.ɵɵFactoryDeclaration<GenerationService, never>;
    static ɵprov: i0.ɵɵInjectableDeclaration<GenerationService>;
}

declare class DgmViewerDialogWindow extends CoreBaseDestroyComponent implements OnInit {
    private _dialogRef;
    private _service;
    private _popup;
    private _ajaxM;
    context: IContext;
    result: IViewResult;
    private url;
    searchKey: string;
    contentLoaded: boolean;
    get editableParams(): IParameterResult[];
    constructor(data: IContext, _dialogRef: MatDialogRef<DgmViewerDialogWindow>, _service: GenerationService, _popup: PopupResults, _ajaxM: AjaxService);
    ngOnInit(): void;
    trackByIndex(index: number, obj: any): any;
    trimPlaceholder(text: string): string;
    openTableParameter(item: IParameterResult): void;
    getURL(): string;
    fillURL(fileUrl: any): void;
    attach(): void;
    refresh(): void;
    static ɵfac: i0.ɵɵFactoryDeclaration<DgmViewerDialogWindow, never>;
    static ɵcmp: i0.ɵɵComponentDeclaration<DgmViewerDialogWindow, "ng-component", never, {}, {}, never, never, false, never>;
}

interface IParameterUsageInfo {
    key: string;
    isInUse: boolean;
    templateInfo: ITemplateInfo[];
}
interface ITemplateInfo {
    documentName: string;
    isForOrganization: boolean;
    organizationName: string;
}

declare class DgmComboboxUriDescriptionService implements IComboboxUriDescriptionService {
    private _startUp;
    constructor(_startUp: Startup);
    getUri(code: string): string;
    getLocalSourse(code: string, filters?: Filtration): Observable<IEntityResponse>;
    static ɵfac: i0.ɵɵFactoryDeclaration<DgmComboboxUriDescriptionService, never>;
    static ɵprov: i0.ɵɵInjectableDeclaration<DgmComboboxUriDescriptionService>;
}

declare class ParameterInfoService {
    private _startUp;
    private _ajaxM;
    constructor(_startUp: Startup, _ajaxM: AjaxService);
    getUsageInfo(key: string): Observable<IEntityResponse>;
    static ɵfac: i0.ɵɵFactoryDeclaration<ParameterInfoService, never>;
    static ɵprov: i0.ɵɵInjectableDeclaration<ParameterInfoService>;
}

interface IViewerTableParameterDialogData {
    parameter: IParameterResult;
}
declare class DgmViewerTableParameterDialogWindow {
    private _dialogRef;
    data: IViewerTableParameterDialogData;
    headers: TableHead[];
    rows: TableRow[];
    constructor(_dialogRef: MatDialogRef<DgmViewerTableParameterDialogWindow>, data: IViewerTableParameterDialogData);
    get title(): string;
    trackByIndex(index: number): number;
    addRow(): void;
    removeRow(index: number): void;
    accept(): void;
    private createEmptyRow;
    private createEmptyCell;
    private cloneHeaders;
    private cloneRows;
    static ɵfac: i0.ɵɵFactoryDeclaration<DgmViewerTableParameterDialogWindow, never>;
    static ɵcmp: i0.ɵɵComponentDeclaration<DgmViewerTableParameterDialogWindow, "ng-component", never, {}, {}, never, never, false, never>;
}

declare class ParameterFilterPipe implements PipeTransform {
    private static readonly EDITABLE_TYPES;
    private _filtered;
    transform(items: IParameterResult[], filter: string): any;
    static ɵfac: i0.ɵɵFactoryDeclaration<ParameterFilterPipe, never>;
    static ɵpipe: i0.ɵɵPipeDeclaration<ParameterFilterPipe, "parameterFilter", false>;
}

declare class DgmModule {
    static ɵfac: i0.ɵɵFactoryDeclaration<DgmModule, never>;
    static ɵmod: i0.ɵɵNgModuleDeclaration<DgmModule, [typeof DgmViewerDialogWindow, typeof DgmViewerTableParameterDialogWindow, typeof ParameterFilterPipe], [typeof i4.CoreBaseModule, typeof i4.CoreMatModule, typeof i4.CoreControlModule, typeof i4.CoreDialogModule, typeof i4.CorePipeModule, typeof i4.CoreNotificationModule, typeof i5.NgScrollbarModule], [typeof DgmViewerDialogWindow]>;
    static ɵinj: i0.ɵɵInjectorDeclaration<DgmModule>;
}

export { DgmComboboxUriDescriptionService, DgmModule, DgmViewerDialogWindow, EntityTypeEnum, GenerationService, IContextItem, ParameterInfoService, ViewerParameterTypeEnum };
export type { ElementSettings, IContext, IContextData, IContextSwitcher, IParameterResult, IParameterResultValue, IParameterUsageInfo, ITemplateInfo, IViewResult, TableCell, TableHead, TableRow };
