TypeScript Types
TypeScript Types
Section titled “TypeScript Types”All types are available from the package type declarations (types/*.d.ts).
Table Component
Section titled “Table Component”import type { DsxColumn } from '@bnotk/dsx/components/table.js';
interface DsxColumn { id: string; // Field key in row data label: string; // Column header text resizable?: boolean; // Allow column resize (default: true) sortable?: boolean; // Allow column sort align?: 'left' | 'right' | 'center'; width?: string; // CSS width (e.g., '200px') hidden?: boolean; // Initially hidden}Dropdown Typeahead
Section titled “Dropdown Typeahead”import type { DsxOption } from '@bnotk/dsx/components/dropdown-typeahead.js';
interface DsxOption { value: string; // Option value label: string; // Display label disabled?: boolean; // Prevent selection}Dialog
Section titled “Dialog”// Size variantstype DsxDialogSize = 'sm' | 'md' | 'lg';
// Status variants (for confirmation dialogs)type DsxDialogStatus = 'warning' | 'error' | 'success' | '';Accordion
Section titled “Accordion”// Variant typestype DsxAccordionVariant = 'default' | 'card';Tooltip
Section titled “Tooltip”type DsxTooltipPlacement = 'top' | 'bottom' | 'left' | 'right';type DsxTooltipTrigger = 'hover' | 'click' | 'focus';Split Button
Section titled “Split Button”type DsxSplitVariant = 'primary' | 'secondary';Event Details
Section titled “Event Details”All custom events use CustomEvent<T> with typed detail payloads:
// Table eventsinterface DsxSortChangeDetail { column: string; direction: 'asc' | 'desc' | '' }interface DsxRowClickDetail { row: Record<string, unknown>; index: number }interface DsxColumnToggleDetail { column: string; visible: boolean }
// Dialog events// dsx-close: no detail
// Accordion item events// dsx-expand: no detail// dsx-collapse: no detail// dsx-remove: no detail
// Datepicker eventsinterface DsxDateChangeDetail { value: string } // ISO date string
// Dropdown Typeahead eventsinterface DsxDropdownChangeDetail { value: string | string[] }interface DsxSearchDetail { query: string }
// Form Wizard eventsinterface DsxStepChangeDetail { index: number; label: string }
// Side Panel eventsinterface DsxToggleDetail { open: boolean }
// Split Button eventsinterface DsxOptionSelectDetail { value: string }// dsx-click: no detail