Commit 4da8b920 authored by Robert Knight's avatar Robert Knight

Make `ThreadState.filters` type more specific

This unfortunately doesn't catch mistakes where incorrect property names are
used because TS allows excess properties, but it does at least document what the
expected keys are.
parent 12ef670a
......@@ -4,6 +4,7 @@ import { buildThread } from './build-thread';
import type { Thread, BuildThreadOptions } from './build-thread';
import { filterAnnotations } from './filter-annotations';
import { parseFilterQuery } from './query-parser';
import type { FilterField } from './query-parser';
import { shouldShowInTab } from './tabs';
import { sorters } from './thread-sorters';
......@@ -13,7 +14,7 @@ export type ThreadState = {
selection: {
expanded: Record<string, boolean>;
filterQuery: string | null;
filters: Record<string, string>;
filters: Partial<Record<FilterField, string>>;
forcedVisible: string[];
selected: string[];
sortKey: keyof typeof sorters;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment