import { SavedObject } from 'src/type'; import { IFieldType } from './fields'; export type FieldFormatMap = Record; export interface IIndexPattern { fields: IFieldType[]; title: string; id?: string; type?: string; timeFieldName?: string; intervalName?: string | null; getTimeField?(): IFieldType | undefined; fieldFormatMap?: Record; getFormatterForField?: (field: any | any['spec'] | IFieldType) => any; } export interface IndexPatternAttributes { type: string; fields: string; title: string; typeMeta: string; timeFieldName?: string; intervalName?: string; sourceFilters?: string; fieldFormatMap?: string; } export type OnNotification = (toastInputFields: any) => void; export type OnError = (error: Error, toastInputFields: any) => void; export type OnUnsupportedTimePattern = ({ id, title, index, }: { id: string; title: string; index: string; }) => void; export interface UiSettingsCommon { get: (key: string) => Promise; getAll: () => Promise>; set: (key: string, value: any) => Promise; remove: (key: string) => Promise; } export interface SavedObjectsClientCommonFindArgs { type: string | string[]; fields?: string[]; perPage?: number; search?: string; searchFields?: string[]; } export interface SavedObjectsClientCommon { find: (options: SavedObjectsClientCommonFindArgs) => Promise>>; get: (type: string, id: string) => Promise>; update: (type: string, id: string, attributes: Record, options: Record) => Promise>; create: (type: string, attributes: Record, options: Record) => Promise; delete: (type: string, id: string) => Promise<{}>; } export interface GetFieldsOptions { pattern?: string; type?: string; params?: any; lookBack?: boolean; metaFields?: string[]; dataSourceId?: string; } export interface IIndexPatternsApiClient { getFieldsForTimePattern: (options: GetFieldsOptions) => Promise; getFieldsForWildcard: (options: GetFieldsOptions) => Promise; } export type AggregationRestrictions = Record; export interface IFieldSubType { multi?: { parent: string; }; nested?: { path: string; }; } export interface TypeMeta { aggs?: Record; [key: string]: any; } export type FieldSpecConflictDescriptions = Record; export interface FieldSpecExportFmt { count?: number; script?: string; lang?: string; conflictDescriptions?: FieldSpecConflictDescriptions; name: string; type: OSD_FIELD_TYPES; esTypes?: string[]; scripted: boolean; searchable: boolean; aggregatable: boolean; readFromDocValues?: boolean; subType?: IFieldSubType; format?: any; indexed?: boolean; } export interface FieldSpec { count?: number; script?: string; lang?: string; conflictDescriptions?: Record; format?: any; name: string; type: string; esTypes?: string[]; scripted?: boolean; searchable: boolean; aggregatable: boolean; readFromDocValues?: boolean; subType?: IFieldSubType; indexed?: boolean; } export type IndexPatternFieldMap = Record; export interface SavedObjectReference { name?: string; id: string; type: string; } export interface IndexPatternSpec { id?: string; version?: string; title?: string; intervalName?: string; timeFieldName?: string; sourceFilters?: SourceFilter[]; fields?: IndexPatternFieldMap; typeMeta?: TypeMeta; type?: string; dataSourceRef?: SavedObjectReference; fieldsLoading?: boolean; } export interface SourceFilter { value: string; } /** @public **/ export interface OsdFieldTypeOptions { sortable: boolean; filterable: boolean; name: string; esTypes: OPENSEARCH_FIELD_TYPES[]; } /** @public **/ export declare enum OPENSEARCH_FIELD_TYPES { _ID = "_id", _INDEX = "_index", _SOURCE = "_source", _TYPE = "_type", STRING = "string", TEXT = "text", MATCH_ONLY_TEXT = "match_only_text", KEYWORD = "keyword", WILDCARD = "wildcard", BOOLEAN = "boolean", OBJECT = "object", DATE = "date", DATE_NANOS = "date_nanos", GEO_POINT = "geo_point", GEO_SHAPE = "geo_shape", FLOAT = "float", HALF_FLOAT = "half_float", SCALED_FLOAT = "scaled_float", DOUBLE = "double", INTEGER = "integer", INT = "int", LONG = "long", SHORT = "short", UNSIGNED_LONG = "unsigned_long", NESTED = "nested", BYTE = "byte", IP = "ip", ATTACHMENT = "attachment", TOKEN_COUNT = "token_count", MURMUR3 = "murmur3", HISTOGRAM = "histogram" } /** @public **/ export declare enum OSD_FIELD_TYPES { _SOURCE = "_source", ATTACHMENT = "attachment", BOOLEAN = "boolean", DATE = "date", GEO_POINT = "geo_point", GEO_SHAPE = "geo_shape", IP = "ip", MURMUR3 = "murmur3", NUMBER = "number", STRING = "string", UNKNOWN = "unknown", CONFLICT = "conflict", OBJECT = "object", NESTED = "nested", HISTOGRAM = "histogram" }