# @embedpdf/plugin-selection — ./contract SELECTION_DEFAULTS [VariableDeclaration]: SELECTION_DEFAULTS: SelectionSettings ={ dragThresholdPx: 4, color: null, handles:{ color: null, shadow: '0 1px 4px rgb(0 0 0 / 0.35)'} , } SelectionAnchor [InterfaceDeclaration]: export interface SelectionAnchor{ readonly page: PageRef; readonly bounds: Rect; } SelectionCapability [InterfaceDeclaration]: export interface SelectionCapability extends SettingsApi{ canSelect(): boolean; canCopy(): boolean; select(range: SelectionRangeInput): void; selectAll(): void; selectPage(page: PageRef | number): void; selectWordAt(page: PageRef | number, point: Point): boolean; selectLineAt(page: PageRef | number, point: Point): boolean; extendTo(page: PageRef | number, point: Point): void; clear(): void; hasSelection(): boolean; isSelecting(): boolean; getSnapshot(): SelectionSnapshot; getRange(): TextRange | null; listSelectedPages(): readonly PageRef[]; listSegments(page: PageRef | number): readonly SelectionSegment[]; listRects(page: PageRef | number): readonly Rect[]; getAnchor(): SelectionAnchor | null; readText(options?: OperationOptions): Promise; readTextInRange(range: TextRange, options?: OperationOptions): Promise; readonly onChanged: EventHook; readonly onCommitted: EventHook; readonly onCleared: EventHook; } SelectionChangedEvent [InterfaceDeclaration]: export interface SelectionChangedEvent{ readonly range: TextRange | null; readonly pages: readonly PageRef[]; } SelectionClearedEvent [TypeAliasDeclaration]: export type SelectionClearedEvent = Record; SelectionCommittedEvent [InterfaceDeclaration]: export interface SelectionCommittedEvent{ readonly range: TextRange; } SelectionConfig [TypeAliasDeclaration]: export type SelectionConfig = DeepPartial; SelectionEndpoint [InterfaceDeclaration]: export interface SelectionEndpoint{ readonly page: PageRef; readonly glyphQuad: Quad; readonly advance: 1 | -1; readonly rect: Rect; } SelectionRangeInput [TypeAliasDeclaration]: export type SelectionRangeInput = TextRange |{ page: PageRef; start: number; count: number} ; SelectionSegment [TypeAliasDeclaration] (from packages/plugin/selection/src/geometry.ts): export type SelectionSegment = PdfTextSegment; SelectionSettings [InterfaceDeclaration]: export interface SelectionSettings{ readonly dragThresholdPx: number; readonly color: string | null; readonly handles:{ readonly color: string | null; readonly shadow: string; } ; } SelectionSnapshot [InterfaceDeclaration]: export interface SelectionSnapshot{ readonly pages: readonly{ page: PageRef; segments: readonly SelectionSegment[]} []; readonly start: SelectionEndpoint | null; readonly end: SelectionEndpoint | null; readonly direction: 'forward' | 'backward'; readonly range: TextRange | null; } SelectionToken [VariableDeclaration] (from packages/plugin/selection/src/token.ts): SelectionToken = createCapabilityToken('selection', { hint: `add selectionPlugin() from '@embedpdf/plugin-selection' to your plugins list`, promises:{ readText: true, readTextInRange: true, } , } ) TextPosition [InterfaceDeclaration]: export interface TextPosition{ readonly page: PageRef; readonly index: number; } TextRange [InterfaceDeclaration]: export interface TextRange{ readonly start: TextPosition; readonly end: TextPosition; }