/**
 * Generated by tsnapi — public API snapshot of `@devframes/plugin-data-inspector/engine`
 */
// #region Interfaces
export interface DataSourceMeta {
  id: string;
  title: string;
  description?: string;
  icon?: string;
  static: boolean;
  writable: boolean;
  queries?: Query[];
}
export interface FilterOptions {
  excludeFunctions?: boolean;
  excludeUnderscoreProps?: boolean;
  excludeDollarProps?: boolean;
}
export interface NormalizeOptions {
  maxDepth?: number;
  maxEntries?: number;
  maxProps?: number;
  maxString?: number;
  excludeFunctions?: boolean;
  excludeUnderscoreProps?: boolean;
  excludeDollarProps?: boolean;
}
export interface NormalizeStats {
  nodes: number;
  refs: number;
  truncatedDepth: number;
  truncatedEntries: number;
  truncatedProps: number;
  ms: number;
}
export interface NormalizeStatsWire {
  nodes: number;
  refs: number;
  truncatedDepth: number;
  truncatedEntries: number;
  truncatedProps: number;
  ms: number;
}
export interface Query extends FilterOptions {
  query: string;
  title?: string;
  description?: string;
}
export interface QueryStats {
  queryMs: number;
  normalize: NormalizeStatsWire;
  payloadBytes: number;
}
export interface SavedQuery extends Query {
  id: string;
  scope: SavedQueryScope;
  updatedAt: number;
}
export interface SaveQueryInput extends Query {
  id?: string;
  scope: SavedQueryScope;
}
export interface SuggestItem {
  type: string;
  from: number;
  to: number;
  current: string;
  value: string;
}
export interface SuggestOutcome {
  ok: boolean;
  suggestions: SuggestItem[];
  statMs: number;
  error?: string;
}
export interface WriteApplyOptions {
  excludeFunctions?: boolean;
}
// #endregion

// #region Types
export type NodePath = PathSegment[];
export type PathSegment = ['k', string] | ['i', number] | ['s', number] | ['mk', number] | ['mv', number];
export type QueryOutcome = {
  ok: true;
  result: unknown;
  stats: QueryStats;
} | {
  ok: false;
  error: {
    name: string;
    message: string;
  };
};
export type SavedQueryScope = 'workspace' | 'project';
export type SkeletonOptions = Pick<NormalizeOptions, 'maxDepth' | 'maxProps' | 'excludeFunctions' | 'excludeUnderscoreProps' | 'excludeDollarProps'>;
export type SkeletonOutcome = {
  ok: true;
  skeleton: unknown;
  nodes: number;
  ms: number;
} | {
  ok: false;
  error: {
    name: string;
    message: string;
  };
};
export type WriteOutcome = {
  ok: true;
} | {
  ok: false;
  error: {
    name: string;
    message: string;
  };
};
export type WriteRequest = {
  op: 'set';
  path: NodePath;
  value: WriteValue;
} | {
  op: 'delete';
  path: NodePath;
} | {
  op: 'add';
  path: NodePath;
  key?: WriteValue;
  value: WriteValue;
} | {
  op: 'rename';
  path: NodePath;
  key: WriteValue;
};
export type WriteValue = {
  kind: 'json';
  value: unknown;
} | {
  kind: 'undefined';
};
// #endregion

// #region Functions
export declare function applyWrite(_: unknown, _: WriteRequest, _?: WriteApplyOptions): WriteOutcome;
export declare function isExcludedKey(_: string, _: Pick<NormalizeOptions, 'excludeUnderscoreProps' | 'excludeDollarProps'>): boolean;
export declare function navigate(_: unknown, _: NodePath, _?: Pick<NormalizeOptions, 'excludeFunctions'>): unknown;
export declare function normalize(_: unknown, _?: NormalizeOptions): {
  data: unknown;
  stats: NormalizeStats;
};
export declare function runQuery(_: unknown, _: string, _?: NormalizeOptions): QueryOutcome;
export declare function runQueryAtPath(_: unknown, _: string, _: NodePath, _?: NormalizeOptions): QueryOutcome;
export declare function skeletonOf(_: unknown, _?: SkeletonOptions): {
  skeleton: unknown;
  nodes: number;
  ms: number;
};
export declare function suggest(_: unknown, _: string, _: number, _?: number): SuggestOutcome;
// #endregion