import type { WebViewInternalMessage } from '@devvit/protos/json/devvit/ui/effects/web_view/v1alpha/post_message.js'; import type { WebViewInternalEventMessage } from '@devvit/protos/json/devvit/ui/events/v1alpha/web_view.js'; import type { Metadata } from '@devvit/protos/lib/Types.js'; import type { RealtimeEvent } from '@devvit/protos/types/devvit/events/v1alpha/realtime.js'; import type { Effect } from '@devvit/protos/types/devvit/ui/effects/v1alpha/effect.js'; import type { UIEvent } from '@devvit/protos/types/devvit/ui/events/v1alpha/event.js'; import type { WorkerErrorType } from '@devvit/runtime-lite/client/BrowserLiteClient.js'; import type { AdsMetadata } from '@devvit/shared-types/AdsMetadata.js'; import type { FaceplateEvent } from '@reddit/faceplate/event-types.js'; export type DevvitRealtimeSend = { event: RealtimeEvent; }; export type DevvitRealtimeSendEvent = Omit, 'detail'> & { detail: DevvitRealtimeSend; }; export type DevvitUIEffect = { /** Classic Blocks uses `Effect`. Webbit uses `WebViewInternalMessage`. */ effect: Effect | WebViewInternalMessage; metadata?: Metadata | undefined; /** * Classic Blocks uses `UIEvent`. Webbit uses `WebViewInternalEventMessage`. * Consider `satisfies WebViewInternalEventMessage`. */ onEvent(event: UIEvent | WebViewInternalEventMessage): void; adsMetadata?: AdsMetadata | undefined; }; export type DevvitUIEffectEvent = Omit, 'detail'> & { detail: DevvitUIEffect; }; export type DevvitUIError = { type: WorkerErrorType; err: unknown; }; export declare const DevvitClientPerformanceEventName = "devvit-client-performance-report"; export type DevvitPerformanceTracingMetadata = { /** * Parent span. * * Should only be set explicitly if you create children manually. * If unset, consumer (shreddit) will take care of it */ parentSpanId?: DevvitPerformanceSpanId; /** * Current span. * * Should only be set explicitly if you create children manually. * If unset, consumer (shreddit) will take care of it */ spanId?: DevvitPerformanceSpanId; /** * Transaction id that unifies all related spans * * Should only be set explicitly if you create children manually. * Use tha value provided by consumer (Shreddit) * If unset, consumer (shreddit) will take care of it */ traceId?: DevvitPerformanceTraceId; }; export type DevvitClientPerformanceEvent = { /** * Timestamp of the event start. Can use fractional milliseconds. */ timeStart: number; /** * Timestamp of the event start. Can use fractional milliseconds. */ timeEnd: number; /** * Name of the process that was measured. */ name: 'time_to_first_frame' | 'init_runtime' | 'fetch_full_bundle' | 'load_full_bundle' | 'blocks_layout' | 'time_to_web_view_load'; } & DevvitPerformanceTracingMetadata; /** 16 hex chars that identify the performance span. */ type DevvitPerformanceSpanId = string; /** 32 hex chars that identify the transaction. */ type DevvitPerformanceTraceId = string; export declare const DevvitRuntimePerformanceEventName = "devvit-runtime-performance-report"; export type DevvitRuntimePerformanceEvent = { /** * Name of the process that was measured. * For now, it's only "runtime_trace". */ name: string; /** * Timestamp of the event start. Can use fractional milliseconds. */ timeStart: number; /** * Timestamp of the event start. Can use fractional milliseconds. */ timeEnd: number; /** Specifies if runtime call was "local" or "remote". */ target: string; /** Event count of a single request. */ eventCount: number; /** * If target is remote, specify why we are targeting the remote runtime – i.e. `remote_only`, `circuit_break`, `app_error`, etc. * * Empty string for local runtime calls. * */ intent?: string; } & DevvitPerformanceTracingMetadata; export declare const DevvitRuntimeErrorEventName = "devvit-runtime-error"; export type DevvitRuntimeErrorEvent = { /** Exception message */ message: string; /** "local" or "remote" -- which runtime the error originates from */ origin: string; /** Version of the runtime, may be unavailable for remote runtimes */ version: string; }; export declare const DevvitLocalRuntimeInitErrorMessage = "devvit-local-runtime-init-failed"; export {}; //# sourceMappingURL=events.d.ts.map