import type { CallEndReason, CallMetadata } from "../ExpoVicallCallManager.types"; /** * Responsibilities owned exclusively by this Expo native module. * Backend services and media SDKs must not re-implement these concerns. */ export declare const MODULE_RESPONSIBILITIES: readonly ["system_incoming_ui", "system_outgoing_ui", "voip_push_registration_ios", "fcm_call_interception_android", "call_event_buffering_before_js", "system_picture_in_picture_api", "call_foreground_service_android"]; /** * Responsibilities owned by the backend / edge Worker that talks to the app. * These stay outside the React Native module boundary. */ export declare const SERVICE_RESPONSIBILITIES: readonly ["create_call_record", "create_media_meeting", "send_ios_voip_push", "send_android_fcm_call_data", "mint_media_token_after_answer", "cancel_or_answered_elsewhere_signaling", "durable_call_state"]; /** * Responsibilities owned by the React Native application host. * In-call screens, video layout, and chrome are intentionally host-owned * (X / social-network style). This module does not ship a required call UI. */ export declare const APP_RESPONSIBILITIES: readonly ["subscribe_native_call_events", "present_host_owned_in_call_ui", "fetch_media_credentials_after_answer", "join_leave_media_session", "bind_media_tracks_to_host_video_views", "register_push_tokens_with_backend"]; export type ModuleResponsibility = (typeof MODULE_RESPONSIBILITIES)[number]; export type ServiceResponsibility = (typeof SERVICE_RESPONSIBILITIES)[number]; export type AppResponsibility = (typeof APP_RESPONSIBILITIES)[number]; /** * Direction of each native call event relative to the JS runtime. * - native_to_js: system UI / telecom / push produced the event * - js_to_native: app asked the module to mutate native call state * - bidirectional: either side may originate the same event type */ export declare const CALL_EVENT_OWNERSHIP: { readonly answer: "native_to_js"; readonly end: "bidirectional"; readonly start: "bidirectional"; readonly mute: "bidirectional"; readonly hold: "bidirectional"; readonly dtmf: "native_to_js"; readonly audioSessionActivated: "native_to_js"; readonly audioSessionDeactivated: "native_to_js"; readonly audioRouteChanged: "native_to_js"; readonly incomingCallDisplayed: "native_to_js"; readonly incomingCallFailed: "native_to_js"; readonly providerReset: "native_to_js"; readonly showIncomingCallUi: "native_to_js"; readonly voipTokenUpdated: "native_to_js"; readonly voipTokenInvalidated: "native_to_js"; }; export declare const ANDROID_FCM_VICALL_TYPES: { readonly incomingCall: "incoming_call"; readonly cancelCall: "cancel_call"; }; export type AndroidFcmVicallType = (typeof ANDROID_FCM_VICALL_TYPES)[keyof typeof ANDROID_FCM_VICALL_TYPES]; /** Fields shared by every verified call identity crossing service ↔ native ↔ JS. */ export interface ServiceCallIdentity { /** * Stable RFC 4122 UUID. Reuse the same value for: * durable call records, native CallKit/Telecom UUIDs, push payloads, * and media-meeting orchestration keys. */ callId: string; /** Stable callee/caller handle shown to the OS (user id, phone, or email). */ handle: string; /** Human-readable name for system call UI. */ displayName: string; /** When true, system UI advertises a video call. */ hasVideo: boolean; /** Opaque service metadata echoed back on native events. Keep values JSON-safe. */ metadata: CallMetadata; } export interface AndroidIncomingCallData extends ServiceCallIdentity { } export interface AndroidCancelCallData { callId: string; reason: CallEndReason; } export interface IosVoipPushPayload extends ServiceCallIdentity { } export declare class ServiceProtocolError extends Error { readonly code: string; constructor(code: string, message: string); } export declare function validateCallId(value: unknown): string; /** * Validates Android FCM `data` for `vicallType=incoming_call`. * All FCM data values arrive as strings; this normalizes them for app/service tests. */ export declare function parseAndroidIncomingCallData(data: unknown): AndroidIncomingCallData; /** * Validates Android FCM `data` for `vicallType=cancel_call`. */ export declare function parseAndroidCancelCallData(data: unknown): AndroidCancelCallData; /** * Validates the JSON body a backend service should send through APNs VoIP push. * Native PushKit reports this payload to CallKit before JS boots. */ export declare function parseIosVoipPushPayload(payload: unknown): IosVoipPushPayload; /** * Builds the Android FCM data map a backend should send (all values strings). */ export declare function buildAndroidIncomingCallFcmData(call: ServiceCallIdentity): Record; /** * Builds the Android FCM cancel payload a backend should send. */ export declare function buildAndroidCancelCallFcmData(callId: string, reason?: CallEndReason): Record; /** * Builds the APNs VoIP JSON body a backend should send. */ export declare function buildIosVoipPushPayload(call: ServiceCallIdentity): Record; //# sourceMappingURL=service-protocol.d.ts.map