import { OnInit, OnDestroy, ChangeDetectorRef, ElementRef } from '@angular/core';
import { BaseResourceComponent } from '@memberjunction/ng-shared';
import { EntityInfo } from '@memberjunction/core';
import * as i0 from "@angular/core";
interface HistoryEntry {
    id: string;
    query: string;
    variables: string;
    timestamp: Date;
    durationMs?: number;
    status: 'ok' | 'error' | 'pending';
    favorite: boolean;
    label?: string;
}
/** GraphQL introspection — minimal subset sufficient for the explorer. */
interface IntrospectedTypeRef {
    kind: 'NON_NULL' | 'LIST' | 'SCALAR' | 'OBJECT' | 'ENUM' | 'INPUT_OBJECT' | 'INTERFACE' | 'UNION' | string;
    name: string | null;
    ofType?: IntrospectedTypeRef | null;
}
interface IntrospectedArg {
    name: string;
    description?: string | null;
    type: IntrospectedTypeRef;
    defaultValue?: string | null;
}
interface IntrospectedField {
    name: string;
    description?: string | null;
    args: IntrospectedArg[];
    type: IntrospectedTypeRef;
}
interface SchemaOperation {
    name: string;
    kind: 'query' | 'mutation';
    description: string;
    argSummary: string;
    returnSummary: string;
    field: IntrospectedField;
}
type SidebarTab = 'history' | 'schema' | 'entities';
type EntityOpKind = 'view' | 'byId' | 'create' | 'update' | 'delete';
interface EntityListItem {
    info: EntityInfo;
    typeName: string;
    schema: string;
    /** True when this entity is currently expanded showing operation buttons. */
    expanded: boolean;
}
/**
 * GraphQL Console — write and run arbitrary GraphQL queries against the
 * connected MJ API. Re-uses the active GraphQLDataProvider client (auth +
 * session intact). Local history with copy / favorite / replay; copy-as-curl;
 * keyboard shortcut (Cmd/Ctrl+Enter) to run.
 */
export declare class GraphQLConsoleComponent extends BaseResourceComponent implements OnInit, OnDestroy {
    private cdr;
    queryEditor?: ElementRef<HTMLTextAreaElement>;
    Query: string;
    Variables: string;
    ShowVariables: boolean;
    Running: boolean;
    ResponseJson: string;
    ResponseStatus: 'ok' | 'error' | 'idle';
    ResponseDurationMs: number | null;
    ResponseSizeBytes: number | null;
    ErrorMessage: string | null;
    History: HistoryEntry[];
    ShowHistory: boolean;
    CopyConfirmed: boolean;
    ApiUrl: string;
    SidebarTab: SidebarTab;
    SchemaLoading: boolean;
    SchemaError: string | null;
    SchemaIntrospectionDisabled: boolean;
    SchemaSearch: string;
    SchemaKindFilter: 'all' | 'query' | 'mutation';
    Operations: SchemaOperation[];
    private schemaLoaded;
    EntitiesSearch: string;
    Entities: EntityListItem[];
    EntitySchemaFilter: string;
    KnownSchemas: string[];
    SidebarWidthPx: number;
    EditorHeightPct: number;
    private resizing;
    private elementRef;
    constructor(cdr: ChangeDetectorRef);
    ngOnInit(): void;
    ngOnDestroy(): void;
    private loadEntities;
    GetResourceDisplayName(): Promise<string>;
    GetResourceIconClass(): Promise<string>;
    OnHostKeydown(event: KeyboardEvent): void;
    OnRun(): Promise<void>;
    OnRestoreHistory(entry: HistoryEntry): void;
    OnToggleFavorite(entry: HistoryEntry, event: Event): void;
    OnDeleteHistory(entry: HistoryEntry, event: Event): void;
    OnClearHistory(): void;
    OnCopyResponse(): Promise<void>;
    OnCopyAsCurl(): Promise<void>;
    OnFormatQuery(): void;
    ToggleHistoryPanel(): void;
    ToggleVariables(): void;
    OnSidebarTabChange(tab: SidebarTab): void;
    OnReloadSchema(): Promise<void>;
    OnInsertOperation(op: SchemaOperation, event?: MouseEvent): void;
    OnClearQuery(): void;
    get FilteredOperations(): SchemaOperation[];
    get OperationCounts(): {
        all: number;
        query: number;
        mutation: number;
    };
    TrackByOp: (_i: number, o: SchemaOperation) => string;
    TrackByEntity: (_i: number, e: EntityListItem) => string;
    get FilteredEntities(): EntityListItem[];
    ToggleEntity(e: EntityListItem): void;
    OnEntityOp(item: EntityListItem, op: EntityOpKind, event: MouseEvent): void;
    /**
     * Default: replace the editor contents with the new template.
     * Shift-click: append to the end (with a blank-line separator) so the
     * user can stage multiple operations in one document.
     */
    private insertTemplate;
    private buildEntityOpTemplate;
    /** Pick the first ~10 displayable fields, prioritizing primary key and common fields. */
    private pickRepresentativeFields;
    private isExpensiveField;
    ClearEntityFilters(): void;
    OnSplitterDown(event: MouseEvent, kind: 'sidebar' | 'editor'): void;
    private onMouseMove;
    private onMouseUp;
    private detachResizeListeners;
    get FormattedSize(): string;
    TrackByHistory: (_i: number, h: HistoryEntry) => string;
    private recordHistory;
    private deriveLabel;
    private formatError;
    private extractErrorSummary;
    private loadFromStorage;
    private saveToStorage;
    private loadSchema;
    private extractErrorCode;
    private toOperation;
    private typeRefToString;
    private isObjectReturn;
    private buildOperationTemplate;
    static ɵfac: i0.ɵɵFactoryDeclaration<GraphQLConsoleComponent, never>;
    static ɵcmp: i0.ɵɵComponentDeclaration<GraphQLConsoleComponent, "mj-graphql-console", never, {}, {}, never, never, false, never>;
}
export {};
//# sourceMappingURL=graphql-console.component.d.ts.map