@utilix-tech/sdk 0.44.0 → 0.46.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -593,12 +593,67 @@ declare function buildPermissionsPolicy(features: PermissionsPolicyFeatureInput[
593
593
  declare function parsePermissionsPolicy(raw: string): PermissionsPolicyResult | {
594
594
  error: string;
595
595
  };
596
+ type ClientHintValueType = 'sf-list-brand' | 'boolean' | 'string' | 'number';
597
+ interface ClientHintDef {
598
+ name: string;
599
+ description: string;
600
+ lowEntropy: boolean;
601
+ valueType: ClientHintValueType;
602
+ }
603
+ declare const CLIENT_HINTS: ClientHintDef[];
604
+ interface ClientHintsBuildResult {
605
+ acceptCH: string;
606
+ criticalCH?: string;
607
+ hints: {
608
+ name: string;
609
+ description: string;
610
+ lowEntropy: boolean;
611
+ }[];
612
+ }
613
+ /**
614
+ * Build an `Accept-CH` response-header value from a list of client hint
615
+ * names the server wants the browser to send on future requests, attaching
616
+ * a plain-English note on what each hint reveals. Pass a subset of those
617
+ * names as `criticalHintNames` to also build a `Critical-CH` header value,
618
+ * for hints the server needs on the very first request of a session.
619
+ */
620
+ declare function buildClientHints(hintNames: string[], criticalHintNames?: string[]): ClientHintsBuildResult | {
621
+ error: string;
622
+ };
623
+ interface ParsedClientHint {
624
+ name: string;
625
+ rawValue: string;
626
+ description: string;
627
+ value: unknown;
628
+ }
629
+ interface ClientHintsParseResult {
630
+ hints: ParsedClientHint[];
631
+ unrecognized: {
632
+ name: string;
633
+ rawValue: string;
634
+ }[];
635
+ }
636
+ /**
637
+ * Parse raw request-header text, one `Header-Name: value` per line, into
638
+ * decoded client hint values: brand/version pairs for Sec-CH-UA-style
639
+ * headers, booleans for `?1`/`?0` values, unquoted strings, and numbers.
640
+ * Lines whose header name isn't a recognized client hint are returned
641
+ * separately under `unrecognized` rather than dropped.
642
+ */
643
+ declare function parseClientHintHeaders(rawHeaders: string): ClientHintsParseResult | {
644
+ error: string;
645
+ };
596
646
 
597
647
  type network_AuthResultEntry = AuthResultEntry;
598
648
  type network_BuildRangeHeaderOptions = BuildRangeHeaderOptions;
649
+ declare const network_CLIENT_HINTS: typeof CLIENT_HINTS;
599
650
  type network_CacheControlDirective = CacheControlDirective;
600
651
  type network_CacheControlOptions = CacheControlOptions;
601
652
  type network_CacheControlResult = CacheControlResult;
653
+ type network_ClientHintDef = ClientHintDef;
654
+ type network_ClientHintValueType = ClientHintValueType;
655
+ type network_ClientHintsBuildResult = ClientHintsBuildResult;
656
+ type network_ClientHintsParseResult = ClientHintsParseResult;
602
657
  type network_ContentRangeResult = ContentRangeResult;
603
658
  type network_CookieAttributes = CookieAttributes;
604
659
  type network_CookieCheckResult = CookieCheckResult;
@@ -626,6 +681,7 @@ type network_ManifestIconInfo = ManifestIconInfo;
626
681
  type network_ManifestIssue = ManifestIssue;
627
682
  type network_ManifestValidationResult = ManifestValidationResult;
628
683
  declare const network_PERMISSIONS_POLICY_FEATURES: typeof PERMISSIONS_POLICY_FEATURES;
684
+ type network_ParsedClientHint = ParsedClientHint;
629
685
  type network_ParsedDnsResult = ParsedDnsResult;
630
686
  type network_ParsedGeoResult = ParsedGeoResult;
631
687
  type network_PermissionsPolicyDirective = PermissionsPolicyDirective;
@@ -656,6 +712,7 @@ type network_VaryHeaderEntry = VaryHeaderEntry;
656
712
  type network_VaryHeaderResult = VaryHeaderResult;
657
713
  declare const network_analyzeEmailHeaders: typeof analyzeEmailHeaders;
658
714
  declare const network_buildCacheControl: typeof buildCacheControl;
715
+ declare const network_buildClientHints: typeof buildClientHints;
659
716
  declare const network_buildDnsQueryUrl: typeof buildDnsQueryUrl;
660
717
  declare const network_buildGeoUrl: typeof buildGeoUrl;
661
718
  declare const network_buildLinkHeader: typeof buildLinkHeader;
@@ -679,6 +736,7 @@ declare const network_isSuccess: typeof isSuccess;
679
736
  declare const network_isValidIp: typeof isValidIp;
680
737
  declare const network_isValidIpv4: typeof isValidIpv4;
681
738
  declare const network_isValidIpv6: typeof isValidIpv6;
739
+ declare const network_parseClientHintHeaders: typeof parseClientHintHeaders;
682
740
  declare const network_parseContentRangeHeader: typeof parseContentRangeHeader;
683
741
  declare const network_parseDnsResponse: typeof parseDnsResponse;
684
742
  declare const network_parseGeoResponse: typeof parseGeoResponse;
@@ -698,7 +756,7 @@ declare const network_validateManifest: typeof validateManifest;
698
756
  declare const network_validateRobotsTxt: typeof validateRobotsTxt;
699
757
  declare const network_validateSitemap: typeof validateSitemap;
700
758
  declare namespace network {
701
- export { type network_AuthResultEntry as AuthResultEntry, type network_BuildRangeHeaderOptions as BuildRangeHeaderOptions, type network_CacheControlDirective as CacheControlDirective, type network_CacheControlOptions as CacheControlOptions, type network_CacheControlResult as CacheControlResult, type network_ContentRangeResult as ContentRangeResult, type network_CookieAttributes as CookieAttributes, type network_CookieCheckResult as CookieCheckResult, network_DNS_RECORD_TYPES as DNS_RECORD_TYPES, type network_DnsRecord as DnsRecord, type network_DnsRecordType as DnsRecordType, type network_DnsResponse as DnsResponse, type network_EmailHeaderAnalysis as EmailHeaderAnalysis, type network_EmailHeaderField as EmailHeaderField, type network_GeoResult as GeoResult, network_HTTP_HEADERS as HTTP_HEADERS, type network_HarEntry as HarEntry, type network_HarParseResult as HarParseResult, type network_HarSummary as HarSummary, type network_HeaderCategory as HeaderCategory, type network_HttpHeader as HttpHeader, type network_Ipv6AddressType as Ipv6AddressType, type network_Ipv6ParseResult as Ipv6ParseResult, network_LINK_REL_VALUES as LINK_REL_VALUES, type network_LinkHeaderEntry as LinkHeaderEntry, type network_LinkHeaderEntryInput as LinkHeaderEntryInput, type network_LinkHeaderResult as LinkHeaderResult, type network_LinkRel as LinkRel, type network_ManifestIconInfo as ManifestIconInfo, type network_ManifestIssue as ManifestIssue, type network_ManifestValidationResult as ManifestValidationResult, network_PERMISSIONS_POLICY_FEATURES as PERMISSIONS_POLICY_FEATURES, type network_ParsedDnsResult as ParsedDnsResult, type network_ParsedGeoResult as ParsedGeoResult, type network_PermissionsPolicyDirective as PermissionsPolicyDirective, type network_PermissionsPolicyFeatureInput as PermissionsPolicyFeatureInput, type network_PermissionsPolicyResult as PermissionsPolicyResult, network_REFERRER_POLICY_VALUES as REFERRER_POLICY_VALUES, type network_RangeEntry as RangeEntry, type network_RangeEntryInput as RangeEntryInput, type network_RangeHeaderResult as RangeHeaderResult, type network_ReceivedHop as ReceivedHop, type network_ReferrerPolicyEntry as ReferrerPolicyEntry, type network_ReferrerPolicyResult as ReferrerPolicyResult, type network_ReferrerPolicyValue as ReferrerPolicyValue, type network_RobotsGroup as RobotsGroup, type network_RobotsIssue as RobotsIssue, type network_RobotsRule as RobotsRule, type network_RobotsValidationResult as RobotsValidationResult, network_STATUS_CODES as STATUS_CODES, type network_SameSiteValue as SameSiteValue, type network_SitemapIndexEntry as SitemapIndexEntry, type network_SitemapIssue as SitemapIssue, type network_SitemapUrlEntry as SitemapUrlEntry, type network_SitemapValidationResult as SitemapValidationResult, type network_StatusCode as StatusCode, type network_UaDeviceType as UaDeviceType, type network_UserAgentInfo as UserAgentInfo, type network_VaryHeaderEntry as VaryHeaderEntry, type network_VaryHeaderResult as VaryHeaderResult, network_analyzeEmailHeaders as analyzeEmailHeaders, network_buildCacheControl as buildCacheControl, network_buildDnsQueryUrl as buildDnsQueryUrl, network_buildGeoUrl as buildGeoUrl, network_buildLinkHeader as buildLinkHeader, network_buildMapUrl as buildMapUrl, network_buildPermissionsPolicy as buildPermissionsPolicy, network_buildRangeHeader as buildRangeHeader, network_buildReferrerPolicy as buildReferrerPolicy, network_buildVaryHeader as buildVaryHeader, network_checkSetCookieHeader as checkSetCookieHeader, network_countryCodeToFlag as countryCodeToFlag, network_formatCoordinates as formatCoordinates, network_formatTtl as formatTtl, network_getByCategory as getByCategory, network_getHeader as getHeader, network_getHeadersByCategory as getHeadersByCategory, network_getStatusByCategory as getStatusByCategory, network_getStatusCode as getStatusCode, network_isClientError as isClientError, network_isServerError as isServerError, network_isSuccess as isSuccess, network_isValidIp as isValidIp, network_isValidIpv4 as isValidIpv4, network_isValidIpv6 as isValidIpv6, network_parseContentRangeHeader as parseContentRangeHeader, network_parseDnsResponse as parseDnsResponse, network_parseGeoResponse as parseGeoResponse, network_parseHar as parseHar, network_parseIpv6Address as parseIpv6Address, network_parsePermissionsPolicy as parsePermissionsPolicy, network_parseUserAgent as parseUserAgent, network_parseVaryHeader as parseVaryHeader, network_searchHeaders as searchHeaders, network_searchStatusCodes as searchStatusCodes, network_statusCodeToText as statusCodeToText, network_typeNumberToLabel as typeNumberToLabel, network_validateDomain as validateDomain, network_validateHeaderName as validateHeaderName, network_validateHeaderValue as validateHeaderValue, network_validateManifest as validateManifest, network_validateRobotsTxt as validateRobotsTxt, network_validateSitemap as validateSitemap };
759
+ export { type network_AuthResultEntry as AuthResultEntry, type network_BuildRangeHeaderOptions as BuildRangeHeaderOptions, network_CLIENT_HINTS as CLIENT_HINTS, type network_CacheControlDirective as CacheControlDirective, type network_CacheControlOptions as CacheControlOptions, type network_CacheControlResult as CacheControlResult, type network_ClientHintDef as ClientHintDef, type network_ClientHintValueType as ClientHintValueType, type network_ClientHintsBuildResult as ClientHintsBuildResult, type network_ClientHintsParseResult as ClientHintsParseResult, type network_ContentRangeResult as ContentRangeResult, type network_CookieAttributes as CookieAttributes, type network_CookieCheckResult as CookieCheckResult, network_DNS_RECORD_TYPES as DNS_RECORD_TYPES, type network_DnsRecord as DnsRecord, type network_DnsRecordType as DnsRecordType, type network_DnsResponse as DnsResponse, type network_EmailHeaderAnalysis as EmailHeaderAnalysis, type network_EmailHeaderField as EmailHeaderField, type network_GeoResult as GeoResult, network_HTTP_HEADERS as HTTP_HEADERS, type network_HarEntry as HarEntry, type network_HarParseResult as HarParseResult, type network_HarSummary as HarSummary, type network_HeaderCategory as HeaderCategory, type network_HttpHeader as HttpHeader, type network_Ipv6AddressType as Ipv6AddressType, type network_Ipv6ParseResult as Ipv6ParseResult, network_LINK_REL_VALUES as LINK_REL_VALUES, type network_LinkHeaderEntry as LinkHeaderEntry, type network_LinkHeaderEntryInput as LinkHeaderEntryInput, type network_LinkHeaderResult as LinkHeaderResult, type network_LinkRel as LinkRel, type network_ManifestIconInfo as ManifestIconInfo, type network_ManifestIssue as ManifestIssue, type network_ManifestValidationResult as ManifestValidationResult, network_PERMISSIONS_POLICY_FEATURES as PERMISSIONS_POLICY_FEATURES, type network_ParsedClientHint as ParsedClientHint, type network_ParsedDnsResult as ParsedDnsResult, type network_ParsedGeoResult as ParsedGeoResult, type network_PermissionsPolicyDirective as PermissionsPolicyDirective, type network_PermissionsPolicyFeatureInput as PermissionsPolicyFeatureInput, type network_PermissionsPolicyResult as PermissionsPolicyResult, network_REFERRER_POLICY_VALUES as REFERRER_POLICY_VALUES, type network_RangeEntry as RangeEntry, type network_RangeEntryInput as RangeEntryInput, type network_RangeHeaderResult as RangeHeaderResult, type network_ReceivedHop as ReceivedHop, type network_ReferrerPolicyEntry as ReferrerPolicyEntry, type network_ReferrerPolicyResult as ReferrerPolicyResult, type network_ReferrerPolicyValue as ReferrerPolicyValue, type network_RobotsGroup as RobotsGroup, type network_RobotsIssue as RobotsIssue, type network_RobotsRule as RobotsRule, type network_RobotsValidationResult as RobotsValidationResult, network_STATUS_CODES as STATUS_CODES, type network_SameSiteValue as SameSiteValue, type network_SitemapIndexEntry as SitemapIndexEntry, type network_SitemapIssue as SitemapIssue, type network_SitemapUrlEntry as SitemapUrlEntry, type network_SitemapValidationResult as SitemapValidationResult, type network_StatusCode as StatusCode, type network_UaDeviceType as UaDeviceType, type network_UserAgentInfo as UserAgentInfo, type network_VaryHeaderEntry as VaryHeaderEntry, type network_VaryHeaderResult as VaryHeaderResult, network_analyzeEmailHeaders as analyzeEmailHeaders, network_buildCacheControl as buildCacheControl, network_buildClientHints as buildClientHints, network_buildDnsQueryUrl as buildDnsQueryUrl, network_buildGeoUrl as buildGeoUrl, network_buildLinkHeader as buildLinkHeader, network_buildMapUrl as buildMapUrl, network_buildPermissionsPolicy as buildPermissionsPolicy, network_buildRangeHeader as buildRangeHeader, network_buildReferrerPolicy as buildReferrerPolicy, network_buildVaryHeader as buildVaryHeader, network_checkSetCookieHeader as checkSetCookieHeader, network_countryCodeToFlag as countryCodeToFlag, network_formatCoordinates as formatCoordinates, network_formatTtl as formatTtl, network_getByCategory as getByCategory, network_getHeader as getHeader, network_getHeadersByCategory as getHeadersByCategory, network_getStatusByCategory as getStatusByCategory, network_getStatusCode as getStatusCode, network_isClientError as isClientError, network_isServerError as isServerError, network_isSuccess as isSuccess, network_isValidIp as isValidIp, network_isValidIpv4 as isValidIpv4, network_isValidIpv6 as isValidIpv6, network_parseClientHintHeaders as parseClientHintHeaders, network_parseContentRangeHeader as parseContentRangeHeader, network_parseDnsResponse as parseDnsResponse, network_parseGeoResponse as parseGeoResponse, network_parseHar as parseHar, network_parseIpv6Address as parseIpv6Address, network_parsePermissionsPolicy as parsePermissionsPolicy, network_parseUserAgent as parseUserAgent, network_parseVaryHeader as parseVaryHeader, network_searchHeaders as searchHeaders, network_searchStatusCodes as searchStatusCodes, network_statusCodeToText as statusCodeToText, network_typeNumberToLabel as typeNumberToLabel, network_validateDomain as validateDomain, network_validateHeaderName as validateHeaderName, network_validateHeaderValue as validateHeaderValue, network_validateManifest as validateManifest, network_validateRobotsTxt as validateRobotsTxt, network_validateSitemap as validateSitemap };
702
760
  }
703
761
 
704
- export { type SitemapIssue as $, type AuthResultEntry as A, type BuildRangeHeaderOptions as B, type CacheControlDirective as C, DNS_RECORD_TYPES as D, type EmailHeaderAnalysis as E, type PermissionsPolicyResult as F, type GeoResult as G, HTTP_HEADERS as H, type Ipv6AddressType as I, type RangeEntry as J, type RangeEntryInput as K, LINK_REL_VALUES as L, type ManifestIconInfo as M, type RangeHeaderResult as N, type ReceivedHop as O, PERMISSIONS_POLICY_FEATURES as P, type ReferrerPolicyEntry as Q, REFERRER_POLICY_VALUES as R, type ReferrerPolicyResult as S, type ReferrerPolicyValue as T, type RobotsGroup as U, type RobotsIssue as V, type RobotsRule as W, type RobotsValidationResult as X, STATUS_CODES as Y, type SameSiteValue as Z, type SitemapIndexEntry as _, type CacheControlOptions as a, type SitemapUrlEntry as a0, type SitemapValidationResult as a1, type StatusCode as a2, type UaDeviceType as a3, type UserAgentInfo as a4, type VaryHeaderEntry as a5, type VaryHeaderResult as a6, analyzeEmailHeaders as a7, buildCacheControl as a8, buildDnsQueryUrl as a9, parseIpv6Address as aA, parsePermissionsPolicy as aB, parseUserAgent as aC, parseVaryHeader as aD, searchHeaders as aE, searchStatusCodes as aF, statusCodeToText as aG, typeNumberToLabel as aH, validateDomain as aI, validateHeaderName as aJ, validateHeaderValue as aK, validateManifest as aL, validateRobotsTxt as aM, validateSitemap as aN, buildGeoUrl as aa, buildLinkHeader as ab, buildMapUrl as ac, buildPermissionsPolicy as ad, buildRangeHeader as ae, buildReferrerPolicy as af, buildVaryHeader as ag, checkSetCookieHeader as ah, countryCodeToFlag as ai, formatCoordinates as aj, formatTtl as ak, getByCategory as al, getHeader as am, getHeadersByCategory as an, getStatusByCategory as ao, getStatusCode as ap, isClientError as aq, isServerError as ar, isSuccess as as, isValidIp as at, isValidIpv4 as au, isValidIpv6 as av, parseContentRangeHeader as aw, parseDnsResponse as ax, parseGeoResponse as ay, parseHar as az, type CacheControlResult as b, type ContentRangeResult as c, type CookieAttributes as d, type CookieCheckResult as e, type DnsRecord as f, type DnsRecordType as g, type DnsResponse as h, type EmailHeaderField as i, type HarEntry as j, type HarParseResult as k, type HarSummary as l, type HeaderCategory as m, network as n, type HttpHeader as o, type Ipv6ParseResult as p, type LinkHeaderEntry as q, type LinkHeaderEntryInput as r, type LinkHeaderResult as s, type LinkRel as t, type ManifestIssue as u, type ManifestValidationResult as v, type ParsedDnsResult as w, type ParsedGeoResult as x, type PermissionsPolicyDirective as y, type PermissionsPolicyFeatureInput as z };
762
+ export { type RobotsIssue as $, type AuthResultEntry as A, type BuildRangeHeaderOptions as B, CLIENT_HINTS as C, DNS_RECORD_TYPES as D, type EmailHeaderAnalysis as E, type ManifestValidationResult as F, type GeoResult as G, HTTP_HEADERS as H, type Ipv6AddressType as I, type ParsedClientHint as J, type ParsedDnsResult as K, LINK_REL_VALUES as L, type ManifestIconInfo as M, type ParsedGeoResult as N, type PermissionsPolicyDirective as O, PERMISSIONS_POLICY_FEATURES as P, type PermissionsPolicyFeatureInput as Q, type PermissionsPolicyResult as R, REFERRER_POLICY_VALUES as S, type RangeEntry as T, type RangeEntryInput as U, type RangeHeaderResult as V, type ReceivedHop as W, type ReferrerPolicyEntry as X, type ReferrerPolicyResult as Y, type ReferrerPolicyValue as Z, type RobotsGroup as _, type CacheControlDirective as a, type RobotsRule as a0, type RobotsValidationResult as a1, STATUS_CODES as a2, type SameSiteValue as a3, type SitemapIndexEntry as a4, type SitemapIssue as a5, type SitemapUrlEntry as a6, type SitemapValidationResult as a7, type StatusCode as a8, type UaDeviceType as a9, isValidIp as aA, isValidIpv4 as aB, isValidIpv6 as aC, parseClientHintHeaders as aD, parseContentRangeHeader as aE, parseDnsResponse as aF, parseGeoResponse as aG, parseHar as aH, parseIpv6Address as aI, parsePermissionsPolicy as aJ, parseUserAgent as aK, parseVaryHeader as aL, searchHeaders as aM, searchStatusCodes as aN, statusCodeToText as aO, typeNumberToLabel as aP, validateDomain as aQ, validateHeaderName as aR, validateHeaderValue as aS, validateManifest as aT, validateRobotsTxt as aU, validateSitemap as aV, type UserAgentInfo as aa, type VaryHeaderEntry as ab, type VaryHeaderResult as ac, analyzeEmailHeaders as ad, buildCacheControl as ae, buildClientHints as af, buildDnsQueryUrl as ag, buildGeoUrl as ah, buildLinkHeader as ai, buildMapUrl as aj, buildPermissionsPolicy as ak, buildRangeHeader as al, buildReferrerPolicy as am, buildVaryHeader as an, checkSetCookieHeader as ao, countryCodeToFlag as ap, formatCoordinates as aq, formatTtl as ar, getByCategory as as, getHeader as at, getHeadersByCategory as au, getStatusByCategory as av, getStatusCode as aw, isClientError as ax, isServerError as ay, isSuccess as az, type CacheControlOptions as b, type CacheControlResult as c, type ClientHintDef as d, type ClientHintValueType as e, type ClientHintsBuildResult as f, type ClientHintsParseResult as g, type ContentRangeResult as h, type CookieAttributes as i, type CookieCheckResult as j, type DnsRecord as k, type DnsRecordType as l, type DnsResponse as m, network as n, type EmailHeaderField as o, type HarEntry as p, type HarParseResult as q, type HarSummary as r, type HeaderCategory as s, type HttpHeader as t, type Ipv6ParseResult as u, type LinkHeaderEntry as v, type LinkHeaderEntryInput as w, type LinkHeaderResult as x, type LinkRel as y, type ManifestIssue as z };
@@ -23,6 +23,7 @@
23
23
  * - readability-score: scoreReadability
24
24
  * - filler-word-detector: detectFillerWords
25
25
  * - sentence-length-distribution: analyzeSentenceLengths
26
+ * - keyword-density-analyzer: analyzeKeywordDensity
26
27
  * - emoji-lookup : searchEmoji, getEmojiByShortcode, getEmojiByChar, getEmojiByCategory, getEmojiCategories, EMOJI_TABLE
27
28
  */
28
29
  interface WordCountResult {
@@ -357,6 +358,33 @@ interface SentenceLengthDistribution {
357
358
  * (e.g. "Dr.") as sentence boundaries.
358
359
  */
359
360
  declare function analyzeSentenceLengths(text: string): SentenceLengthDistribution;
361
+ interface KeywordDensityEntry {
362
+ keyword: string;
363
+ count: number;
364
+ density: number;
365
+ }
366
+ interface KeywordDensityResult {
367
+ totalWords: number;
368
+ uniqueKeywords: number;
369
+ ngramSize: number;
370
+ keywords: KeywordDensityEntry[];
371
+ }
372
+ interface KeywordDensityOptions {
373
+ topN?: number;
374
+ minWordLength?: number;
375
+ ngramSize?: number;
376
+ }
377
+ /**
378
+ * Count keyword/phrase frequency and density (occurrences per 100 words)
379
+ * across a block of text, the way an SEO keyword-density checker does.
380
+ * With the default ngramSize of 1, common English stopwords and words
381
+ * shorter than minWordLength are excluded; for ngramSize 2 or 3 (phrases),
382
+ * stopwords are kept since useful phrases often contain them, but every
383
+ * word in the phrase must still meet minWordLength.
384
+ */
385
+ declare function analyzeKeywordDensity(text: string, options?: KeywordDensityOptions): KeywordDensityResult | {
386
+ error: string;
387
+ };
360
388
  interface EmojiEntry {
361
389
  emoji: string;
362
390
  name: string;
@@ -401,6 +429,9 @@ type text_EscapeMode = EscapeMode;
401
429
  type text_FillerCategory = FillerCategory;
402
430
  type text_FillerMatch = FillerMatch;
403
431
  type text_FillerWordResult = FillerWordResult;
432
+ type text_KeywordDensityEntry = KeywordDensityEntry;
433
+ type text_KeywordDensityOptions = KeywordDensityOptions;
434
+ type text_KeywordDensityResult = KeywordDensityResult;
404
435
  declare const text_LINE_OPS: typeof LINE_OPS;
405
436
  type text_LineOp = LineOp;
406
437
  type text_LineType = LineType;
@@ -424,6 +455,7 @@ type text_TableOptions = TableOptions;
424
455
  type text_TextAnalysis = TextAnalysis;
425
456
  type text_WordCountResult = WordCountResult;
426
457
  declare const text_addBorder: typeof addBorder;
458
+ declare const text_analyzeKeywordDensity: typeof analyzeKeywordDensity;
427
459
  declare const text_analyzeSentenceLengths: typeof analyzeSentenceLengths;
428
460
  declare const text_analyzeText: typeof analyzeText;
429
461
  declare const text_applyOp: typeof applyOp;
@@ -483,7 +515,7 @@ declare const text_textToMorse: typeof textToMorse;
483
515
  declare const text_unescapeString: typeof unescapeString;
484
516
  declare const text_wordFrequency: typeof wordFrequency;
485
517
  declare namespace text {
486
- export { type text_AsciiFont as AsciiFont, type text_AsciiOptions as AsciiOptions, text_CASE_FORMATS as CASE_FORMATS, type text_CaseFormat as CaseFormat, type text_ConvertOptions as ConvertOptions, text_DEFAULT_CONVERT_OPTIONS as DEFAULT_CONVERT_OPTIONS, type text_DiffFile as DiffFile, type text_DiffHunk as DiffHunk, type text_DiffLine as DiffLine, type text_DiffResult as DiffResult, type text_DiffType as DiffType, type text_DiffViewerLine as DiffViewerLine, text_EMOJI_TABLE as EMOJI_TABLE, text_ESCAPE_MODES as ESCAPE_MODES, type text_EmojiEntry as EmojiEntry, type text_EscapeMode as EscapeMode, type text_FillerCategory as FillerCategory, type text_FillerMatch as FillerMatch, type text_FillerWordResult as FillerWordResult, text_LINE_OPS as LINE_OPS, type text_LineOp as LineOp, type text_LineType as LineType, type text_LoremUnit as LoremUnit, text_MORSE_CODE as MORSE_CODE, type text_MarkdownResult as MarkdownResult, type text_MorseOptions as MorseOptions, type text_ParsedDiff as ParsedDiff, type text_ParsedTable as ParsedTable, type text_PassiveVoiceMatch as PassiveVoiceMatch, type text_PassiveVoiceResult as PassiveVoiceResult, type text_PassiveVoiceSentence as PassiveVoiceSentence, type text_ReadabilityResult as ReadabilityResult, type text_ReadabilityScore as ReadabilityScore, type text_SentenceLengthBucket as SentenceLengthBucket, type text_SentenceLengthDistribution as SentenceLengthDistribution, type text_SlugSeparator as SlugSeparator, type text_StringDistanceMode as StringDistanceMode, type text_StringDistanceResult as StringDistanceResult, type text_TableOptions as TableOptions, type text_TextAnalysis as TextAnalysis, type text_WordCountResult as WordCountResult, text_addBorder as addBorder, text_analyzeSentenceLengths as analyzeSentenceLengths, text_analyzeText as analyzeText, text_applyOp as applyOp, text_applyOps as applyOps, text_calculateStringDistance as calculateStringDistance, text_centerText as centerText, text_convertAll as convertAll, text_convertCase as convertCase, text_countWords as countWords, text_csvToHtml as csvToHtml, text_csvToMarkdown as csvToMarkdown, text_detectDelimiter as detectDelimiter, text_detectFillerWords as detectFillerWords, text_detectPassiveVoice as detectPassiveVoice, text_diffLines as diffLines, text_diffLinesSimple as diffLinesSimple, text_diffStats as diffStats, text_escapeAll as escapeAll, text_escapeString as escapeString, text_extractHeadings as extractHeadings, text_formatReadingTime as formatReadingTime, text_generate as generate, text_generateDiff as generateDiff, text_generateHtmlTable as generateHtmlTable, text_generateMarkdownTable as generateMarkdownTable, text_generateParagraphs as generateParagraphs, text_generateSentences as generateSentences, text_generateWords as generateWords, text_getAvailableFonts as getAvailableFonts, text_getEmojiByCategory as getEmojiByCategory, text_getEmojiByChar as getEmojiByChar, text_getEmojiByShortcode as getEmojiByShortcode, text_getEmojiCategories as getEmojiCategories, text_getMorseForChar as getMorseForChar, text_getMorseTiming as getMorseTiming, text_htmlToMarkdown as htmlToMarkdown, text_isValidMorse as isValidMorse, text_markdownToHtml as markdownToHtml, text_morseToText as morseToText, text_numberToOrdinal as numberToOrdinal, text_numberToRoman as numberToRoman, text_numberToWords as numberToWords, text_ordinalWords as ordinalWords, text_parseDiff as parseDiff, text_parseTableData as parseTableData, text_readabilityScore as readabilityScore, text_renderMarkdown as renderMarkdown, text_romanToNumber as romanToNumber, text_scoreReadability as scoreReadability, text_searchEmoji as searchEmoji, text_sentenceCount as sentenceCount, text_slugify as slugify, text_slugifyAll as slugifyAll, text_syllableCount as syllableCount, text_textToAscii as textToAscii, text_textToMorse as textToMorse, text_unescapeString as unescapeString, text_wordFrequency as wordFrequency };
518
+ export { type text_AsciiFont as AsciiFont, type text_AsciiOptions as AsciiOptions, text_CASE_FORMATS as CASE_FORMATS, type text_CaseFormat as CaseFormat, type text_ConvertOptions as ConvertOptions, text_DEFAULT_CONVERT_OPTIONS as DEFAULT_CONVERT_OPTIONS, type text_DiffFile as DiffFile, type text_DiffHunk as DiffHunk, type text_DiffLine as DiffLine, type text_DiffResult as DiffResult, type text_DiffType as DiffType, type text_DiffViewerLine as DiffViewerLine, text_EMOJI_TABLE as EMOJI_TABLE, text_ESCAPE_MODES as ESCAPE_MODES, type text_EmojiEntry as EmojiEntry, type text_EscapeMode as EscapeMode, type text_FillerCategory as FillerCategory, type text_FillerMatch as FillerMatch, type text_FillerWordResult as FillerWordResult, type text_KeywordDensityEntry as KeywordDensityEntry, type text_KeywordDensityOptions as KeywordDensityOptions, type text_KeywordDensityResult as KeywordDensityResult, text_LINE_OPS as LINE_OPS, type text_LineOp as LineOp, type text_LineType as LineType, type text_LoremUnit as LoremUnit, text_MORSE_CODE as MORSE_CODE, type text_MarkdownResult as MarkdownResult, type text_MorseOptions as MorseOptions, type text_ParsedDiff as ParsedDiff, type text_ParsedTable as ParsedTable, type text_PassiveVoiceMatch as PassiveVoiceMatch, type text_PassiveVoiceResult as PassiveVoiceResult, type text_PassiveVoiceSentence as PassiveVoiceSentence, type text_ReadabilityResult as ReadabilityResult, type text_ReadabilityScore as ReadabilityScore, type text_SentenceLengthBucket as SentenceLengthBucket, type text_SentenceLengthDistribution as SentenceLengthDistribution, type text_SlugSeparator as SlugSeparator, type text_StringDistanceMode as StringDistanceMode, type text_StringDistanceResult as StringDistanceResult, type text_TableOptions as TableOptions, type text_TextAnalysis as TextAnalysis, type text_WordCountResult as WordCountResult, text_addBorder as addBorder, text_analyzeKeywordDensity as analyzeKeywordDensity, text_analyzeSentenceLengths as analyzeSentenceLengths, text_analyzeText as analyzeText, text_applyOp as applyOp, text_applyOps as applyOps, text_calculateStringDistance as calculateStringDistance, text_centerText as centerText, text_convertAll as convertAll, text_convertCase as convertCase, text_countWords as countWords, text_csvToHtml as csvToHtml, text_csvToMarkdown as csvToMarkdown, text_detectDelimiter as detectDelimiter, text_detectFillerWords as detectFillerWords, text_detectPassiveVoice as detectPassiveVoice, text_diffLines as diffLines, text_diffLinesSimple as diffLinesSimple, text_diffStats as diffStats, text_escapeAll as escapeAll, text_escapeString as escapeString, text_extractHeadings as extractHeadings, text_formatReadingTime as formatReadingTime, text_generate as generate, text_generateDiff as generateDiff, text_generateHtmlTable as generateHtmlTable, text_generateMarkdownTable as generateMarkdownTable, text_generateParagraphs as generateParagraphs, text_generateSentences as generateSentences, text_generateWords as generateWords, text_getAvailableFonts as getAvailableFonts, text_getEmojiByCategory as getEmojiByCategory, text_getEmojiByChar as getEmojiByChar, text_getEmojiByShortcode as getEmojiByShortcode, text_getEmojiCategories as getEmojiCategories, text_getMorseForChar as getMorseForChar, text_getMorseTiming as getMorseTiming, text_htmlToMarkdown as htmlToMarkdown, text_isValidMorse as isValidMorse, text_markdownToHtml as markdownToHtml, text_morseToText as morseToText, text_numberToOrdinal as numberToOrdinal, text_numberToRoman as numberToRoman, text_numberToWords as numberToWords, text_ordinalWords as ordinalWords, text_parseDiff as parseDiff, text_parseTableData as parseTableData, text_readabilityScore as readabilityScore, text_renderMarkdown as renderMarkdown, text_romanToNumber as romanToNumber, text_scoreReadability as scoreReadability, text_searchEmoji as searchEmoji, text_sentenceCount as sentenceCount, text_slugify as slugify, text_slugifyAll as slugifyAll, text_syllableCount as syllableCount, text_textToAscii as textToAscii, text_textToMorse as textToMorse, text_unescapeString as unescapeString, text_wordFrequency as wordFrequency };
487
519
  }
488
520
 
489
- export { csvToMarkdown as $, type AsciiFont as A, type SlugSeparator as B, CASE_FORMATS as C, DEFAULT_CONVERT_OPTIONS as D, EMOJI_TABLE as E, type FillerCategory as F, type StringDistanceMode as G, type StringDistanceResult as H, type TextAnalysis as I, addBorder as J, analyzeSentenceLengths as K, LINE_OPS as L, MORSE_CODE as M, analyzeText as N, applyOp as O, type ParsedDiff as P, applyOps as Q, type ReadabilityResult as R, type SentenceLengthBucket as S, type TableOptions as T, calculateStringDistance as U, centerText as V, type WordCountResult as W, convertAll as X, convertCase as Y, countWords as Z, csvToHtml as _, type AsciiOptions as a, detectDelimiter as a0, detectFillerWords as a1, detectPassiveVoice as a2, diffLines as a3, diffLinesSimple as a4, diffStats as a5, escapeAll as a6, escapeString as a7, extractHeadings as a8, formatReadingTime as a9, romanToNumber as aA, scoreReadability as aB, searchEmoji as aC, sentenceCount as aD, slugify as aE, slugifyAll as aF, syllableCount as aG, textToAscii as aH, textToMorse as aI, unescapeString as aJ, wordFrequency as aK, generate as aa, generateDiff as ab, generateHtmlTable as ac, generateMarkdownTable as ad, generateParagraphs as ae, generateSentences as af, generateWords as ag, getAvailableFonts as ah, getEmojiByCategory as ai, getEmojiByChar as aj, getEmojiByShortcode as ak, getEmojiCategories as al, getMorseForChar as am, getMorseTiming as an, htmlToMarkdown as ao, isValidMorse as ap, markdownToHtml as aq, morseToText as ar, numberToOrdinal as as, numberToRoman as at, numberToWords as au, ordinalWords as av, parseDiff as aw, parseTableData as ax, readabilityScore as ay, renderMarkdown as az, type CaseFormat as b, type ConvertOptions as c, type DiffFile as d, type DiffHunk as e, type DiffLine as f, type DiffResult as g, type DiffType as h, type DiffViewerLine as i, ESCAPE_MODES as j, type EmojiEntry as k, type EscapeMode as l, type FillerMatch as m, type FillerWordResult as n, type LineOp as o, type LineType as p, type LoremUnit as q, type MarkdownResult as r, type MorseOptions as s, text as t, type ParsedTable as u, type PassiveVoiceMatch as v, type PassiveVoiceResult as w, type PassiveVoiceSentence as x, type ReadabilityScore as y, type SentenceLengthDistribution as z };
521
+ export { convertAll as $, type AsciiFont as A, type ReadabilityScore as B, CASE_FORMATS as C, DEFAULT_CONVERT_OPTIONS as D, EMOJI_TABLE as E, type FillerCategory as F, type SentenceLengthDistribution as G, type SlugSeparator as H, type StringDistanceMode as I, type StringDistanceResult as J, type KeywordDensityEntry as K, LINE_OPS as L, MORSE_CODE as M, type TextAnalysis as N, addBorder as O, type ParsedDiff as P, analyzeKeywordDensity as Q, type ReadabilityResult as R, type SentenceLengthBucket as S, type TableOptions as T, analyzeSentenceLengths as U, analyzeText as V, type WordCountResult as W, applyOp as X, applyOps as Y, calculateStringDistance as Z, centerText as _, type AsciiOptions as a, convertCase as a0, countWords as a1, csvToHtml as a2, csvToMarkdown as a3, detectDelimiter as a4, detectFillerWords as a5, detectPassiveVoice as a6, diffLines as a7, diffLinesSimple as a8, diffStats as a9, parseDiff as aA, parseTableData as aB, readabilityScore as aC, renderMarkdown as aD, romanToNumber as aE, scoreReadability as aF, searchEmoji as aG, sentenceCount as aH, slugify as aI, slugifyAll as aJ, syllableCount as aK, textToAscii as aL, textToMorse as aM, unescapeString as aN, wordFrequency as aO, escapeAll as aa, escapeString as ab, extractHeadings as ac, formatReadingTime as ad, generate as ae, generateDiff as af, generateHtmlTable as ag, generateMarkdownTable as ah, generateParagraphs as ai, generateSentences as aj, generateWords as ak, getAvailableFonts as al, getEmojiByCategory as am, getEmojiByChar as an, getEmojiByShortcode as ao, getEmojiCategories as ap, getMorseForChar as aq, getMorseTiming as ar, htmlToMarkdown as as, isValidMorse as at, markdownToHtml as au, morseToText as av, numberToOrdinal as aw, numberToRoman as ax, numberToWords as ay, ordinalWords as az, type CaseFormat as b, type ConvertOptions as c, type DiffFile as d, type DiffHunk as e, type DiffLine as f, type DiffResult as g, type DiffType as h, type DiffViewerLine as i, ESCAPE_MODES as j, type EmojiEntry as k, type EscapeMode as l, type FillerMatch as m, type FillerWordResult as n, type KeywordDensityOptions as o, type KeywordDensityResult as p, type LineOp as q, type LineType as r, type LoremUnit as s, text as t, type MarkdownResult as u, type MorseOptions as v, type ParsedTable as w, type PassiveVoiceMatch as x, type PassiveVoiceResult as y, type PassiveVoiceSentence as z };
@@ -23,6 +23,7 @@
23
23
  * - readability-score: scoreReadability
24
24
  * - filler-word-detector: detectFillerWords
25
25
  * - sentence-length-distribution: analyzeSentenceLengths
26
+ * - keyword-density-analyzer: analyzeKeywordDensity
26
27
  * - emoji-lookup : searchEmoji, getEmojiByShortcode, getEmojiByChar, getEmojiByCategory, getEmojiCategories, EMOJI_TABLE
27
28
  */
28
29
  interface WordCountResult {
@@ -357,6 +358,33 @@ interface SentenceLengthDistribution {
357
358
  * (e.g. "Dr.") as sentence boundaries.
358
359
  */
359
360
  declare function analyzeSentenceLengths(text: string): SentenceLengthDistribution;
361
+ interface KeywordDensityEntry {
362
+ keyword: string;
363
+ count: number;
364
+ density: number;
365
+ }
366
+ interface KeywordDensityResult {
367
+ totalWords: number;
368
+ uniqueKeywords: number;
369
+ ngramSize: number;
370
+ keywords: KeywordDensityEntry[];
371
+ }
372
+ interface KeywordDensityOptions {
373
+ topN?: number;
374
+ minWordLength?: number;
375
+ ngramSize?: number;
376
+ }
377
+ /**
378
+ * Count keyword/phrase frequency and density (occurrences per 100 words)
379
+ * across a block of text, the way an SEO keyword-density checker does.
380
+ * With the default ngramSize of 1, common English stopwords and words
381
+ * shorter than minWordLength are excluded; for ngramSize 2 or 3 (phrases),
382
+ * stopwords are kept since useful phrases often contain them, but every
383
+ * word in the phrase must still meet minWordLength.
384
+ */
385
+ declare function analyzeKeywordDensity(text: string, options?: KeywordDensityOptions): KeywordDensityResult | {
386
+ error: string;
387
+ };
360
388
  interface EmojiEntry {
361
389
  emoji: string;
362
390
  name: string;
@@ -401,6 +429,9 @@ type text_EscapeMode = EscapeMode;
401
429
  type text_FillerCategory = FillerCategory;
402
430
  type text_FillerMatch = FillerMatch;
403
431
  type text_FillerWordResult = FillerWordResult;
432
+ type text_KeywordDensityEntry = KeywordDensityEntry;
433
+ type text_KeywordDensityOptions = KeywordDensityOptions;
434
+ type text_KeywordDensityResult = KeywordDensityResult;
404
435
  declare const text_LINE_OPS: typeof LINE_OPS;
405
436
  type text_LineOp = LineOp;
406
437
  type text_LineType = LineType;
@@ -424,6 +455,7 @@ type text_TableOptions = TableOptions;
424
455
  type text_TextAnalysis = TextAnalysis;
425
456
  type text_WordCountResult = WordCountResult;
426
457
  declare const text_addBorder: typeof addBorder;
458
+ declare const text_analyzeKeywordDensity: typeof analyzeKeywordDensity;
427
459
  declare const text_analyzeSentenceLengths: typeof analyzeSentenceLengths;
428
460
  declare const text_analyzeText: typeof analyzeText;
429
461
  declare const text_applyOp: typeof applyOp;
@@ -483,7 +515,7 @@ declare const text_textToMorse: typeof textToMorse;
483
515
  declare const text_unescapeString: typeof unescapeString;
484
516
  declare const text_wordFrequency: typeof wordFrequency;
485
517
  declare namespace text {
486
- export { type text_AsciiFont as AsciiFont, type text_AsciiOptions as AsciiOptions, text_CASE_FORMATS as CASE_FORMATS, type text_CaseFormat as CaseFormat, type text_ConvertOptions as ConvertOptions, text_DEFAULT_CONVERT_OPTIONS as DEFAULT_CONVERT_OPTIONS, type text_DiffFile as DiffFile, type text_DiffHunk as DiffHunk, type text_DiffLine as DiffLine, type text_DiffResult as DiffResult, type text_DiffType as DiffType, type text_DiffViewerLine as DiffViewerLine, text_EMOJI_TABLE as EMOJI_TABLE, text_ESCAPE_MODES as ESCAPE_MODES, type text_EmojiEntry as EmojiEntry, type text_EscapeMode as EscapeMode, type text_FillerCategory as FillerCategory, type text_FillerMatch as FillerMatch, type text_FillerWordResult as FillerWordResult, text_LINE_OPS as LINE_OPS, type text_LineOp as LineOp, type text_LineType as LineType, type text_LoremUnit as LoremUnit, text_MORSE_CODE as MORSE_CODE, type text_MarkdownResult as MarkdownResult, type text_MorseOptions as MorseOptions, type text_ParsedDiff as ParsedDiff, type text_ParsedTable as ParsedTable, type text_PassiveVoiceMatch as PassiveVoiceMatch, type text_PassiveVoiceResult as PassiveVoiceResult, type text_PassiveVoiceSentence as PassiveVoiceSentence, type text_ReadabilityResult as ReadabilityResult, type text_ReadabilityScore as ReadabilityScore, type text_SentenceLengthBucket as SentenceLengthBucket, type text_SentenceLengthDistribution as SentenceLengthDistribution, type text_SlugSeparator as SlugSeparator, type text_StringDistanceMode as StringDistanceMode, type text_StringDistanceResult as StringDistanceResult, type text_TableOptions as TableOptions, type text_TextAnalysis as TextAnalysis, type text_WordCountResult as WordCountResult, text_addBorder as addBorder, text_analyzeSentenceLengths as analyzeSentenceLengths, text_analyzeText as analyzeText, text_applyOp as applyOp, text_applyOps as applyOps, text_calculateStringDistance as calculateStringDistance, text_centerText as centerText, text_convertAll as convertAll, text_convertCase as convertCase, text_countWords as countWords, text_csvToHtml as csvToHtml, text_csvToMarkdown as csvToMarkdown, text_detectDelimiter as detectDelimiter, text_detectFillerWords as detectFillerWords, text_detectPassiveVoice as detectPassiveVoice, text_diffLines as diffLines, text_diffLinesSimple as diffLinesSimple, text_diffStats as diffStats, text_escapeAll as escapeAll, text_escapeString as escapeString, text_extractHeadings as extractHeadings, text_formatReadingTime as formatReadingTime, text_generate as generate, text_generateDiff as generateDiff, text_generateHtmlTable as generateHtmlTable, text_generateMarkdownTable as generateMarkdownTable, text_generateParagraphs as generateParagraphs, text_generateSentences as generateSentences, text_generateWords as generateWords, text_getAvailableFonts as getAvailableFonts, text_getEmojiByCategory as getEmojiByCategory, text_getEmojiByChar as getEmojiByChar, text_getEmojiByShortcode as getEmojiByShortcode, text_getEmojiCategories as getEmojiCategories, text_getMorseForChar as getMorseForChar, text_getMorseTiming as getMorseTiming, text_htmlToMarkdown as htmlToMarkdown, text_isValidMorse as isValidMorse, text_markdownToHtml as markdownToHtml, text_morseToText as morseToText, text_numberToOrdinal as numberToOrdinal, text_numberToRoman as numberToRoman, text_numberToWords as numberToWords, text_ordinalWords as ordinalWords, text_parseDiff as parseDiff, text_parseTableData as parseTableData, text_readabilityScore as readabilityScore, text_renderMarkdown as renderMarkdown, text_romanToNumber as romanToNumber, text_scoreReadability as scoreReadability, text_searchEmoji as searchEmoji, text_sentenceCount as sentenceCount, text_slugify as slugify, text_slugifyAll as slugifyAll, text_syllableCount as syllableCount, text_textToAscii as textToAscii, text_textToMorse as textToMorse, text_unescapeString as unescapeString, text_wordFrequency as wordFrequency };
518
+ export { type text_AsciiFont as AsciiFont, type text_AsciiOptions as AsciiOptions, text_CASE_FORMATS as CASE_FORMATS, type text_CaseFormat as CaseFormat, type text_ConvertOptions as ConvertOptions, text_DEFAULT_CONVERT_OPTIONS as DEFAULT_CONVERT_OPTIONS, type text_DiffFile as DiffFile, type text_DiffHunk as DiffHunk, type text_DiffLine as DiffLine, type text_DiffResult as DiffResult, type text_DiffType as DiffType, type text_DiffViewerLine as DiffViewerLine, text_EMOJI_TABLE as EMOJI_TABLE, text_ESCAPE_MODES as ESCAPE_MODES, type text_EmojiEntry as EmojiEntry, type text_EscapeMode as EscapeMode, type text_FillerCategory as FillerCategory, type text_FillerMatch as FillerMatch, type text_FillerWordResult as FillerWordResult, type text_KeywordDensityEntry as KeywordDensityEntry, type text_KeywordDensityOptions as KeywordDensityOptions, type text_KeywordDensityResult as KeywordDensityResult, text_LINE_OPS as LINE_OPS, type text_LineOp as LineOp, type text_LineType as LineType, type text_LoremUnit as LoremUnit, text_MORSE_CODE as MORSE_CODE, type text_MarkdownResult as MarkdownResult, type text_MorseOptions as MorseOptions, type text_ParsedDiff as ParsedDiff, type text_ParsedTable as ParsedTable, type text_PassiveVoiceMatch as PassiveVoiceMatch, type text_PassiveVoiceResult as PassiveVoiceResult, type text_PassiveVoiceSentence as PassiveVoiceSentence, type text_ReadabilityResult as ReadabilityResult, type text_ReadabilityScore as ReadabilityScore, type text_SentenceLengthBucket as SentenceLengthBucket, type text_SentenceLengthDistribution as SentenceLengthDistribution, type text_SlugSeparator as SlugSeparator, type text_StringDistanceMode as StringDistanceMode, type text_StringDistanceResult as StringDistanceResult, type text_TableOptions as TableOptions, type text_TextAnalysis as TextAnalysis, type text_WordCountResult as WordCountResult, text_addBorder as addBorder, text_analyzeKeywordDensity as analyzeKeywordDensity, text_analyzeSentenceLengths as analyzeSentenceLengths, text_analyzeText as analyzeText, text_applyOp as applyOp, text_applyOps as applyOps, text_calculateStringDistance as calculateStringDistance, text_centerText as centerText, text_convertAll as convertAll, text_convertCase as convertCase, text_countWords as countWords, text_csvToHtml as csvToHtml, text_csvToMarkdown as csvToMarkdown, text_detectDelimiter as detectDelimiter, text_detectFillerWords as detectFillerWords, text_detectPassiveVoice as detectPassiveVoice, text_diffLines as diffLines, text_diffLinesSimple as diffLinesSimple, text_diffStats as diffStats, text_escapeAll as escapeAll, text_escapeString as escapeString, text_extractHeadings as extractHeadings, text_formatReadingTime as formatReadingTime, text_generate as generate, text_generateDiff as generateDiff, text_generateHtmlTable as generateHtmlTable, text_generateMarkdownTable as generateMarkdownTable, text_generateParagraphs as generateParagraphs, text_generateSentences as generateSentences, text_generateWords as generateWords, text_getAvailableFonts as getAvailableFonts, text_getEmojiByCategory as getEmojiByCategory, text_getEmojiByChar as getEmojiByChar, text_getEmojiByShortcode as getEmojiByShortcode, text_getEmojiCategories as getEmojiCategories, text_getMorseForChar as getMorseForChar, text_getMorseTiming as getMorseTiming, text_htmlToMarkdown as htmlToMarkdown, text_isValidMorse as isValidMorse, text_markdownToHtml as markdownToHtml, text_morseToText as morseToText, text_numberToOrdinal as numberToOrdinal, text_numberToRoman as numberToRoman, text_numberToWords as numberToWords, text_ordinalWords as ordinalWords, text_parseDiff as parseDiff, text_parseTableData as parseTableData, text_readabilityScore as readabilityScore, text_renderMarkdown as renderMarkdown, text_romanToNumber as romanToNumber, text_scoreReadability as scoreReadability, text_searchEmoji as searchEmoji, text_sentenceCount as sentenceCount, text_slugify as slugify, text_slugifyAll as slugifyAll, text_syllableCount as syllableCount, text_textToAscii as textToAscii, text_textToMorse as textToMorse, text_unescapeString as unescapeString, text_wordFrequency as wordFrequency };
487
519
  }
488
520
 
489
- export { csvToMarkdown as $, type AsciiFont as A, type SlugSeparator as B, CASE_FORMATS as C, DEFAULT_CONVERT_OPTIONS as D, EMOJI_TABLE as E, type FillerCategory as F, type StringDistanceMode as G, type StringDistanceResult as H, type TextAnalysis as I, addBorder as J, analyzeSentenceLengths as K, LINE_OPS as L, MORSE_CODE as M, analyzeText as N, applyOp as O, type ParsedDiff as P, applyOps as Q, type ReadabilityResult as R, type SentenceLengthBucket as S, type TableOptions as T, calculateStringDistance as U, centerText as V, type WordCountResult as W, convertAll as X, convertCase as Y, countWords as Z, csvToHtml as _, type AsciiOptions as a, detectDelimiter as a0, detectFillerWords as a1, detectPassiveVoice as a2, diffLines as a3, diffLinesSimple as a4, diffStats as a5, escapeAll as a6, escapeString as a7, extractHeadings as a8, formatReadingTime as a9, romanToNumber as aA, scoreReadability as aB, searchEmoji as aC, sentenceCount as aD, slugify as aE, slugifyAll as aF, syllableCount as aG, textToAscii as aH, textToMorse as aI, unescapeString as aJ, wordFrequency as aK, generate as aa, generateDiff as ab, generateHtmlTable as ac, generateMarkdownTable as ad, generateParagraphs as ae, generateSentences as af, generateWords as ag, getAvailableFonts as ah, getEmojiByCategory as ai, getEmojiByChar as aj, getEmojiByShortcode as ak, getEmojiCategories as al, getMorseForChar as am, getMorseTiming as an, htmlToMarkdown as ao, isValidMorse as ap, markdownToHtml as aq, morseToText as ar, numberToOrdinal as as, numberToRoman as at, numberToWords as au, ordinalWords as av, parseDiff as aw, parseTableData as ax, readabilityScore as ay, renderMarkdown as az, type CaseFormat as b, type ConvertOptions as c, type DiffFile as d, type DiffHunk as e, type DiffLine as f, type DiffResult as g, type DiffType as h, type DiffViewerLine as i, ESCAPE_MODES as j, type EmojiEntry as k, type EscapeMode as l, type FillerMatch as m, type FillerWordResult as n, type LineOp as o, type LineType as p, type LoremUnit as q, type MarkdownResult as r, type MorseOptions as s, text as t, type ParsedTable as u, type PassiveVoiceMatch as v, type PassiveVoiceResult as w, type PassiveVoiceSentence as x, type ReadabilityScore as y, type SentenceLengthDistribution as z };
521
+ export { convertAll as $, type AsciiFont as A, type ReadabilityScore as B, CASE_FORMATS as C, DEFAULT_CONVERT_OPTIONS as D, EMOJI_TABLE as E, type FillerCategory as F, type SentenceLengthDistribution as G, type SlugSeparator as H, type StringDistanceMode as I, type StringDistanceResult as J, type KeywordDensityEntry as K, LINE_OPS as L, MORSE_CODE as M, type TextAnalysis as N, addBorder as O, type ParsedDiff as P, analyzeKeywordDensity as Q, type ReadabilityResult as R, type SentenceLengthBucket as S, type TableOptions as T, analyzeSentenceLengths as U, analyzeText as V, type WordCountResult as W, applyOp as X, applyOps as Y, calculateStringDistance as Z, centerText as _, type AsciiOptions as a, convertCase as a0, countWords as a1, csvToHtml as a2, csvToMarkdown as a3, detectDelimiter as a4, detectFillerWords as a5, detectPassiveVoice as a6, diffLines as a7, diffLinesSimple as a8, diffStats as a9, parseDiff as aA, parseTableData as aB, readabilityScore as aC, renderMarkdown as aD, romanToNumber as aE, scoreReadability as aF, searchEmoji as aG, sentenceCount as aH, slugify as aI, slugifyAll as aJ, syllableCount as aK, textToAscii as aL, textToMorse as aM, unescapeString as aN, wordFrequency as aO, escapeAll as aa, escapeString as ab, extractHeadings as ac, formatReadingTime as ad, generate as ae, generateDiff as af, generateHtmlTable as ag, generateMarkdownTable as ah, generateParagraphs as ai, generateSentences as aj, generateWords as ak, getAvailableFonts as al, getEmojiByCategory as am, getEmojiByChar as an, getEmojiByShortcode as ao, getEmojiCategories as ap, getMorseForChar as aq, getMorseTiming as ar, htmlToMarkdown as as, isValidMorse as at, markdownToHtml as au, morseToText as av, numberToOrdinal as aw, numberToRoman as ax, numberToWords as ay, ordinalWords as az, type CaseFormat as b, type ConvertOptions as c, type DiffFile as d, type DiffHunk as e, type DiffLine as f, type DiffResult as g, type DiffType as h, type DiffViewerLine as i, ESCAPE_MODES as j, type EmojiEntry as k, type EscapeMode as l, type FillerMatch as m, type FillerWordResult as n, type KeywordDensityOptions as o, type KeywordDensityResult as p, type LineOp as q, type LineType as r, type LoremUnit as s, text as t, type MarkdownResult as u, type MorseOptions as v, type ParsedTable as w, type PassiveVoiceMatch as x, type PassiveVoiceResult as y, type PassiveVoiceSentence as z };
@@ -2523,7 +2523,108 @@ function parsePermissionsPolicy(raw) {
2523
2523
  if (features.length === 0) return { error: "No directives found" };
2524
2524
  return buildPermissionsPolicy(features);
2525
2525
  }
2526
+ var CLIENT_HINTS = [
2527
+ { name: "Sec-CH-UA", description: "The browser's brand(s) and significant version, sent automatically on every request without an Accept-CH opt-in.", lowEntropy: true, valueType: "sf-list-brand" },
2528
+ { name: "Sec-CH-UA-Mobile", description: "Whether the browser is running on a mobile device (?1) or not (?0).", lowEntropy: true, valueType: "boolean" },
2529
+ { name: "Sec-CH-UA-Platform", description: 'The platform/OS the browser is running on, e.g. "Windows" or "Android".', lowEntropy: true, valueType: "string" },
2530
+ { name: "Sec-CH-UA-Full-Version-List", description: "The full version number for each brand in the user agent, not just the significant version.", lowEntropy: false, valueType: "sf-list-brand" },
2531
+ { name: "Sec-CH-UA-Platform-Version", description: 'The exact OS version, e.g. "15.0.0".', lowEntropy: false, valueType: "string" },
2532
+ { name: "Sec-CH-UA-Arch", description: 'The underlying CPU architecture, e.g. "x86" or "arm".', lowEntropy: false, valueType: "string" },
2533
+ { name: "Sec-CH-UA-Bitness", description: 'The CPU architecture bitness, e.g. "64".', lowEntropy: false, valueType: "string" },
2534
+ { name: "Sec-CH-UA-Model", description: "The device model, mostly populated on mobile devices.", lowEntropy: false, valueType: "string" },
2535
+ { name: "Sec-CH-UA-WoW64", description: "Whether a 32-bit browser is running on 64-bit Windows.", lowEntropy: false, valueType: "boolean" },
2536
+ { name: "Sec-CH-UA-Form-Factor", description: `The device's form factor, e.g. "Desktop", "Mobile", "Tablet", or "XR".`, lowEntropy: false, valueType: "string" },
2537
+ { name: "Sec-CH-Prefers-Color-Scheme", description: "The user's preferred color scheme, mirrors the prefers-color-scheme media feature.", lowEntropy: false, valueType: "string" },
2538
+ { name: "Sec-CH-Prefers-Reduced-Motion", description: "Whether the user has requested reduced motion.", lowEntropy: false, valueType: "string" },
2539
+ { name: "Sec-CH-Prefers-Reduced-Transparency", description: "Whether the user has requested reduced transparency.", lowEntropy: false, valueType: "string" },
2540
+ { name: "Sec-CH-Viewport-Width", description: "The layout viewport width in CSS pixels.", lowEntropy: false, valueType: "number" },
2541
+ { name: "Sec-CH-Viewport-Height", description: "The layout viewport height in CSS pixels.", lowEntropy: false, valueType: "number" },
2542
+ { name: "Sec-CH-DPR", description: "The device pixel ratio.", lowEntropy: false, valueType: "number" },
2543
+ { name: "Sec-CH-Width", description: "The intrinsic width of a requested image resource, set per-request via the image's `sizes` attribute.", lowEntropy: false, valueType: "number" },
2544
+ { name: "Sec-CH-Device-Memory", description: "Approximate device RAM in GiB, rounded to the nearest power of two for privacy.", lowEntropy: false, valueType: "number" },
2545
+ { name: "Save-Data", description: "Legacy hint signaling the user opted into a reduced-data mode; sent automatically like a low-entropy hint.", lowEntropy: true, valueType: "boolean" }
2546
+ ];
2547
+ function _findClientHint(raw) {
2548
+ const normalized = raw.trim().toLowerCase();
2549
+ return CLIENT_HINTS.find((d) => d.name.toLowerCase() === normalized);
2550
+ }
2551
+ function buildClientHints(hintNames, criticalHintNames = []) {
2552
+ if (!Array.isArray(hintNames) || hintNames.length === 0) return { error: "At least one client hint is required" };
2553
+ const resolved = [];
2554
+ for (const raw of hintNames) {
2555
+ if (typeof raw !== "string" || raw.trim() === "") continue;
2556
+ const def = _findClientHint(raw);
2557
+ if (!def) return { error: `Unknown client hint: "${raw}"` };
2558
+ resolved.push(def);
2559
+ }
2560
+ if (resolved.length === 0) return { error: "At least one client hint is required" };
2561
+ const critical = [];
2562
+ if (Array.isArray(criticalHintNames)) {
2563
+ for (const raw of criticalHintNames) {
2564
+ if (typeof raw !== "string" || raw.trim() === "") continue;
2565
+ const def = _findClientHint(raw);
2566
+ if (!def) return { error: `Unknown client hint: "${raw}"` };
2567
+ if (!resolved.some((d) => d.name === def.name)) {
2568
+ return { error: `Critical hint "${def.name}" must also be included in hintNames` };
2569
+ }
2570
+ critical.push(def);
2571
+ }
2572
+ }
2573
+ const uniqueNames = Array.from(new Set(resolved.map((d) => d.name)));
2574
+ const result = {
2575
+ acceptCH: uniqueNames.join(", "),
2576
+ hints: resolved.map((d) => ({ name: d.name, description: d.description, lowEntropy: d.lowEntropy }))
2577
+ };
2578
+ if (critical.length > 0) {
2579
+ result.criticalCH = Array.from(new Set(critical.map((d) => d.name))).join(", ");
2580
+ }
2581
+ return result;
2582
+ }
2583
+ function _decodeClientHintValue(valueType, rawValue) {
2584
+ switch (valueType) {
2585
+ case "boolean":
2586
+ if (rawValue === "?1") return true;
2587
+ if (rawValue === "?0") return false;
2588
+ return rawValue;
2589
+ case "string":
2590
+ return rawValue.replace(/^"|"$/g, "");
2591
+ case "number": {
2592
+ const n = Number(rawValue);
2593
+ return Number.isFinite(n) ? n : rawValue;
2594
+ }
2595
+ case "sf-list-brand":
2596
+ return rawValue.split(",").map((part) => {
2597
+ const m = part.trim().match(/^"([^"]*)";v="([^"]*)"$/);
2598
+ return m ? { brand: m[1], version: m[2] } : { raw: part.trim() };
2599
+ });
2600
+ default:
2601
+ return rawValue;
2602
+ }
2603
+ }
2604
+ function parseClientHintHeaders(rawHeaders) {
2605
+ if (typeof rawHeaders !== "string" || rawHeaders.trim() === "") return { error: "Provide one or more header lines to parse" };
2606
+ const lines = rawHeaders.split("\n").map((l) => l.trim()).filter((l) => l.length > 0);
2607
+ const hints = [];
2608
+ const unrecognized = [];
2609
+ for (const line of lines) {
2610
+ const idx = line.indexOf(":");
2611
+ if (idx === -1) continue;
2612
+ const name = line.slice(0, idx).trim();
2613
+ const rawValue = line.slice(idx + 1).trim();
2614
+ const def = _findClientHint(name);
2615
+ if (!def) {
2616
+ unrecognized.push({ name, rawValue });
2617
+ continue;
2618
+ }
2619
+ hints.push({ name: def.name, rawValue, description: def.description, value: _decodeClientHintValue(def.valueType, rawValue) });
2620
+ }
2621
+ if (hints.length === 0 && unrecognized.length === 0) {
2622
+ return { error: 'No parsable header lines found (expected "Header-Name: value" per line)' };
2623
+ }
2624
+ return { hints, unrecognized };
2625
+ }
2526
2626
 
2627
+ exports.CLIENT_HINTS = CLIENT_HINTS;
2527
2628
  exports.DNS_RECORD_TYPES = DNS_RECORD_TYPES;
2528
2629
  exports.HTTP_HEADERS = HTTP_HEADERS;
2529
2630
  exports.LINK_REL_VALUES = LINK_REL_VALUES;
@@ -2532,6 +2633,7 @@ exports.REFERRER_POLICY_VALUES = REFERRER_POLICY_VALUES;
2532
2633
  exports.STATUS_CODES = STATUS_CODES;
2533
2634
  exports.analyzeEmailHeaders = analyzeEmailHeaders;
2534
2635
  exports.buildCacheControl = buildCacheControl;
2636
+ exports.buildClientHints = buildClientHints;
2535
2637
  exports.buildDnsQueryUrl = buildDnsQueryUrl;
2536
2638
  exports.buildGeoUrl = buildGeoUrl;
2537
2639
  exports.buildLinkHeader = buildLinkHeader;
@@ -2555,6 +2657,7 @@ exports.isSuccess = isSuccess;
2555
2657
  exports.isValidIp = isValidIp;
2556
2658
  exports.isValidIpv4 = isValidIpv4;
2557
2659
  exports.isValidIpv6 = isValidIpv6;
2660
+ exports.parseClientHintHeaders = parseClientHintHeaders;
2558
2661
  exports.parseContentRangeHeader = parseContentRangeHeader;
2559
2662
  exports.parseDnsResponse = parseDnsResponse;
2560
2663
  exports.parseGeoResponse = parseGeoResponse;
@@ -1 +1 @@
1
- export { A as AuthResultEntry, B as BuildRangeHeaderOptions, C as CacheControlDirective, a as CacheControlOptions, b as CacheControlResult, c as ContentRangeResult, d as CookieAttributes, e as CookieCheckResult, D as DNS_RECORD_TYPES, f as DnsRecord, g as DnsRecordType, h as DnsResponse, E as EmailHeaderAnalysis, i as EmailHeaderField, G as GeoResult, H as HTTP_HEADERS, j as HarEntry, k as HarParseResult, l as HarSummary, m as HeaderCategory, o as HttpHeader, I as Ipv6AddressType, p as Ipv6ParseResult, L as LINK_REL_VALUES, q as LinkHeaderEntry, r as LinkHeaderEntryInput, s as LinkHeaderResult, t as LinkRel, M as ManifestIconInfo, u as ManifestIssue, v as ManifestValidationResult, P as PERMISSIONS_POLICY_FEATURES, w as ParsedDnsResult, x as ParsedGeoResult, y as PermissionsPolicyDirective, z as PermissionsPolicyFeatureInput, F as PermissionsPolicyResult, R as REFERRER_POLICY_VALUES, J as RangeEntry, K as RangeEntryInput, N as RangeHeaderResult, O as ReceivedHop, Q as ReferrerPolicyEntry, S as ReferrerPolicyResult, T as ReferrerPolicyValue, U as RobotsGroup, V as RobotsIssue, W as RobotsRule, X as RobotsValidationResult, Y as STATUS_CODES, Z as SameSiteValue, _ as SitemapIndexEntry, $ as SitemapIssue, a0 as SitemapUrlEntry, a1 as SitemapValidationResult, a2 as StatusCode, a3 as UaDeviceType, a4 as UserAgentInfo, a5 as VaryHeaderEntry, a6 as VaryHeaderResult, a7 as analyzeEmailHeaders, a8 as buildCacheControl, a9 as buildDnsQueryUrl, aa as buildGeoUrl, ab as buildLinkHeader, ac as buildMapUrl, ad as buildPermissionsPolicy, ae as buildRangeHeader, af as buildReferrerPolicy, ag as buildVaryHeader, ah as checkSetCookieHeader, ai as countryCodeToFlag, aj as formatCoordinates, ak as formatTtl, al as getByCategory, am as getHeader, an as getHeadersByCategory, ao as getStatusByCategory, ap as getStatusCode, aq as isClientError, ar as isServerError, as as isSuccess, at as isValidIp, au as isValidIpv4, av as isValidIpv6, aw as parseContentRangeHeader, ax as parseDnsResponse, ay as parseGeoResponse, az as parseHar, aA as parseIpv6Address, aB as parsePermissionsPolicy, aC as parseUserAgent, aD as parseVaryHeader, aE as searchHeaders, aF as searchStatusCodes, aG as statusCodeToText, aH as typeNumberToLabel, aI as validateDomain, aJ as validateHeaderName, aK as validateHeaderValue, aL as validateManifest, aM as validateRobotsTxt, aN as validateSitemap } from '../network-BlOVDE3Y.cjs';
1
+ export { A as AuthResultEntry, B as BuildRangeHeaderOptions, C as CLIENT_HINTS, a as CacheControlDirective, b as CacheControlOptions, c as CacheControlResult, d as ClientHintDef, e as ClientHintValueType, f as ClientHintsBuildResult, g as ClientHintsParseResult, h as ContentRangeResult, i as CookieAttributes, j as CookieCheckResult, D as DNS_RECORD_TYPES, k as DnsRecord, l as DnsRecordType, m as DnsResponse, E as EmailHeaderAnalysis, o as EmailHeaderField, G as GeoResult, H as HTTP_HEADERS, p as HarEntry, q as HarParseResult, r as HarSummary, s as HeaderCategory, t as HttpHeader, I as Ipv6AddressType, u as Ipv6ParseResult, L as LINK_REL_VALUES, v as LinkHeaderEntry, w as LinkHeaderEntryInput, x as LinkHeaderResult, y as LinkRel, M as ManifestIconInfo, z as ManifestIssue, F as ManifestValidationResult, P as PERMISSIONS_POLICY_FEATURES, J as ParsedClientHint, K as ParsedDnsResult, N as ParsedGeoResult, O as PermissionsPolicyDirective, Q as PermissionsPolicyFeatureInput, R as PermissionsPolicyResult, S as REFERRER_POLICY_VALUES, T as RangeEntry, U as RangeEntryInput, V as RangeHeaderResult, W as ReceivedHop, X as ReferrerPolicyEntry, Y as ReferrerPolicyResult, Z as ReferrerPolicyValue, _ as RobotsGroup, $ as RobotsIssue, a0 as RobotsRule, a1 as RobotsValidationResult, a2 as STATUS_CODES, a3 as SameSiteValue, a4 as SitemapIndexEntry, a5 as SitemapIssue, a6 as SitemapUrlEntry, a7 as SitemapValidationResult, a8 as StatusCode, a9 as UaDeviceType, aa as UserAgentInfo, ab as VaryHeaderEntry, ac as VaryHeaderResult, ad as analyzeEmailHeaders, ae as buildCacheControl, af as buildClientHints, ag as buildDnsQueryUrl, ah as buildGeoUrl, ai as buildLinkHeader, aj as buildMapUrl, ak as buildPermissionsPolicy, al as buildRangeHeader, am as buildReferrerPolicy, an as buildVaryHeader, ao as checkSetCookieHeader, ap as countryCodeToFlag, aq as formatCoordinates, ar as formatTtl, as as getByCategory, at as getHeader, au as getHeadersByCategory, av as getStatusByCategory, aw as getStatusCode, ax as isClientError, ay as isServerError, az as isSuccess, aA as isValidIp, aB as isValidIpv4, aC as isValidIpv6, aD as parseClientHintHeaders, aE as parseContentRangeHeader, aF as parseDnsResponse, aG as parseGeoResponse, aH as parseHar, aI as parseIpv6Address, aJ as parsePermissionsPolicy, aK as parseUserAgent, aL as parseVaryHeader, aM as searchHeaders, aN as searchStatusCodes, aO as statusCodeToText, aP as typeNumberToLabel, aQ as validateDomain, aR as validateHeaderName, aS as validateHeaderValue, aT as validateManifest, aU as validateRobotsTxt, aV as validateSitemap } from '../network-Bzm1tjMA.cjs';
@@ -1 +1 @@
1
- export { A as AuthResultEntry, B as BuildRangeHeaderOptions, C as CacheControlDirective, a as CacheControlOptions, b as CacheControlResult, c as ContentRangeResult, d as CookieAttributes, e as CookieCheckResult, D as DNS_RECORD_TYPES, f as DnsRecord, g as DnsRecordType, h as DnsResponse, E as EmailHeaderAnalysis, i as EmailHeaderField, G as GeoResult, H as HTTP_HEADERS, j as HarEntry, k as HarParseResult, l as HarSummary, m as HeaderCategory, o as HttpHeader, I as Ipv6AddressType, p as Ipv6ParseResult, L as LINK_REL_VALUES, q as LinkHeaderEntry, r as LinkHeaderEntryInput, s as LinkHeaderResult, t as LinkRel, M as ManifestIconInfo, u as ManifestIssue, v as ManifestValidationResult, P as PERMISSIONS_POLICY_FEATURES, w as ParsedDnsResult, x as ParsedGeoResult, y as PermissionsPolicyDirective, z as PermissionsPolicyFeatureInput, F as PermissionsPolicyResult, R as REFERRER_POLICY_VALUES, J as RangeEntry, K as RangeEntryInput, N as RangeHeaderResult, O as ReceivedHop, Q as ReferrerPolicyEntry, S as ReferrerPolicyResult, T as ReferrerPolicyValue, U as RobotsGroup, V as RobotsIssue, W as RobotsRule, X as RobotsValidationResult, Y as STATUS_CODES, Z as SameSiteValue, _ as SitemapIndexEntry, $ as SitemapIssue, a0 as SitemapUrlEntry, a1 as SitemapValidationResult, a2 as StatusCode, a3 as UaDeviceType, a4 as UserAgentInfo, a5 as VaryHeaderEntry, a6 as VaryHeaderResult, a7 as analyzeEmailHeaders, a8 as buildCacheControl, a9 as buildDnsQueryUrl, aa as buildGeoUrl, ab as buildLinkHeader, ac as buildMapUrl, ad as buildPermissionsPolicy, ae as buildRangeHeader, af as buildReferrerPolicy, ag as buildVaryHeader, ah as checkSetCookieHeader, ai as countryCodeToFlag, aj as formatCoordinates, ak as formatTtl, al as getByCategory, am as getHeader, an as getHeadersByCategory, ao as getStatusByCategory, ap as getStatusCode, aq as isClientError, ar as isServerError, as as isSuccess, at as isValidIp, au as isValidIpv4, av as isValidIpv6, aw as parseContentRangeHeader, ax as parseDnsResponse, ay as parseGeoResponse, az as parseHar, aA as parseIpv6Address, aB as parsePermissionsPolicy, aC as parseUserAgent, aD as parseVaryHeader, aE as searchHeaders, aF as searchStatusCodes, aG as statusCodeToText, aH as typeNumberToLabel, aI as validateDomain, aJ as validateHeaderName, aK as validateHeaderValue, aL as validateManifest, aM as validateRobotsTxt, aN as validateSitemap } from '../network-BlOVDE3Y.js';
1
+ export { A as AuthResultEntry, B as BuildRangeHeaderOptions, C as CLIENT_HINTS, a as CacheControlDirective, b as CacheControlOptions, c as CacheControlResult, d as ClientHintDef, e as ClientHintValueType, f as ClientHintsBuildResult, g as ClientHintsParseResult, h as ContentRangeResult, i as CookieAttributes, j as CookieCheckResult, D as DNS_RECORD_TYPES, k as DnsRecord, l as DnsRecordType, m as DnsResponse, E as EmailHeaderAnalysis, o as EmailHeaderField, G as GeoResult, H as HTTP_HEADERS, p as HarEntry, q as HarParseResult, r as HarSummary, s as HeaderCategory, t as HttpHeader, I as Ipv6AddressType, u as Ipv6ParseResult, L as LINK_REL_VALUES, v as LinkHeaderEntry, w as LinkHeaderEntryInput, x as LinkHeaderResult, y as LinkRel, M as ManifestIconInfo, z as ManifestIssue, F as ManifestValidationResult, P as PERMISSIONS_POLICY_FEATURES, J as ParsedClientHint, K as ParsedDnsResult, N as ParsedGeoResult, O as PermissionsPolicyDirective, Q as PermissionsPolicyFeatureInput, R as PermissionsPolicyResult, S as REFERRER_POLICY_VALUES, T as RangeEntry, U as RangeEntryInput, V as RangeHeaderResult, W as ReceivedHop, X as ReferrerPolicyEntry, Y as ReferrerPolicyResult, Z as ReferrerPolicyValue, _ as RobotsGroup, $ as RobotsIssue, a0 as RobotsRule, a1 as RobotsValidationResult, a2 as STATUS_CODES, a3 as SameSiteValue, a4 as SitemapIndexEntry, a5 as SitemapIssue, a6 as SitemapUrlEntry, a7 as SitemapValidationResult, a8 as StatusCode, a9 as UaDeviceType, aa as UserAgentInfo, ab as VaryHeaderEntry, ac as VaryHeaderResult, ad as analyzeEmailHeaders, ae as buildCacheControl, af as buildClientHints, ag as buildDnsQueryUrl, ah as buildGeoUrl, ai as buildLinkHeader, aj as buildMapUrl, ak as buildPermissionsPolicy, al as buildRangeHeader, am as buildReferrerPolicy, an as buildVaryHeader, ao as checkSetCookieHeader, ap as countryCodeToFlag, aq as formatCoordinates, ar as formatTtl, as as getByCategory, at as getHeader, au as getHeadersByCategory, av as getStatusByCategory, aw as getStatusCode, ax as isClientError, ay as isServerError, az as isSuccess, aA as isValidIp, aB as isValidIpv4, aC as isValidIpv6, aD as parseClientHintHeaders, aE as parseContentRangeHeader, aF as parseDnsResponse, aG as parseGeoResponse, aH as parseHar, aI as parseIpv6Address, aJ as parsePermissionsPolicy, aK as parseUserAgent, aL as parseVaryHeader, aM as searchHeaders, aN as searchStatusCodes, aO as statusCodeToText, aP as typeNumberToLabel, aQ as validateDomain, aR as validateHeaderName, aS as validateHeaderValue, aT as validateManifest, aU as validateRobotsTxt, aV as validateSitemap } from '../network-Bzm1tjMA.js';
@@ -1,2 +1,2 @@
1
- export { DNS_RECORD_TYPES, HTTP_HEADERS, LINK_REL_VALUES, PERMISSIONS_POLICY_FEATURES, REFERRER_POLICY_VALUES, STATUS_CODES, analyzeEmailHeaders, buildCacheControl, buildDnsQueryUrl, buildGeoUrl, buildLinkHeader, buildMapUrl, buildPermissionsPolicy, buildRangeHeader, buildReferrerPolicy, buildVaryHeader, checkSetCookieHeader, countryCodeToFlag, formatCoordinates, formatTtl, getByCategory, getHeader, getHeadersByCategory, getStatusByCategory, getStatusCode, isClientError, isServerError, isSuccess, isValidIp, isValidIpv4, isValidIpv6, parseContentRangeHeader, parseDnsResponse, parseGeoResponse, parseHar, parseIpv6Address, parsePermissionsPolicy, parseUserAgent, parseVaryHeader, searchHeaders, searchStatusCodes, statusCodeToText, typeNumberToLabel, validateDomain, validateHeaderName, validateHeaderValue, validateManifest, validateRobotsTxt, validateSitemap } from '../chunk-GZBSKZ6F.js';
1
+ export { CLIENT_HINTS, DNS_RECORD_TYPES, HTTP_HEADERS, LINK_REL_VALUES, PERMISSIONS_POLICY_FEATURES, REFERRER_POLICY_VALUES, STATUS_CODES, analyzeEmailHeaders, buildCacheControl, buildClientHints, buildDnsQueryUrl, buildGeoUrl, buildLinkHeader, buildMapUrl, buildPermissionsPolicy, buildRangeHeader, buildReferrerPolicy, buildVaryHeader, checkSetCookieHeader, countryCodeToFlag, formatCoordinates, formatTtl, getByCategory, getHeader, getHeadersByCategory, getStatusByCategory, getStatusCode, isClientError, isServerError, isSuccess, isValidIp, isValidIpv4, isValidIpv6, parseClientHintHeaders, parseContentRangeHeader, parseDnsResponse, parseGeoResponse, parseHar, parseIpv6Address, parsePermissionsPolicy, parseUserAgent, parseVaryHeader, searchHeaders, searchStatusCodes, statusCodeToText, typeNumberToLabel, validateDomain, validateHeaderName, validateHeaderValue, validateManifest, validateRobotsTxt, validateSitemap } from '../chunk-7PEKYLRB.js';
2
2
  import '../chunk-MLKGABMK.js';
@@ -2603,6 +2603,131 @@ function analyzeSentenceLengths(text) {
2603
2603
  buckets
2604
2604
  };
2605
2605
  }
2606
+ var KEYWORD_DENSITY_STOPWORDS = /* @__PURE__ */ new Set([
2607
+ "a",
2608
+ "an",
2609
+ "the",
2610
+ "and",
2611
+ "or",
2612
+ "but",
2613
+ "if",
2614
+ "then",
2615
+ "else",
2616
+ "for",
2617
+ "nor",
2618
+ "so",
2619
+ "yet",
2620
+ "of",
2621
+ "in",
2622
+ "on",
2623
+ "at",
2624
+ "to",
2625
+ "from",
2626
+ "by",
2627
+ "with",
2628
+ "about",
2629
+ "against",
2630
+ "between",
2631
+ "into",
2632
+ "through",
2633
+ "during",
2634
+ "before",
2635
+ "after",
2636
+ "above",
2637
+ "below",
2638
+ "up",
2639
+ "down",
2640
+ "out",
2641
+ "off",
2642
+ "over",
2643
+ "under",
2644
+ "again",
2645
+ "further",
2646
+ "once",
2647
+ "is",
2648
+ "are",
2649
+ "was",
2650
+ "were",
2651
+ "be",
2652
+ "been",
2653
+ "being",
2654
+ "am",
2655
+ "do",
2656
+ "does",
2657
+ "did",
2658
+ "doing",
2659
+ "have",
2660
+ "has",
2661
+ "had",
2662
+ "having",
2663
+ "i",
2664
+ "me",
2665
+ "my",
2666
+ "we",
2667
+ "our",
2668
+ "you",
2669
+ "your",
2670
+ "he",
2671
+ "him",
2672
+ "his",
2673
+ "she",
2674
+ "her",
2675
+ "it",
2676
+ "its",
2677
+ "they",
2678
+ "them",
2679
+ "their",
2680
+ "this",
2681
+ "that",
2682
+ "these",
2683
+ "those",
2684
+ "as",
2685
+ "not",
2686
+ "no",
2687
+ "can",
2688
+ "will",
2689
+ "just",
2690
+ "than",
2691
+ "too",
2692
+ "very",
2693
+ "would",
2694
+ "should",
2695
+ "could",
2696
+ "there",
2697
+ "here",
2698
+ "what",
2699
+ "which",
2700
+ "who",
2701
+ "whom"
2702
+ ]);
2703
+ function analyzeKeywordDensity(text, options = {}) {
2704
+ if (!text || !text.trim()) return { error: "Input text is empty" };
2705
+ const topN = options.topN ?? 10;
2706
+ const minWordLength = options.minWordLength ?? 3;
2707
+ const ngramSize = options.ngramSize ?? 1;
2708
+ if (!Number.isInteger(topN) || topN <= 0) return { error: "topN must be a positive whole number" };
2709
+ if (!Number.isInteger(minWordLength) || minWordLength < 1) return { error: "minWordLength must be a positive whole number" };
2710
+ if (!Number.isInteger(ngramSize) || ngramSize < 1 || ngramSize > 3) return { error: "ngramSize must be 1, 2, or 3" };
2711
+ const tokens = text.toLowerCase().match(/[a-z0-9']+/g) ?? [];
2712
+ const totalWords = tokens.length;
2713
+ if (totalWords === 0) return { error: "No words found in input text" };
2714
+ if (totalWords < ngramSize) return { error: "Input text has fewer words than the requested phrase length" };
2715
+ const counts = /* @__PURE__ */ new Map();
2716
+ for (let i = 0; i <= tokens.length - ngramSize; i++) {
2717
+ const phraseWords = tokens.slice(i, i + ngramSize);
2718
+ if (phraseWords.some((w) => w.length < minWordLength)) continue;
2719
+ if (ngramSize === 1 && KEYWORD_DENSITY_STOPWORDS.has(phraseWords[0])) continue;
2720
+ const phrase = phraseWords.join(" ");
2721
+ counts.set(phrase, (counts.get(phrase) ?? 0) + 1);
2722
+ }
2723
+ const keywords = Array.from(counts.entries()).map(([keyword, count]) => ({ keyword, count, density: Math.round(count / totalWords * 1e3) / 10 })).sort((a, b) => b.count - a.count || a.keyword.localeCompare(b.keyword)).slice(0, topN);
2724
+ return {
2725
+ totalWords,
2726
+ uniqueKeywords: counts.size,
2727
+ ngramSize,
2728
+ keywords
2729
+ };
2730
+ }
2606
2731
  var EMOJI_TABLE = [
2607
2732
  { emoji: "\u{1F600}", name: "grinning face", shortcode: "grinning", codepoint: "U+1F600", category: "Smileys & Emotion", keywords: ["happy", "smile"] },
2608
2733
  { emoji: "\u{1F603}", name: "grinning face with big eyes", shortcode: "smiley", codepoint: "U+1F603", category: "Smileys & Emotion", keywords: ["happy", "joy"] },
@@ -2910,6 +3035,7 @@ exports.ESCAPE_MODES = ESCAPE_MODES;
2910
3035
  exports.LINE_OPS = LINE_OPS;
2911
3036
  exports.MORSE_CODE = MORSE_CODE;
2912
3037
  exports.addBorder = addBorder;
3038
+ exports.analyzeKeywordDensity = analyzeKeywordDensity;
2913
3039
  exports.analyzeSentenceLengths = analyzeSentenceLengths;
2914
3040
  exports.analyzeText = analyzeText;
2915
3041
  exports.applyOp = applyOp;