• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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/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  isFetchingData: boolean;
31
32  headers: LogHeader[];
33  propertiesTree?: undefined | UiPropertyTreeNode;
34  propertiesUserOptions?: UserOptions;
35  propertiesFilter?: TextFilter;
36  isDarkMode?: boolean;
37}
38
39export interface ColumnSpec {
40  name: string;
41  cssClass: string;
42}
43
44export class LogHeader {
45  constructor(public spec: ColumnSpec, public filter?: LogFilter) {}
46}
47
48export interface LogEntry {
49  traceEntry: TraceEntry<object>;
50  fields: LogField[];
51  propertiesTree?: undefined | PropertyTreeNode;
52}
53
54export interface LogField {
55  spec: ColumnSpec;
56  value: LogFieldValue;
57  icon?: string;
58  iconColor?: string;
59  propagateEntryTimestamp?: boolean;
60}
61
62export type LogFieldValue = string | number | Timestamp;
63