mirror of
https://github.com/stablyai/orca.git
synced 2026-10-31 17:17:38 +00:00
Co-authored-by: Jinjing <6427696+AmethystLiang@users.noreply.github.com> Co-authored-by: Neil <neil@stably.ai>
38 lines
1.5 KiB
TypeScript
38 lines
1.5 KiB
TypeScript
import type {
|
|
CrashReportBreadcrumbData,
|
|
CrashReportCopyDiagnosticsArgs,
|
|
CrashReportRecord,
|
|
CrashReportSubmitArgs,
|
|
CrashReportSubmitResult,
|
|
ReactErrorBoundaryReportArgs,
|
|
ReactErrorBoundaryReportResult
|
|
} from '../../shared/crash-reporting'
|
|
import type {
|
|
FeedbackSubmitArgs,
|
|
FeedbackSubmitResult
|
|
} from '../../shared/feedback-submit-contract'
|
|
import type { RendererHeapStatistics } from '../../shared/renderer-heap-statistics'
|
|
import type { RendererProcessMemory } from '../../shared/renderer-process-memory'
|
|
|
|
export type CrashReportsApi = {
|
|
getLatestPending: () => Promise<CrashReportRecord | null>
|
|
getLatestReport: () => Promise<CrashReportRecord | null>
|
|
dismiss: (args: { reportId: string }) => Promise<CrashReportRecord | null>
|
|
recordRendererError: (
|
|
args: ReactErrorBoundaryReportArgs
|
|
) => Promise<ReactErrorBoundaryReportResult>
|
|
recordBreadcrumb: (args: { name: string; data?: CrashReportBreadcrumbData }) => void
|
|
submit: (args: CrashReportSubmitArgs) => Promise<CrashReportSubmitResult>
|
|
copyLatestDiagnostics: (
|
|
args?: CrashReportCopyDiagnosticsArgs
|
|
) => Promise<{ ok: true } | { ok: false; error: string }>
|
|
/** Exact V8/Blink heap sizes; null when the runtime withholds them. */
|
|
readHeapStatistics: () => RendererHeapStatistics | null
|
|
/** This renderer's OS-level footprint, which the heap counters never include. */
|
|
readProcessMemory?: () => Promise<RendererProcessMemory | null>
|
|
}
|
|
|
|
export type FeedbackApi = {
|
|
submit: (args: FeedbackSubmitArgs) => Promise<FeedbackSubmitResult>
|
|
}
|