UNPKG

tanstack-shadcn-table

Version:

A powerful, feature-rich React table component built on top of TanStack Table v8 with shadcn/ui styling. Optimized bundle size with 55% reduction through peer dependencies.

60 lines (59 loc) 1.74 kB
/** * Security utilities for input sanitization and validation */ /** * Sanitizes HTML content to prevent XSS attacks */ export declare function sanitizeHtml(input: string): string; /** * Sanitizes search input to prevent injection attacks */ export declare function sanitizeSearchInput(input: string): string; /** * Validates and sanitizes column filter values */ export declare function sanitizeFilterValue(value: any, filterType: string): any; /** * Validates pagination parameters to prevent abuse */ export declare function validatePaginationParams(pageIndex: number, pageSize: number): { pageIndex: number; pageSize: number; }; /** * Validates sorting parameters */ export declare function validateSortingParams(sorting: any[]): any[]; /** * Rate limiting utility for preventing abuse */ export declare class RateLimiter { private requests; private readonly maxRequests; private readonly windowMs; constructor(maxRequests?: number, windowMs?: number); isAllowed(identifier: string): boolean; reset(identifier?: string): void; } /** * Content Security Policy helpers */ export declare const CSP_DIRECTIVES: { readonly "default-src": "'self'"; readonly "script-src": "'self' 'unsafe-inline'"; readonly "style-src": "'self' 'unsafe-inline'"; readonly "img-src": "'self' data: https:"; readonly "font-src": "'self' data:"; readonly "connect-src": "'self'"; readonly "frame-src": "'none'"; readonly "object-src": "'none'"; readonly "base-uri": "'self'"; readonly "form-action": "'self'"; }; /** * Validates file uploads (if used in custom cells) */ export declare function validateFileUpload(file: File): { isValid: boolean; error?: string; };