UNPKG

@quentin-sommer/react-useragent

Version:
49 lines (48 loc) 1.3 kB
/// <reference types="ua-parser-js" /> import PropTypes from 'prop-types'; import * as React from 'react'; export declare type UserAgentProps = { computer?: boolean; windows?: boolean; linux?: boolean; mac?: boolean; mobile?: boolean; tablet?: boolean; android?: boolean; ios?: boolean; firefox?: boolean; chrome?: boolean; edge?: boolean; safari?: boolean; }; declare type Props = { returnFullParser?: boolean; children?: any; } & UserAgentProps; declare class UserAgent extends React.Component<Props> { static contextType: React.Context<{ parser: {} | import("ua-parser-js"); 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; }; }>; static defaultProps: { returnFullParser: boolean; }; static propTypes: { returnFullParser: PropTypes.Requireable<boolean>; }; render(): React.ReactNode; } export default UserAgent;