@pythia-software/query-table-core 0.9.7 → 0.9.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -1,3 +1,43 @@
1
+ /** Portable presentation only. Arrays are ordered sets; their order is retained. */
2
+ interface JsonInspectionState {
3
+ version: 1;
4
+ open: boolean;
5
+ search: string;
6
+ searchMode: "filter" | "find";
7
+ raw: boolean;
8
+ collapsedPaths: string[];
9
+ expandedBuckets: string[];
10
+ visibleEntryLimit: number;
11
+ selectedMatch?: JsonMatchIdentity;
12
+ /** Explicit expansion choices made while searching, in interaction order. */
13
+ searchOverrides: {
14
+ path: string;
15
+ expanded: boolean;
16
+ }[];
17
+ }
18
+ interface JsonMatchIdentity {
19
+ path: string;
20
+ part: "key" | "value" | "path";
21
+ start: number;
22
+ }
23
+ interface JsonInspectionScope {
24
+ dataset: string;
25
+ rowId: RowId;
26
+ field: string;
27
+ }
28
+ interface ScopedJsonInspectionState extends JsonInspectionScope {
29
+ state: JsonInspectionState;
30
+ }
31
+ declare const MAX_JSON_INSPECTIONS = 200;
32
+ declare const MAX_JSON_PATHS = 5000;
33
+ /** Bracket JSONPath, as emitted by the inspector. No dot splitting or evaluation. */
34
+ declare function isJsonPath(path: unknown): path is string;
35
+ declare function isJsonBucketId(path: unknown): path is string;
36
+ declare function jsonInspectionScopeKey(scope: JsonInspectionScope): string;
37
+ declare function parseJsonInspectionState(input: unknown): JsonInspectionState;
38
+ /** Reject the entire envelope on an invalid/duplicate scope, never restore a different record. */
39
+ declare function parseJsonInspections(input: unknown): ScopedJsonInspectionState[];
40
+
1
41
  /** Presentation hints only: field types still determine query/filter semantics. */
2
42
  interface JsonCellDisplay {
3
43
  kind: "json";
@@ -503,6 +543,8 @@ interface PropertyViewState {
503
543
  /** Property label column width as a percentage, shared with the saved view. */
504
544
  labelWidth?: number;
505
545
  }
546
+ /** Projection coverage used by rendering and semantic attention alike. */
547
+ declare function isPropertyFieldLoaded<Row>(field: FieldDef<Row>, loadedFields?: readonly string[]): boolean;
506
548
  declare const MAX_PROPERTIES = 200;
507
549
  declare function normalizePropertyFormat(input: unknown): PropertyFormat | undefined;
508
550
  /** Strict envelope/version checks prevent interpreting future saved views as empty. */
@@ -956,6 +998,8 @@ interface ItemDetailsState {
956
998
  id: RowId;
957
999
  mode: "modal" | "expand";
958
1000
  };
1001
+ /** Record-specific JSON presentation; independent of property instance/layout IDs. */
1002
+ jsonInspections?: ScopedJsonInspectionState[];
959
1003
  }
960
1004
  /**
961
1005
  * Query state a host owns and registers with `useQueryTable({ hostQuery })`,
@@ -1866,4 +1910,37 @@ declare function groupLinkQuery(query: QueryState, value: GroupLinkValue): Query
1866
1910
  * routes and unresolvable values return `href: null` with a `problem`. */
1867
1911
  declare function resolveGroupLink(query: QueryState, value: GroupLinkValue, targets?: LinkTargets): ResolvedGroupLink;
1868
1912
 
