Files
flipper/desktop/flipper-plugin/src/ui/PowerSearch/PowerSearchConfig.tsx
Andrey Goncharov f16ff8ade4 Remove extra operators
Summary: Project doc: https://docs.google.com/document/d/1miofxds9DJgWScj0zFyBbdpRH5Rj0T9FqiCapof5-vU

Reviewed By: lblasa

Differential Revision: D48605289

fbshipit-source-id: f3168a8db4532ddd368a96f013749e4abc627e0f
2023-08-30 07:26:35 -07:00

56 lines
1.2 KiB
TypeScript

/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @format
*/
// Mostly matches https://www.internalfb.com/code/www/html/intern/js/ui/PowerSearch/PowerSearchExampleConfig.js
export type SimpleFilterValueType = 'NO_VALUE' | 'INTEGER' | 'FLOAT' | 'STRING';
export type EnumFilterValueType = 'ENUM';
export type AbsoluteDateFilterValueType = 'ABSOLUTE_DATE';
export type SimpleOperatorConfig = {
valueType: SimpleFilterValueType;
key: string;
label: string;
};
export type EnumOperatorConfig = {
valueType: EnumFilterValueType;
key: string;
label: string;
enumLabels: {[key: string]: string};
};
export type AbsoluteDateOperatorConfig = {
valueType: AbsoluteDateFilterValueType;
key: string;
label: string;
dateOnly?: boolean;
minValue?: Date;
maxValue?: Date;
isNegative?: boolean;
};
export type OperatorConfig =
| SimpleOperatorConfig
| EnumOperatorConfig
| AbsoluteDateOperatorConfig;
export type FieldConfig = {
key: string;
label: string;
operators: {[key: string]: OperatorConfig};
};
export type PowerSearchConfig = {
name: string;
fields: {[key: string]: FieldConfig};
};