Main d.ts export type UAParserHeaders

This commit is contained in:
Faisal Salman 2025-08-23 19:06:07 +07:00
parent c9badeb345
commit 98cf19c8c5

View File

@ -3,7 +3,6 @@
// Definitions by: Faisal Salman <https://github.com/faisalman> // Definitions by: Faisal Salman <https://github.com/faisalman>
import type { Headers } from "undici"; import type { Headers } from "undici";
import type { IncomingHttpHeaders } from "undici/types/header";
declare namespace UAParser { declare namespace UAParser {
@ -53,7 +52,7 @@ declare namespace UAParser {
type RegexMap = ((RegExp | string | (string | RegExp | Function)[])[])[]; type RegexMap = ((RegExp | string | (string | RegExp | Function)[])[])[];
type UAParserProps = 'browser' | 'cpu' | 'device' | 'engine' | 'os'; type UAParserProps = 'browser' | 'cpu' | 'device' | 'engine' | 'os';
type UAParserExt = Partial<Record<UAParserProps, RegexMap>> | Partial<Record<UAParserProps, RegexMap>>[]; type UAParserExt = Partial<Record<UAParserProps, RegexMap>> | Partial<Record<UAParserProps, RegexMap>>[];
type UAParserHeaders = Record<string, string> | IncomingHttpHeaders | Headers; export type UAParserHeaders = Record<string, string | string[] | undefined> | Headers;
export function UAParser(uastring?: string, extensions?: UAParserExt, headers?: UAParserHeaders): IResult; export function UAParser(uastring?: string, extensions?: UAParserExt, headers?: UAParserHeaders): IResult;
export function UAParser(uastring?: string, headers?: UAParserHeaders): IResult; export function UAParser(uastring?: string, headers?: UAParserHeaders): IResult;