avada-feature-request
Version:
Feature Request component library for React applications
38 lines (37 loc) • 1.51 kB
TypeScript
import { FeatureRequestContextType } from "../types/featureRequest";
import { Shop } from "../types";
export interface FeatureRequestProviderProps {
/** Domain for app - required */
appDomain: string;
/** Prefix for app - optional */
prefix?: string;
/** Shop info - required */
activeShop: Shop;
/** Supported request types */
typeRequest?: ("new-feature" | "bug-report" | "improvement" | string)[];
/** Embedded app environment */
isEmbeddedAppEnv?: boolean;
/** Function to call authenticated API - required */
fetchAuthenticatedApi: <T = any>(url: string, options?: {
method?: string;
body?: any;
headers?: Record<string, string>;
}) => Promise<T>;
/** Callback when shop info is updated */
onShopInfoUpdate?: (shopInfo: Shop) => void;
/** Firebase config */
firebaseConfig?: {
apiKey: string;
authDomain: string;
databaseURL?: string;
projectId: string;
storageBucket?: string;
messagingSenderId?: string;
appId: string;
measurementId?: string;
};
children?: React.ReactNode;
}
declare const FeatureRequestContext: import("react").Context<FeatureRequestContextType | undefined>;
export declare const FeatureRequestProvider: ({ appDomain, prefix, activeShop, typeRequest, isEmbeddedAppEnv, fetchAuthenticatedApi, onShopInfoUpdate, firebaseConfig, children, }: FeatureRequestProviderProps) => React.JSX.Element;
export { FeatureRequestContext };