@inov-ai/feedback-widget
Version:
Modern React feedback widget with surveys, analytics, and Next.js 15 support. Collect user feedback and run surveys in your SaaS applications.
72 lines • 2.75 kB
TypeScript
interface WidgetConfig {
primaryColor: string;
textColor: string;
backgroundColor: string;
fontFamily: string;
fontSize: string;
buttonRadius: string;
position: string;
buttonText: string;
buttonIcon: string;
theme: 'light' | 'dark' | string;
animation: string;
trigger: string;
triggerDelay: number;
surveyFrequency: string;
minimized: boolean;
feedbackTypes?: string[];
paths?: string[];
}
interface QuestionOption {
value: string;
label: string;
}
interface SurveyQuestion {
id: number;
question_text: string;
question_type: string;
options?: Array<QuestionOption | string>;
}
declare class FeedbackWidget {
private API_BASE;
private hasShownWidget;
private isLoading;
private currentSurvey;
private siteKey;
private config;
private container?;
private isCurrentlyVisible;
constructor();
detectSystemTheme(): 'light' | 'dark';
getConfig(): WidgetConfig;
setupTriggers(): void;
getSiteKeyFromScript(): string;
getFeedbackMetadata(): Promise<{
page_url: string;
user_agent: string;
ip: any;
}>;
getClientIP(): Promise<any>;
getPositionStyles(): "position: fixed; bottom: 20px; right: 20px;" | "position: fixed; bottom: 20px; left: 20px;" | "position: fixed; top: 20px; right: 20px;" | "position: fixed; top: 20px; left: 20px;";
getAnimationStyles(): "" | "\n @keyframes slideIn {\n from { transform: translate(-50%, -40%); opacity: 0; }\n to { transform: translate(-50%, -50%); opacity: 1; }\n }\n .fb-widget-modal {\n animation: slideIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);\n }\n " | "\n @keyframes fadeIn {\n from { opacity: 0; }\n to { opacity: 1; }\n }\n .fb-widget-modal {\n animation: fadeIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);\n }\n ";
injectStyles(): void;
createWidget(): void;
openModal(): Promise<void>;
getLoadingHTML(): string;
getFeedbackFormHTML(): string;
getSurveyFormHTML(): Promise<string>;
getQuestionInputHTML(question: SurveyQuestion): string;
handleFeedbackSubmit(form: HTMLFormElement): Promise<void>;
handleSurveySubmit(form: HTMLFormElement): Promise<void>;
showSuccess(): void;
showError(message: string): void;
detectParentTheme(): 'light' | 'dark';
watchThemeChanges(): void;
updateTheme(): void;
hasUserSetColor(colorProperty: string): boolean;
isPathAllowed(): boolean;
setupNavigationMonitoring(): void;
handleURLChange(): void;
removeWidget(): void;
}
//# sourceMappingURL=original_script_code.d.ts.map