Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import type { ColumnAIOptions, ColumnBase } from '@js/common/grids';

import type { COLUMN_CHOOSER_LOCATION, GROUP_LOCATION, HEADERS_LOCATION } from './const';
import type {
COLUMN_CHOOSER_LOCATION, GROUP_LOCATION, HEADERS_LOCATION, USER_STATE_FIELD_NAMES,
} from './const';

export type DropLocationNames = typeof GROUP_LOCATION
| typeof COLUMN_CHOOSER_LOCATION
Expand All @@ -13,6 +15,8 @@ export type ColumnIndex = number | {

export type FilterField = Omit<Column, 'filterOperations'> & { filterOperations?: string[] | null };

export type ColumnUserState = Pick<Column, typeof USER_STATE_FIELD_NAMES[number]>;

export type AddedColumn = string | (Column & { columns?: (Column | string)[] });

export interface InternalColumnOptions {
Expand All @@ -23,6 +27,7 @@ export interface InternalColumnOptions {
groupIndex?: number;
type?: string;
defaultFilterOperations?: string[];
defaultFilterOperation?: string;
visibleWidth?: string | number;
hidingPriority?: number;
ai?: ColumnAIOptions;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -233,3 +233,17 @@ export type DataFilter = DataFilterExpression
| MatchNothingFilter
| null
| undefined;

/** Arrays for `anyof`/`noneof` and `between`; nested when a header filter groups by interval. */
export type FilterValueOperand = ScalarFilterValue | FilterValueOperand[];

/** Operation is a plain `string`: `filterBuilder.customOperations` is user-extensible. */
export type FilterValueCondition = [string, FilterValueOperand]
| [string, string, FilterValueOperand];

/** Mirrors `DataFilterExpression`, but over column identifiers (`dataField ?? name`). */
export type FilterValueExpression = FilterValueCondition
| ['!', FilterValueExpression]
| [FilterValueExpression, ...(FilterCombiner | FilterValueExpression)[]];

export type FilterValue = FilterValueExpression | null | undefined;
Loading
Loading