forked from olofd/react-native-device-log
-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathindex.d.ts
More file actions
123 lines (85 loc) · 2.65 KB
/
index.d.ts
File metadata and controls
123 lines (85 loc) · 2.65 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
import * as React from 'react';
import { ViewStyle } from 'react-native';
declare var deviceLog: DebugService
export const LogView: React.ComponentType<LogViewProps>
export enum LogLevel {
log = "log",
debug = "debug",
info = "info",
fatal = "fatal",
success = "success",
rnerror = "rnerror",
separator = "separator"
}
export type Color = string
export interface DebugServiceOptions {
logToConsole: boolean,
logToConsoleMethod: 'match' | undefined,
logToConsoleFunc: (LogLevel, Color, string) => void,
logRNErrors: boolean,
maxNumberToRender: number,
maxNumberToPersist: number,
rowInsertDebounceMs: number,
logAppState: boolean,
logConnection: boolean,
hideSystemLogs: boolean,
}
export interface StorageAdapter {
}
export interface LogRow {
id: string,
lengthAtInsertion: number,
level: LogLevel,
message: string,
timeStamp: string,
color: string
}
export interface Store {
setReadOnly(readOnly)
async getRows(): Promise<LogRow[]>
async insertRows(logRows: LogRow[], allRows: LogRow[]): Promise<LogRow[]>
async clear(): Promise<void>
logRowCreated?()
appendToLogRow?(logRow: LogRow): LogRow
async initalDataRead?(logRows: LogRow[])
}
export interface DebugService {
store: Store
async init(StorageAdapter, DebugServiceOptions): Promise<void>
stopTimer(name: string)
async startTimer(name: string)
async logTime(name: string): Promise<void>
async clear(): Promise<void>
log(...logRows: string[]): Promise<void>
debug(...logRows: string[]): Promise<void>
info(...logRows: string[]): Promise<void>
error(...logRows: string[]): Promise<void>
fatal(...logRows: string[]): Promise<void>
success(...logRows: string[]): Promise<void>
rnerror(fatal: boolean, message: string, stackTraceItems: StackTraceItem[]): string
separator(name): Promise<void>
getColorForLogLevel(level: LogLevel): Color
logToConsole(level: LogLevel, color: Color, ...logRows: string[]): void
onDebugRowsChanged(callback: (rows: LogRow[]) => void): () => void
}
export interface LogViewProps {
inverted?: boolean
multiExpanded?: boolean
timeStampFormat?: string
renderTimestamp?: boolean
renderLevel?: boolean
paused?: boolean
textColor?: string
backgroundColor?: string
borderColor?: string
separatorColor?: string
renderToolbar?: (options: ToolbarOptions) => React.ReactNode
}
export interface ToolbarOptions {
onPause: () => void
onClear: () => void
onFilter: () => void
length: any[]
}
export const debugListView: React.ComponentType<any>
export { deviceLog }