/** * Type declarations for @checkr/web-sdk. * * The SDK is a thin loader: embed prop contracts are defined by the zoid * `embedProps` definitions in web-sdk-services (src//embed.{js,ts}). * If you add or change a prop there, update these declarations in the same * change — the compiler cannot catch drift across the two repos. * * Each prop interface carries an index-signature escape hatch so that props * added server-side before these declarations catch up do not break * consumers' builds. */ export type CheckrEnv = | 'production' | 'staging' | 'sandbox' | 'local' | (string & {}) export interface ModalParams { /** CSS width of the modal content, e.g. '600px'. Default: '600px'. */ width?: string } /** Work location shape used by the NewInvitation embed. */ export interface WorkLocation { country?: string state?: string city?: string [key: string]: unknown } /** * Payload shapes below are transcribed from Checkr API responses observed in * web-sdk-services (api/*.js, fakeData/*). Known fields are optional and an * index signature admits fields the API adds — narrow before relying on them. */ /** An account hierarchy node (GET /nodes). */ export interface CheckrNode { custom_id?: string name?: string /** Package slugs orderable on this node. */ packages?: string[] parent_custom_id?: string | null tier?: string [key: string]: unknown } /** A screening within a package. */ export interface CheckrScreening { type?: string subtype?: string | null [key: string]: unknown } /** A background check package (GET /packages). */ export interface CheckrPackage { id?: string object?: string name?: string slug?: string /** Price in cents. */ price?: number | null drug_screening_price?: number | null screenings?: CheckrScreening[] apply_url?: string uri?: string created_at?: string deleted_at?: string | null requires_observed_drug_test?: boolean enabled_exams?: unknown[] [key: string]: unknown } /** A selectable work-location country. */ export interface CheckrCountry { /** ISO 3166-1 alpha-2 code, e.g. 'US'. */ code?: string name?: string [key: string]: unknown } /** The background check created by the NewInvitation embed (POST /background_checks). */ export interface CheckrBackgroundCheck { id?: string | number candidate_id?: string candidate_url?: string created_at?: string custom_external_status?: { code?: string message?: string [key: string]: unknown } external_background_check_id?: string | null external_candidate_id?: string | null external_job_application_id?: string | null external_requester_id?: string | null external_system?: string invitation?: { id?: string | number created_at?: string expires_at?: string | null deleted_at?: string | null [key: string]: unknown } package?: { id?: string | number name?: string slug?: string [key: string]: unknown } report?: { id?: string created_at?: string completed_at?: string | null estimated_completion_time?: number [key: string]: unknown } report_url?: string uri?: string metadata?: Record [key: string]: unknown } /** Props shared by every embed. */ export interface BaseEmbedProps { /** Checkr environment to load embed definitions from. */ env?: CheckrEnv /** Nonce applied to injected