import type { BulkRecordAction } from "../bulk-record-action.js"; import type { CallRecordingInsightTextSelectionAction } from "../call-recording-insight-text-selection-action.js"; import type { CallRecordingSummaryTextSelectionAction } from "../call-recording-summary-text-selection-action.js"; import type { CallRecordingTranscriptTextSelectionAction } from "../call-recording-transcript-text-selection-action.js"; import type { ObjectAction } from "../object-action.js"; import type { RecordAction } from "../record-action.js"; import type { RecordTab } from "../record-tab.js"; import type { RecordWidget } from "../record-widget.js"; /** * An action shown in the actions menu of a record page. * * @example * import {Extensions} from "attio/client" * * export default Extensions.defineExtension({ * type: "record-action", * id: "send-invoice", * label: "Send invoice", * icon: "Sales", * onTrigger: async ({recordId, object}) => { * // Do something * }, * }) */ export interface RecordActionExtension extends RecordAction { /** * Identifies this extension as a record action. */ readonly type: "record-action"; } /** * An action that runs over multiple records selected in a list, processing them in batches. * * @example * import {Extensions} from "attio/client" * * export default Extensions.defineExtension({ * type: "bulk-record-action", * id: "send-invoices", * label: "Send invoices", * icon: "Sales", * onTrigger: async ({runRecordBatches, object}) => { * await runRecordBatches({batchSize: 50}, async (batch) => { * // Process each batch of record ids * }) * }, * }) */ export interface BulkRecordActionExtension extends BulkRecordAction { /** * Identifies this extension as a bulk record action. */ readonly type: "bulk-record-action"; } /** * A React component rendered as a widget on a record page. * * @example * import {Extensions, Widget, WidgetTitle} from "attio/client" * * export default Extensions.defineExtension({ * type: "record-widget", * id: "weather-forecast", * label: "Weather forecast", * objects: "people", * Widget: ({recordId, object}) => ( * * Weather forecast * * ), * }) */ export interface RecordWidgetExtension extends RecordWidget { /** * Identifies this extension as a record widget. */ readonly type: "record-widget"; } /** * A React component rendered as a tab on a record page. * * @example * import {Extensions, Typography} from "attio/client" * * export default Extensions.defineExtension({ * type: "record-tab", * id: "enrichment", * label: "Enrichment", * objects: "companies", * Tab: ({recordId, object}) => ( * * Enrichment for {object} {recordId} * * ), * }) */ export interface RecordTabExtension extends RecordTab { /** * Identifies this extension as a record tab. */ readonly type: "record-tab"; } /** * An action that can be taken on an object. * * @example * import {Extensions} from "attio/client" * * export default Extensions.defineExtension({ * type: "object-action", * id: "import-companies", * label: "Import companies", * objects: "companies", * onTrigger: async ({object}) => { * // Do something * }, * }) */ export interface ObjectActionExtension extends ObjectAction { /** * Identifies this extension as an object action. */ readonly type: "object-action"; } /** * An action shown when a user selects text in a call recording insight. * * @example * import {Extensions} from "attio/client" * * export default Extensions.defineExtension({ * type: "call-recording-insight-text-action", * id: "reference-insight", * label: "Reference", * icon: "Link", * onTrigger: async ({text, markdown}) => { * // Do something * }, * }) */ export interface CallRecordingInsightActionExtension extends CallRecordingInsightTextSelectionAction { /** * Identifies this extension as an action on text selected in a call recording insight. */ readonly type: "call-recording-insight-text-action"; } /** * An action shown when a user selects text in a call recording summary. * * @example * import {Extensions} from "attio/client" * * export default Extensions.defineExtension({ * type: "call-recording-summary-text-action", * id: "reference-summary", * label: "Reference", * icon: "Link", * onTrigger: async ({text, markdown}) => { * // Do something * }, * }) */ export interface CallRecordingSummaryActionExtension extends CallRecordingSummaryTextSelectionAction { /** * Identifies this extension as an action on text selected in a call recording summary. */ readonly type: "call-recording-summary-text-action"; } /** * An action shown when a user selects text in a call recording transcript. * * @example * import {Extensions} from "attio/client" * * export default Extensions.defineExtension({ * type: "call-recording-transcript-text-action", * id: "reference-transcript", * label: "Reference", * icon: "Link", * onTrigger: async ({transcript, url}) => { * // Do something * }, * }) */ export interface CallRecordingTranscriptActionExtension extends CallRecordingTranscriptTextSelectionAction { /** * Identifies this extension as an action on text selected in a call recording transcript. */ readonly type: "call-recording-transcript-text-action"; } /** * A single extension your app adds to the Attio UI. * * The `type` field identifies the kind of extension and narrows the remaining configuration to * the matching shape. */ export type Extension = RecordActionExtension | BulkRecordActionExtension | RecordWidgetExtension | RecordTabExtension | ObjectActionExtension | CallRecordingInsightActionExtension | CallRecordingSummaryActionExtension | CallRecordingTranscriptActionExtension; //# sourceMappingURL=extension.d.ts.map