//#region src/position.d.ts type WidgetPosition = 'bottom-end' | 'bottom-start' | 'top-end' | 'top-start'; type LegacyWidgetPosition = 'bottom-right' | 'bottom-left'; type AnyWidgetPosition = WidgetPosition | LegacyWidgetPosition; //#endregion //#region src/types.d.ts type DisplayMode = 'popover' | 'side-sheet' | 'bottom-sheet'; type SheetSide = 'start' | 'end'; interface DisplayModeConfig { mode?: DisplayMode; side?: SheetSide; width?: string; height?: string; dismissOnBackdrop?: boolean; } interface ResolvedDisplayMode { mode: DisplayMode; side: SheetSide; width?: string; height?: string; dismissOnBackdrop: boolean; } interface WidgetPreferences { language?: string; themeMode?: 'light' | 'dark' | 'auto'; primaryColor?: string; position?: WidgetPosition; display?: DisplayModeConfig; } type BuiltInActionId = 'new-ticket' | 'my-tickets' | 'track' | 'preferences' | 'select-project'; type LocalizedString = string | Record; type ActionIcon = string | { kind: 'path'; path: string; } | { kind: 'url'; src: string; } | { kind: 'html'; html: string; }; type ActionTrigger = { kind: 'custom-event'; name: string; detail?: unknown; } | { kind: 'call-global'; path: string; args?: unknown[]; } | { kind: 'url'; href: string; target?: '_self' | '_blank'; }; interface ActionContext { actionId: string; input?: unknown; close(): void; keepOpen(): void; setBadge(value: string | number | null): void; setLoading(loading: boolean): void; user: { email?: string; name?: string; } | null; projectId: string; locale: string; openAction(id: string, input?: unknown): void; } interface MenuActionInput { id: string; label: LocalizedString; description?: LocalizedString; icon?: ActionIcon; section?: 'top' | 'bottom'; anchor?: { before?: BuiltInActionId | string; after?: BuiltInActionId | string; }; closeOnClick?: boolean; onClick?: (ctx: ActionContext) => void | Promise; trigger?: ActionTrigger; visible?: boolean | ((ctx: ActionContext) => boolean); badge?: string | number | null; display?: DisplayModeConfig; } interface MenuAction { id: string; label: LocalizedString; description?: LocalizedString; icon?: ActionIcon; section: 'top' | 'bottom'; anchor?: { before?: string; after?: string; }; closeOnClick?: boolean; onClick?: (ctx: ActionContext) => void | Promise; trigger?: ActionTrigger; visible?: boolean | ((ctx: ActionContext) => boolean); badge: string | number | null; display?: DisplayModeConfig; } interface ReqdeskWidgetConfig { apiKey: string; apiUrl?: string; auth?: OidcAuthConfig; widget?: 'ticket-form' | 'support-portal'; position?: AnyWidgetPosition; language?: string; theme?: ThemeConfig; customer?: CustomerConfig; defaultCategory?: string; translations?: Record; inline?: boolean; container?: string | HTMLElement; authMode?: AuthMode | AuthMode[]; display?: DisplayModeConfig; actions?: MenuActionInput[]; initialPreferences?: WidgetPreferences; userPreferences?: WidgetPreferences; onPreferencesChange?: (next: WidgetPreferences) => void; menuCloseOnAction?: boolean; hideFab?: boolean; /** * When true, omits the Display-mode picker from the in-widget Preferences view. Useful for * kiosk-style hosts that need to lock the display mode (e.g. always-side-sheet on a tablet). * The underlying `setPreferences({ display })` API stays accessible to host code regardless * — this flag only controls the user-facing UI control. Default false. */ hideDisplayModePicker?: boolean; /** * Glyph shown inside the floating action button. Accepts one of the built-in presets * (`'chat'` — classic chat bubble, `'help'` — chat bubble with a `?`, the default), or a raw * SVG path `d` string targeting a 24×24 viewBox for a fully custom icon. The React entry * additionally accepts a `ReactNode` for arbitrary JSX (SVG/icon-font/image) via * `ReqdeskProviderProps.fabIcon`. * * The default is `'help'` because it preserves the "open support" affordance users expect * from widgets like Intercom/Zendesk while visibly distinguishing this surface as help. */ fabIcon?: 'chat' | 'help' | string; } interface OidcAuthConfig { issuerUri: string; clientId: string; } interface ThemeConfig { primaryColor?: string; mode?: 'light' | 'dark' | 'auto'; borderRadius?: string; fontFamily?: string; zIndex?: number; logo?: string; brandName?: string; hideBranding?: boolean; } /** * A freshly-signed host-app identity pair. Returned by `CustomerConfig.refreshIdentity`. * * Both fields must be produced server-side — the signing secret must NEVER reach the browser. * See README § "Signed host-app identity" for the host endpoint pattern. */ interface SignedIdentity { userHash: string; userHashTimestamp: number; } interface CustomerConfig { email?: string; name?: string; externalId?: string; userHash?: string; userHashTimestamp?: number; /** * Optional — when set, the widget calls this callback to re-sign the caller identity before * any outgoing request whose current `userHashTimestamp` is older than the widget's staleness * threshold (5 minutes, half of the default 10-minute backend TTL). The callback must hit a * host-owned endpoint that computes the HMAC server-side — **never** ship the signing secret * to the browser. * * The widget dedupes in-flight refreshes, mutates `currentCustomer` in place with the fresh * pair, and falls back to the stale signature if the callback throws (the server then 401s * cleanly via `INVALID_SIGNATURE` instead of the widget hanging). * * Return either a plain object or a Promise — sync hosts that precompute short-lived tokens * can return synchronously; most hosts will return a Promise that fetches from their backend. */ refreshIdentity?: () => Promise | SignedIdentity; } type AuthMode = 'sso' | 'email' | 'signed'; type WidgetEvent = 'open' | 'close' | 'menu:opened' | 'action:triggered' | 'display-mode:changed' | 'prefs:changed' | 'ticket:created' | 'ticket:tracked' | 'reply:sent' | 'error'; type EventCallback = (data?: unknown) => void; type WidgetErrorCode = 'action-id-conflict' | 'action-missing-handler' | 'action-not-found' | 'action-handler-failed' | 'action-trigger-not-found' | 'action-visibility-failed' | string; /** * Per-field validation detail extracted from a JSON:API error document. `pointer` points at the * attribute that failed (e.g. `/data/attributes/priority`) so UIs can surface the message inline * next to the offending field instead of showing a generic banner. */ interface WidgetFieldError { code: string; detail: string; /** JSON:API source pointer, e.g. `/data/attributes/priority`. */ pointer?: string; /** Convenience accessor for the trailing segment of the pointer (e.g. `priority`). */ field?: string; } interface WidgetError { code: WidgetErrorCode; message: string; /** HTTP status returned by the backend, when the error originated from an HTTP response. */ status?: number; /** Expanded list of per-field errors from a JSON:API error document. Populated for 422 responses. */ errors?: WidgetFieldError[]; actionId?: string; cause?: unknown; } interface TicketResult { id: string; ticketNumber: string; trackingToken?: string; status: string; } interface TrackedTicketResult { id: string; ticketNumber: string; title: string; status: string; priority: string; createdAt: string; replies: PublicReply[]; } interface PublicReply { id: string; body: string; authorName: string; isStaff: boolean; createdAt: string; /** * Attachments posted alongside this reply. Populated when the backend emits per-reply * attachment resources in the JSON:API `included` array (reply-attachment relationship). * Undefined when the backend doesn't emit them or the reply has none. */ attachments?: Array<{ id: string; fileName: string; contentType: string; fileSize: number; downloadUrl?: string; }>; } type TicketPriority = 'low' | 'medium' | 'high' | 'critical'; interface SubmitTicketData { title: string; description?: string; priority?: TicketPriority; categoryId?: string; email: string; clientMetadata?: Record; /** * Optional tag IDs (ULIDs) to assign inline at create time. The backend validates membership * in the owning project and rejects the whole submission with 422 `TAG_NOT_FOUND` or * `INVALID_TAG_ID` if any ID is bogus — so the widget never creates a partially-tagged ticket. */ tagIds?: string[]; } interface TriggerMountOptions { variant?: 'pill' | 'ghost' | 'icon'; icon?: string | HTMLElement; label?: string; target?: 'menu' | { actionId: string; }; display?: DisplayMode | DisplayModeConfig; className?: string; style?: Partial; } //# sourceMappingURL=types.d.ts.map //#endregion export { WidgetError as C, WidgetPreferences as D, WidgetFieldError as E, AnyWidgetPosition as O, TriggerMountOptions as S, WidgetEvent as T, SheetSide as _, BuiltInActionId as a, TicketResult as b, DisplayModeConfig as c, MenuAction as d, MenuActionInput as f, ResolvedDisplayMode as g, ReqdeskWidgetConfig as h, AuthMode as i, WidgetPosition as k, EventCallback as l, PublicReply as m, ActionIcon as n, CustomerConfig as o, OidcAuthConfig as p, ActionTrigger as r, DisplayMode as s, ActionContext as t, LocalizedString as u, SubmitTicketData as v, WidgetErrorCode as w, TrackedTicketResult as x, ThemeConfig as y }; //# sourceMappingURL=types-C92DcfjU.d.cts.map