@quentin-sommer/react-useragent
Version:
react-useragent React component
37 lines (36 loc) • 944 B
TypeScript
/// <reference types="ua-parser-js" />
import React from 'react';
import PropTypes from 'prop-types';
declare type UAResults = {
android: boolean;
ios: boolean;
mobile: boolean;
tablet: boolean;
windows: boolean;
mac: boolean;
linux: boolean;
computer: boolean;
firefox: boolean;
chrome: boolean;
edge: boolean;
safari: boolean;
};
declare type Props = {
ua: string;
};
declare type ContextProps = {
parser: UAParser | {};
uaResults: UAResults | {};
};
export declare const UAContext: React.Context<ContextProps>;
declare class UAProvider extends React.Component<Props> {
uaParser: UAParser;
uaResults: UAResults;
static propTypes: {
ua: PropTypes.Validator<string>;
children: PropTypes.Validator<PropTypes.ReactElementLike>;
};
constructor(props: Props);
render(): JSX.Element;
}
export default UAProvider;