@feedal/embed
Version:
Feedal embed script to load feedback forms via JS or NPM
37 lines (36 loc) • 2.13 kB
TypeScript
import { EmbedOptions } from './types';
export declare function validateFormId(formId: string): boolean;
export declare function normalizeSize(size: string | number): string;
export declare function createQueryParams(options: EmbedOptions, sessionId?: string): URLSearchParams;
export declare function isMobile(): boolean;
export declare function getPositionStyles(position: string, offset?: {
x?: number;
y?: number;
}): Record<string, string>;
export declare function applyAnimation(element: HTMLElement, animation: string, type: 'enter' | 'exit'): Promise<void>;
export declare function getToastPosition(options: EmbedOptions): Record<string, string>;
export declare function getPopupStyles(options: EmbedOptions): Record<string, string>;
export declare function getFullscreenStyles(options: EmbedOptions): Record<string, string>;
export declare function getEmbeddedStyles(options: EmbedOptions): Record<string, string>;
export declare function getButtonStyles(options: EmbedOptions): Record<string, string>;
export declare function getSlideOverStyles(options: EmbedOptions): Record<string, string>;
export declare function getModalStyles(options: EmbedOptions): Record<string, string>;
export declare function getSidebarStyles(options: EmbedOptions): Record<string, string>;
export declare function getDrawerStyles(options: EmbedOptions): Record<string, string>;
export declare function getResponsiveBreakpoint(): 'mobile' | 'tablet' | 'desktop';
export declare function isReducedMotion(): boolean;
export declare function getFocusableElements(container: HTMLElement): HTMLElement[];
export declare function trapFocus(container: HTMLElement): () => void;
export declare function debounce<T extends (...args: any[]) => any>(func: T, wait: number): (...args: Parameters<T>) => void;
export declare function applyStyles(element: HTMLElement, styles: Record<string, string>): void;
export declare function getViewportDimensions(): {
width: number;
height: number;
};
export declare function clampToViewport(element: HTMLElement, position: {
x: number;
y: number;
}): {
x: number;
y: number;
};