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
enabledrequiredboolean
- Whether to show the popover when text is selected
Example
tsx
// Disable text selection popoverpillar.setTextSelectionEnabled(false);// Re-enable itpillar.setTextSelectionEnabled(true);
Pillar.setDOMScanningEnabled()
Enable or disable DOM scanning at runtime.
typescript
setDOMScanningEnabled(_enabled: boolean): void
Parameters
_enabledrequiredboolean
- Ignored, DOM scanning cannot be enabled
Types
TextSelectionConfig
interfacetypescript
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
enabledboolean
Whether to show "Ask AI" popover on text selection (default: true)
labelstring
Label for the popover button (default: 'Ask AI')
DOMScanningConfig
interfaceDOM 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
enabledboolean
No description.
includeTextboolean
No description.
maxDepthnumber
No description.
visibleOnlyboolean
No description.
excludeSelectorstring
No description.
maxTextLengthnumber
No description.
interactionHighlightInteractionHighlightConfig
Configuration for highlighting elements during AI interactions.