Skip to content
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion dist/browser/renderer.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/browser/renderer.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

36 changes: 36 additions & 0 deletions dist/libs/RcsCardContent.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
export interface RcsCardAction {
type: string;
title?: string | null;
url?: string | null;
phone?: string | null;
webview_size?: string | null;
}
export interface RcsCardContent {
content_type: string;
title?: string | null;
body?: string | null;
subtitle?: string | null;
media?: string | string[] | null;
actions?: RcsCardAction[] | null;
orientation?: string | null;
thumbnailImageAlignment?: string | null;
height?: string | null;
}
export type RcsContentClassification = 'Rich' | 'Rich media';
interface ClassificationResult {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
interface ClassificationResult {
export interface ClassificationResult {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The ClassificationResult interface is not exported, but it is used as the return type of the exported function classifyRcsContent. This prevents consumers of this module from properly typing the return value. Export this interface to make it accessible to module consumers.

classification: RcsContentClassification;
billableText: string;
}
/**
* Normalizes raw API JSON into the flat RcsCardContent format.
*
* The Twilio API returns rich content wrapped under a content-type key:
* { "twilio/card": { title: "...", body: null, ... } }
*
* This function detects that wrapper and extracts the inner object,
* setting `content_type` accordingly. If the input is already in the
* flat format (has a `content_type` string property), it is returned as-is.
*/
export declare const normalizeRcsContent: (raw: Record<string, unknown>) => RcsCardContent;
export declare const classifyRcsContent: (content: RcsCardContent) => ClassificationResult;
export {};
Loading
Loading