@humanspeak/svelte-headless-table
Version:
A powerful, headless table library for Svelte that provides complete control over table UI while handling complex data operations like sorting, filtering, pagination, grouping, and row expansion. Build custom, accessible data tables with zero styling opin
20 lines (19 loc) • 711 B
TypeScript
/**
* Return type for Svelte actions.
* Contains optional lifecycle methods for updating and destroying the action.
*
* @template Props - The type of props passed to the action.
*/
export type ActionReturnType<Props = any> = {
/** Called when props change. */
update?: (_newProps: Props) => void;
/** Called when the element is removed from the DOM. */
destroy?: () => void;
};
/**
* A Svelte action function that can be applied to DOM elements.
* Actions receive an element and optional props, returning lifecycle methods.
*
* @template Props - The type of props passed to the action.
*/
export type Action<Props> = (_node: Element, _props?: Props) => ActionReturnType<Props> | void;