1869
- export { AGG_OPS_BY_TYPE, AGG_OPS_NEEDING_FIELD, type AggOp, type AggregateConfig, type AggregationBucket, type AggregationClause, type AggregationRequest, type AggregationResult, type AggregationResultEntry, type Align, type ApplyPatchOptions, type ApplyResult, type BackendField, COMPUTED_PREFIX, type CalendarGroupKey, type CellDisplay, type CellRenderer, type ColumnPreview, type ComputedCellError, type ComputedColumn, type ComputedColumnDraft, type ComputedColumnStore, type ComputedExecution, type ComputedFieldCapabilities, type DerivedField, type DistinctValuesQuery, type DistinctValuesResult, EMPTY_QUERY, FORMULA_FUNCTIONS, type FetchRowsResult, type FetchRowsResultV2, type FieldDef, type FieldOrigin, type FieldRelationship, type FieldSchema, type FieldSource, type FieldStats, type FieldType, type FilterConfig, type FilterOp, type FilterValues, type ForeignKey, type FormulaDiagnostic, FormulaError, type FormulaFunction, type FormulaNode, type FormulaPlan, type FormulaResult, type FormulaType, type FormulaValue, GROUP_ID_FIELD, GROUP_KEY_INTERVALS, GROUP_LINK_RENDER, type GroupKey, type GroupLinkValue, type GroupedRow, type GroupingDefinition, type GroupingModel, type GroupingState, type GroupingView, type HostQueryState, ITEM_DETAILS_COLUMN, type ItemDetailMode, type ItemDetailsState, type ItemPageOptions, type ItemPropertyMode, type JsonCellDisplay, type LinkDestination, type LinkSpec, type LinkTargets, MAX_AGGREGATIONS, MAX_GROUP_BY_FIELDS, MAX_HOST_QUERY_PARAMS, MAX_HOST_QUERY_STATE_BYTES, MAX_HOST_QUERY_VALUES, MAX_HOST_QUERY_VALUE_LENGTH, MAX_METRIC_WINDOW_PERIODS, MAX_ORDER_BY_TERMS, MAX_PROPERTIES, MAX_QUERY_LIMIT, MAX_QUERY_OFFSET, MAX_QUERY_STATE_BYTES, MAX_QUERY_TOKEN_LENGTH, MAX_RELATIVE_TIME_MS, MAX_REPRESENTATIVE_SORTS, MAX_RESULT_GROUPS, MAX_SELECT_COLUMNS, MAX_SUMMARY_COLUMNS, MAX_WHERE_CLAUSES, METRIC_CYCLE_INTERVALS, METRIC_DATE_INTERVALS, METRIC_FUNCTIONS, type MetricAxisScale, type MetricBoxSummary, type MetricCalendarInterval, type MetricCapabilities, type MetricCycleInterval, type MetricDateGrouping, type MetricDateOccurrence, type MetricDiagnostic, type MetricDisplay, type MetricDistribution, type MetricDistributionResult, type MetricEvaluationOptions, type MetricHistogramBin, type MetricKey, type MetricLayout, type MetricMinCountOf, type MetricPlan, type MetricPopulationSupport, type MetricQuery, type MetricReductionOptions, type MetricScope, type MetricSeriesOptions, type MetricSeriesPlan, type MetricShare, type MetricSort, type MetricValue, type MetricValueFormat, type MetricWindow, NULLARY_OPS, OPS_BY_TYPE, OP_LABEL, type ObjectReference, type ObjectTypeDefinition, type OpChoice, type OpPair, type OrGroup, type OrOfAndsGroup, type OrderByClause, type PreviewGroup, type PropertyFieldConfig, type PropertyFormat, type PropertySelection, type PropertyViewState, type PropertyViewStorage, type QueryCapabilitiesV3, QueryDecodeError, type QueryEvaluationOptions, type QueryFacet, type QueryLink, type QueryLinkOptions, type QueryLinkService, type QueryPatch, type QueryPatchMatch, type QueryRequestV3, type QueryResultV3, type QuerySnapshot, type QuerySnapshotCache, QuerySnapshotHttpError, type QuerySnapshotHttpErrorCode, type QuerySnapshotStore, type QueryState, type RegexInspection, type RelationshipAdapter, type RepresentativeOrder, type RepresentativeRow, type ResolvedGroupLink, type ResolvedObjectReference, type RowComputedValues, type RowId, type SavedPropertyView, type SavedQuery, type SelectColumn, type SelectConfig, type ServerQuery, type ServerQueryV2, type SetFilterMetadata, type SetFilterMode, type SetFilterTarget, type SortConfig, type SourceDependencies, type StorageAdapter, type SummaryColumn, type SummaryOp, type Transport, type WhereBranch, type WhereClause, type WhereConjunction, type WhereTerm, aggOpAllowedForType, aggOpNeedsField, aggOpsForField, applyAggregations, applyPatch, applyQuery, boxSummary, branchesOf, calendarGroupKey, coerceValue, compareMetricValues, compileFormula, compileMetric, computedFieldName, createGroupingModel, createPropertyView, createQueryLinkService, createSetFilter, decodeQuery, decodeQueryStrict, discoverFieldRelationships, encodeQuery, evaluateMetricReductions, evaluateMetrics, exitGrouping, filterValues, formulaRuntime, groupKeyField, groupKeyFields, groupKeyTerms, groupLinkQuery, groupPreview, groupSourceQuery, hasMetricSeries, hasRegex, histogramCounts, histogramEdges, httpComputedColumnStore, httpQuerySnapshotStore, indexFields, inspectBucketQuery, isCalendarGroupKey, isComputedCellError, isComputedField, isFilterable, isGroupLinkField, isGroupLinkValue, isGroupable, isGroupingTimeZone, isMeasurable, isMetricCycle, isNegativePredicate, isOrGroup, isOrOfAndsGroup, isPushdownFilter, isSelectable, isSortable, isWhereConjunction, isWhereGroup, itemPageFields, jsonPropertyViewStorage, loadSchema, localPropertyViewStorage, localQuerySnapshotCache, localStorageAdapter, mapSetFilterValues, matchPatch, matchesClause, memoryComputedColumnStore, memoryPropertyViewStorage, memoryQuerySnapshotCache, memoryStorageAdapter, metricAggregatePlans, metricCalendarUnit, metricComputationKey, metricCustomEndTime, metricCycleSlot, metricCycleSlots, metricDateBounds, metricDateFloor, metricDateNext, metricDateRange, metricDateTime, metricDependencies, metricExpression, metricMinCount, metricMinCountKeeps, metricMinCountMeasure, metricMinCountPlan, metricMinCountText, metricPlans, metricPopulationError, negateClause, normalizePropertyFormat, normalizePropertyView, normalizeQueryState, objectReferenceKey, occurrenceDistribution, opAllowedForType, opPairsForField, opsForField, parseHostQueryState, parseRelativeDuration, percentile, planMetricSeries, predicatesOf, prepareGrouping, queriesEqual, readFieldValue, readObjectReference, readSetFilter, reduceMetricValues, removePatch, renderItemPageTemplate, resolveFieldName, resolveGroupLink, selectMetricShownRows, selectedFields, setFilterModes, setFilterTarget, sortMetricBuckets, sourceDependencies, sourceExecutionSchema, stripSetFilter, toAggregationQuery, toMetricQuery, toQueryRequestV3, toServerQuery, toServerQueryV2, validateComputedColumn, validateDateGrouping, validateItemPageTemplate, validateMetric, validateMetricSeries, validateQueryResultV3, validateQuerySnapshot, wholeIntervalSpan, withGroupingKeys, withoutGrouping, withoutLinkSummaries };
1913
+ /** Semantic identities only. A missing path never resolves to its parent. */
1914
+ interface AttentionTarget {
1915
+ dataset: string;
1916
+ rowId?: RowId;
1917
+ field?: string;
1918
+ path?: string;
1919
+ }
1920
+ type AttentionResult = {
1921
+ status: "revealed" | "unavailable" | "cancelled";
1922
+ target: AttentionTarget;
1923
+ };
1924
+ interface AttentionProvider {
1925
+ /** Await data/layout readiness; observe cancellation before changing presentation. */
1926
+ ready?: (signal: AbortSignal) => Promise<void>;
1927
+ /** Load/open the exact record or property, then return whether it exists. */
1928
+ materialize?: (target: AttentionTarget, signal: AbortSignal) => boolean | Promise<boolean>;
1929
+ /** Scroll/highlight the materialized target. Must never move keyboard focus. */
1930
+ reveal: (target: AttentionTarget, signal: AbortSignal) => boolean | Promise<boolean>;
1931
+ }
1932
+ interface AttentionRegistry {
1933
+ cancel(): void;
1934
+ register(target: AttentionTarget, provider: AttentionProvider): () => void;
1935
+ /** New navigation cancels the previous request; registrations alone never scroll. */
1936
+ resolve(target: AttentionTarget, options?: {
1937
+ signal?: AbortSignal;
1938
+ }): Promise<AttentionResult>;
1939
+ /** For materializers awaiting a React commit or a virtualized row. */
1940
+ whenRegistered(target: AttentionTarget, signal: AbortSignal, except?: AttentionProvider): Promise<AttentionProvider>;
1941
+ }
1942
+ declare function attentionTargetKey(target: AttentionTarget): string;
1943
+ /** Framework-independent registration and cancellation; adapters own materialization. */
1944
+ declare function createAttentionRegistry(): AttentionRegistry;
1945
+
1946
+ export { AGG_OPS_BY_TYPE, AGG_OPS_NEEDING_FIELD, type AggOp, type AggregateConfig, type AggregationBucket, type AggregationClause, type AggregationRequest, type AggregationResult, type AggregationResultEntry, type Align, type ApplyPatchOptions, type ApplyResult, type AttentionProvider, type AttentionRegistry, type AttentionResult, type AttentionTarget, type BackendField, COMPUTED_PREFIX, type CalendarGroupKey, type CellDisplay, type CellRenderer, type ColumnPreview, type ComputedCellError, type ComputedColumn, type ComputedColumnDraft, type ComputedColumnStore, type ComputedExecution, type ComputedFieldCapabilities, type DerivedField, type DistinctValuesQuery, type DistinctValuesResult, EMPTY_QUERY, FORMULA_FUNCTIONS, type FetchRowsResult, type FetchRowsResultV2, type FieldDef, type FieldOrigin, type FieldRelationship, type FieldSchema, type FieldSource, type FieldStats, type FieldType, type FilterConfig, type FilterOp, type FilterValues, type ForeignKey, type FormulaDiagnostic, FormulaError, type FormulaFunction, type FormulaNode, type FormulaPlan, type FormulaResult, type FormulaType, type FormulaValue, GROUP_ID_FIELD, GROUP_KEY_INTERVALS, GROUP_LINK_RENDER, type GroupKey, type GroupLinkValue, type GroupedRow, type GroupingDefinition, type GroupingModel, type GroupingState, type GroupingView, type HostQueryState, ITEM_DETAILS_COLUMN, type ItemDetailMode, type ItemDetailsState, type ItemPageOptions, type ItemPropertyMode, type JsonCellDisplay, type JsonInspectionScope, type JsonInspectionState, type JsonMatchIdentity, type LinkDestination, type LinkSpec, type LinkTargets, MAX_AGGREGATIONS, MAX_GROUP_BY_FIELDS, MAX_HOST_QUERY_PARAMS, MAX_HOST_QUERY_STATE_BYTES, MAX_HOST_QUERY_VALUES, MAX_HOST_QUERY_VALUE_LENGTH, MAX_JSON_INSPECTIONS, MAX_JSON_PATHS, MAX_METRIC_WINDOW_PERIODS, MAX_ORDER_BY_TERMS, MAX_PROPERTIES, MAX_QUERY_LIMIT, MAX_QUERY_OFFSET, MAX_QUERY_STATE_BYTES, MAX_QUERY_TOKEN_LENGTH, MAX_RELATIVE_TIME_MS, MAX_REPRESENTATIVE_SORTS, MAX_RESULT_GROUPS, MAX_SELECT_COLUMNS, MAX_SUMMARY_COLUMNS, MAX_WHERE_CLAUSES, METRIC_CYCLE_INTERVALS, METRIC_DATE_INTERVALS, METRIC_FUNCTIONS, type MetricAxisScale, type MetricBoxSummary, type MetricCalendarInterval, type MetricCapabilities, type MetricCycleInterval, type MetricDateGrouping, type MetricDateOccurrence, type MetricDiagnostic, type MetricDisplay, type MetricDistribution, type MetricDistributionResult, type MetricEvaluationOptions, type MetricHistogramBin, type MetricKey, type MetricLayout, type MetricMinCountOf, type MetricPlan, type MetricPopulationSupport, type MetricQuery, type MetricReductionOptions, type MetricScope, type MetricSeriesOptions, type MetricSeriesPlan, type MetricShare, type MetricSort, type MetricValue, type MetricValueFormat, type MetricWindow, NULLARY_OPS, OPS_BY_TYPE, OP_LABEL, type ObjectReference, type ObjectTypeDefinition, type OpChoice, type OpPair, type OrGroup, type OrOfAndsGroup, type OrderByClause, type PreviewGroup, type PropertyFieldConfig, type PropertyFormat, type PropertySelection, type PropertyViewState, type PropertyViewStorage, type QueryCapabilitiesV3, QueryDecodeError, type QueryEvaluationOptions, type QueryFacet, type QueryLink, type QueryLinkOptions, type QueryLinkService, type QueryPatch, type QueryPatchMatch, type QueryRequestV3, type QueryResultV3, type QuerySnapshot, type QuerySnapshotCache, QuerySnapshotHttpError, type QuerySnapshotHttpErrorCode, type QuerySnapshotStore, type QueryState, type RegexInspection, type RelationshipAdapter, type RepresentativeOrder, type RepresentativeRow, type ResolvedGroupLink, type ResolvedObjectReference, type RowComputedValues, type RowId, type SavedPropertyView, type SavedQuery, type ScopedJsonInspectionState, type SelectColumn, type SelectConfig, type ServerQuery, type ServerQueryV2, type SetFilterMetadata, type SetFilterMode, type SetFilterTarget, type SortConfig, type SourceDependencies, type StorageAdapter, type SummaryColumn, type SummaryOp, type Transport, type WhereBranch, type WhereClause, type WhereConjunction, type WhereTerm, aggOpAllowedForType, aggOpNeedsField, aggOpsForField, applyAggregations, applyPatch, applyQuery, attentionTargetKey, boxSummary, branchesOf, calendarGroupKey, coerceValue, compareMetricValues, compileFormula, compileMetric, computedFieldName, createAttentionRegistry, createGroupingModel, createPropertyView, createQueryLinkService, createSetFilter, decodeQuery, decodeQueryStrict, discoverFieldRelationships, encodeQuery, evaluateMetricReductions, evaluateMetrics, exitGrouping, filterValues, formulaRuntime, groupKeyField, groupKeyFields, groupKeyTerms, groupLinkQuery, groupPreview, groupSourceQuery, hasMetricSeries, hasRegex, histogramCounts, histogramEdges, httpComputedColumnStore, httpQuerySnapshotStore, indexFields, inspectBucketQuery, isCalendarGroupKey, isComputedCellError, isComputedField, isFilterable, isGroupLinkField, isGroupLinkValue, isGroupable, isGroupingTimeZone, isJsonBucketId, isJsonPath, isMeasurable, isMetricCycle, isNegativePredicate, isOrGroup, isOrOfAndsGroup, isPropertyFieldLoaded, isPushdownFilter, isSelectable, isSortable, isWhereConjunction, isWhereGroup, itemPageFields, jsonInspectionScopeKey, jsonPropertyViewStorage, loadSchema, localPropertyViewStorage, localQuerySnapshotCache, localStorageAdapter, mapSetFilterValues, matchPatch, matchesClause, memoryComputedColumnStore, memoryPropertyViewStorage, memoryQuerySnapshotCache, memoryStorageAdapter, metricAggregatePlans, metricCalendarUnit, metricComputationKey, metricCustomEndTime, metricCycleSlot, metricCycleSlots, metricDateBounds, metricDateFloor, metricDateNext, metricDateRange, metricDateTime, metricDependencies, metricExpression, metricMinCount, metricMinCountKeeps, metricMinCountMeasure, metricMinCountPlan, metricMinCountText, metricPlans, metricPopulationError, negateClause, normalizePropertyFormat, normalizePropertyView, normalizeQueryState, objectReferenceKey, occurrenceDistribution, opAllowedForType, opPairsForField, opsForField, parseHostQueryState, parseJsonInspectionState, parseJsonInspections, parseRelativeDuration, percentile, planMetricSeries, predicatesOf, prepareGrouping, queriesEqual, readFieldValue, readObjectReference, readSetFilter, reduceMetricValues, removePatch, renderItemPageTemplate, resolveFieldName, resolveGroupLink, selectMetricShownRows, selectedFields, setFilterModes, setFilterTarget, sortMetricBuckets, sourceDependencies, sourceExecutionSchema, stripSetFilter, toAggregationQuery, toMetricQuery, toQueryRequestV3, toServerQuery, toServerQueryV2, validateComputedColumn, validateDateGrouping, validateItemPageTemplate, validateMetric, validateMetricSeries, validateQueryResultV3, validateQuerySnapshot, wholeIntervalSpan, withGroupingKeys, withoutGrouping, withoutLinkSummaries };