1/* 2 * Copyright (C) 2024 The Android Open Source Project 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17import {Timestamp} from 'common/time'; 18import {TraceEntry} from 'trace/trace'; 19import {PropertyTreeNode} from 'trace/tree_node/property_tree_node'; 20import {TextFilter} from 'viewers/common/text_filter'; 21import {UserOptions} from 'viewers/common/user_options'; 22import {LogFilter} from './log_filters'; 23import {UiPropertyTreeNode} from './ui_property_tree_node'; 24 25export interface UiDataLog { 26 entries: LogEntry[]; 27 selectedIndex: undefined | number; 28 scrollToIndex: undefined | number; 29 currentIndex: undefined | number; 30 31 headers: LogHeader[]; 32 propertiesTree?: undefined | UiPropertyTreeNode; 33 propertiesUserOptions?: UserOptions; 34 propertiesFilter?: TextFilter; 35 isDarkMode?: boolean; 36} 37 38export interface ColumnSpec { 39 name: string; 40 cssClass: string; 41} 42 43export class LogHeader { 44 constructor(public spec: ColumnSpec, public filter?: LogFilter) {} 45} 46 47export interface LogEntry { 48 traceEntry: TraceEntry<object>; 49 fields: LogField[]; 50 propertiesTree?: undefined | PropertyTreeNode; 51} 52 53export interface LogField { 54 spec: ColumnSpec; 55 value: LogFieldValue; 56 icon?: string; 57 iconColor?: string; 58 propagateEntryTimestamp?: boolean; 59} 60 61export type LogFieldValue = string | number | Timestamp; 62