@typeform/embed-react
Version:
Embed library for [React](https://reactjs.org/).
18 lines • 971 B
TypeScript
import React, { AriaAttributes, CSSProperties, MutableRefObject, ReactHTML, ReactNode } from 'react';
import { ButtonProps } from '@typeform/embed';
import { GenericEmbed } from '../utils';
type ButtonComponentBaseProps = {
id: string;
as?: keyof ReactHTML;
buttonProps?: ButtonProps & AriaAttributes;
style?: CSSProperties;
className?: string;
children?: ReactNode;
embedRef?: MutableRefObject<GenericEmbed | undefined>;
};
export type ButtonComponentProps<T> = T & ButtonComponentBaseProps;
type CreateFnProps<T> = Omit<ButtonComponentProps<T>, keyof ButtonComponentBaseProps>;
type CreateFn<T> = (id: string, props: CreateFnProps<T>) => GenericEmbed;
declare function makeButtonComponent<T>(createFn: CreateFn<T>, cssFilename: string): ({ id, children, as, style, className, buttonProps, embedRef, ...props }: ButtonComponentProps<T>) => React.JSX.Element;
export { makeButtonComponent };
//# sourceMappingURL=make-button-component.d.ts.map