Search documentation

Search documentation

Core SDK@pillar-ai/sdk

Features

Toggle text selection helper and DOM scanning.

typescript
import Pillar from '@pillar-ai/sdk'

Methods

Pillar.setTextSelectionEnabled()

Enable or disable the text selection "Ask AI" popover at runtime.

typescript
setTextSelectionEnabled(enabled: boolean): void

Parameters

enabled
requiredboolean
- Whether to show the popover when text is selected

Example

tsx
// Disable text selection popover
pillar.setTextSelectionEnabled(false);
// Re-enable it
pillar.setTextSelectionEnabled(true);

Pillar.setDOMScanningEnabled()

Enable or disable DOM scanning at runtime.

typescript
setDOMScanningEnabled(_enabled: boolean): void

Parameters

_enabled
requiredboolean
- Ignored, DOM scanning cannot be enabled

Types

TextSelectionConfig

interface
typescript
interface TextSelectionConfig {
/** Whether to show "Ask AI" popover on text selection (default: true) */
enabled?: boolean;
/** Label for the popover button (default: 'Ask AI') */
label?: string;
}

Properties

enabled
boolean
Whether to show "Ask AI" popover on text selection (default: true)
label
string
Label for the popover button (default: 'Ask AI')

DOMScanningConfig

interface

DOM scanning configuration.

typescript
interface DOMScanningConfig {
/** @internal DOM scanning is disabled */
enabled?: boolean;
/** @internal */
includeText?: boolean;
/** @internal */
maxDepth?: number;
/** @internal */
visibleOnly?: boolean;
/** @internal */
excludeSelector?: string;
/** @internal */
maxTextLength?: number;
/** Configuration for highlighting elements during AI interactions. */
interactionHighlight?: InteractionHighlightConfig;
}

Properties

enabled
boolean
No description.
includeText
boolean
No description.
maxDepth
number
No description.
visibleOnly
boolean
No description.
excludeSelector
string
No description.
maxTextLength
number
No description.
interactionHighlight
InteractionHighlightConfig
Configuration for highlighting elements during AI interactions.