@utilix-tech/sdk 0.75.0 → 0.77.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.
- package/CHANGELOG.md +8 -0
- package/README.md +24 -4
- package/dist/{chunk-CXUOV672.js → chunk-KWS4ZCYG.js} +119 -1
- package/dist/{chunk-P7TXG7CI.js → chunk-QVOK3BXM.js} +97 -1
- package/dist/{chunk-PT4N4UBL.js → chunk-ZWFZRDQ4.js} +70 -1
- package/dist/index.cjs +283 -0
- package/dist/index.d.cts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.js +3 -3
- package/dist/{media-56zrIBw4.d.ts → media-DF8BS-iA.d.cts} +33 -2
- package/dist/{media-56zrIBw4.d.cts → media-DF8BS-iA.d.ts} +33 -2
- package/dist/{network-Da3meCWM.d.cts → network-BskZe1n2.d.cts} +34 -2
- package/dist/{network-Da3meCWM.d.ts → network-BskZe1n2.d.ts} +34 -2
- package/dist/{text-DWUcY8H1.d.cts → text-CNn3whZA.d.cts} +55 -2
- package/dist/{text-DWUcY8H1.d.ts → text-CNn3whZA.d.ts} +55 -2
- package/dist/tools/media.cjs +69 -0
- package/dist/tools/media.d.cts +1 -1
- package/dist/tools/media.d.ts +1 -1
- package/dist/tools/media.js +1 -1
- package/dist/tools/network.cjs +118 -0
- package/dist/tools/network.d.cts +1 -1
- package/dist/tools/network.d.ts +1 -1
- package/dist/tools/network.js +1 -1
- package/dist/tools/text.cjs +96 -0
- package/dist/tools/text.d.cts +1 -1
- package/dist/tools/text.d.ts +1 -1
- package/dist/tools/text.js +1 -1
- package/package.json +1 -1
|
@@ -1090,6 +1090,34 @@ interface CookieSizeBudgetResult {
|
|
|
1090
1090
|
declare function calculateCookieSizeBudget(cookieHeader: string, budgetBytes?: number): CookieSizeBudgetResult | {
|
|
1091
1091
|
error: string;
|
|
1092
1092
|
};
|
|
1093
|
+
type SecurityHeaderStatus = 'pass' | 'warning' | 'missing';
|
|
1094
|
+
interface SecurityHeaderCheck {
|
|
1095
|
+
header: string;
|
|
1096
|
+
status: SecurityHeaderStatus;
|
|
1097
|
+
value: string | null;
|
|
1098
|
+
note: string;
|
|
1099
|
+
}
|
|
1100
|
+
interface SecurityHeadersScorecard {
|
|
1101
|
+
checks: SecurityHeaderCheck[];
|
|
1102
|
+
score: number;
|
|
1103
|
+
grade: 'A' | 'B' | 'C' | 'D' | 'F';
|
|
1104
|
+
passCount: number;
|
|
1105
|
+
warningCount: number;
|
|
1106
|
+
missingCount: number;
|
|
1107
|
+
totalChecks: number;
|
|
1108
|
+
}
|
|
1109
|
+
/**
|
|
1110
|
+
* Parse a pasted block of raw HTTP response headers (one "Name: value" pair
|
|
1111
|
+
* per line) and score it against a fixed list of commonly recommended
|
|
1112
|
+
* security headers, flagging each as pass, warning, or missing, with an
|
|
1113
|
+
* overall 0-100 score and A-F letter grade. Evaluates the header text you
|
|
1114
|
+
* give it, not a live request, and each check is intentionally shallow —
|
|
1115
|
+
* this is a quick scorecard, not a replacement for a header's own dedicated
|
|
1116
|
+
* builder/validator tool (e.g. the CSP Header Builder) for a deeper look.
|
|
1117
|
+
*/
|
|
1118
|
+
declare function scoreSecurityHeaders(rawHeaders: string): SecurityHeadersScorecard | {
|
|
1119
|
+
error: string;
|
|
1120
|
+
};
|
|
1093
1121
|
|
|
1094
1122
|
type network_AcceptLanguageEntry = AcceptLanguageEntry;
|
|
1095
1123
|
type network_AcceptLanguageResult = AcceptLanguageResult;
|
|
@@ -1175,6 +1203,9 @@ type network_RobotsRule = RobotsRule;
|
|
|
1175
1203
|
type network_RobotsValidationResult = RobotsValidationResult;
|
|
1176
1204
|
declare const network_STATUS_CODES: typeof STATUS_CODES;
|
|
1177
1205
|
type network_SameSiteValue = SameSiteValue;
|
|
1206
|
+
type network_SecurityHeaderCheck = SecurityHeaderCheck;
|
|
1207
|
+
type network_SecurityHeaderStatus = SecurityHeaderStatus;
|
|
1208
|
+
type network_SecurityHeadersScorecard = SecurityHeadersScorecard;
|
|
1178
1209
|
type network_SitemapIndexEntry = SitemapIndexEntry;
|
|
1179
1210
|
type network_SitemapIssue = SitemapIssue;
|
|
1180
1211
|
type network_SitemapSplitFile = SitemapSplitFile;
|
|
@@ -1254,6 +1285,7 @@ declare const network_parseUserAgent: typeof parseUserAgent;
|
|
|
1254
1285
|
declare const network_parseVaryHeader: typeof parseVaryHeader;
|
|
1255
1286
|
declare const network_parseXContentTypeOptionsHeader: typeof parseXContentTypeOptionsHeader;
|
|
1256
1287
|
declare const network_parseXRobotsTag: typeof parseXRobotsTag;
|
|
1288
|
+
declare const network_scoreSecurityHeaders: typeof scoreSecurityHeaders;
|
|
1257
1289
|
declare const network_searchHeaders: typeof searchHeaders;
|
|
1258
1290
|
declare const network_searchStatusCodes: typeof searchStatusCodes;
|
|
1259
1291
|
declare const network_splitSitemap: typeof splitSitemap;
|
|
@@ -1266,7 +1298,7 @@ declare const network_validateManifest: typeof validateManifest;
|
|
|
1266
1298
|
declare const network_validateRobotsTxt: typeof validateRobotsTxt;
|
|
1267
1299
|
declare const network_validateSitemap: typeof validateSitemap;
|
|
1268
1300
|
declare namespace network {
|
|
1269
|
-
export { type network_AcceptLanguageEntry as AcceptLanguageEntry, type network_AcceptLanguageResult as AcceptLanguageResult, 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_CloseCodeInfo as CloseCodeInfo, type network_CloseCodeRange as CloseCodeRange, type network_ContentDispositionBuildOptions as ContentDispositionBuildOptions, type network_ContentDispositionBuildResult as ContentDispositionBuildResult, type network_ContentDispositionParseResult as ContentDispositionParseResult, type network_ContentRangeResult as ContentRangeResult, type network_ContentTypeRiskResult as ContentTypeRiskResult, type network_ContentTypeSniffRisk as ContentTypeSniffRisk, type network_CookieAttributes as CookieAttributes, type network_CookieCheckResult as CookieCheckResult, type network_CookieSizeBudgetResult as CookieSizeBudgetResult, type network_CookieSizeEntry as CookieSizeEntry, 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_HstsOptions as HstsOptions, type network_HstsResult as HstsResult, 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, type network_MultipartParseResult as MultipartParseResult, type network_MultipartPart as MultipartPart, type network_OpcodeCategory as OpcodeCategory, type network_OpcodeInfo as OpcodeInfo, 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, type network_PreferParameter as PreferParameter, type network_PreferPreference as PreferPreference, type network_PreferResult as PreferResult, type network_PriorityResult as PriorityResult, 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_RetryAfterDateResult as RetryAfterDateResult, type network_RetryAfterResult as RetryAfterResult, type network_RetryAfterSecondsResult as RetryAfterSecondsResult, type network_RobotsGroup as RobotsGroup, type network_RobotsIssue as RobotsIssue, type network_RobotsMetaTagFlag as RobotsMetaTagFlag, type network_RobotsMetaTagOptions as RobotsMetaTagOptions, type network_RobotsMetaTagResult as RobotsMetaTagResult, 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_SitemapSplitFile as SitemapSplitFile, type network_SitemapUrlEntry as SitemapUrlEntry, type network_SitemapValidationResult as SitemapValidationResult, type network_SplitSitemapOptions as SplitSitemapOptions, type network_SplitSitemapResult as SplitSitemapResult, 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, type network_XContentTypeOptionsHeader as XContentTypeOptionsHeader, type network_XContentTypeOptionsParseResult as XContentTypeOptionsParseResult, type network_XRobotsTagFlag as XRobotsTagFlag, type network_XRobotsTagOptions as XRobotsTagOptions, type network_XRobotsTagResult as XRobotsTagResult, network_X_CONTENT_TYPE_OPTIONS_HEADER as X_CONTENT_TYPE_OPTIONS_HEADER, network_analyzeEmailHeaders as analyzeEmailHeaders, network_assessContentTypeRisk as assessContentTypeRisk, network_buildAcceptLanguage as buildAcceptLanguage, network_buildCacheControl as buildCacheControl, network_buildClientHints as buildClientHints, network_buildContentDisposition as buildContentDisposition, network_buildDnsQueryUrl as buildDnsQueryUrl, network_buildGeoUrl as buildGeoUrl, network_buildHsts as buildHsts, network_buildLinkHeader as buildLinkHeader, network_buildMapUrl as buildMapUrl, network_buildPermissionsPolicy as buildPermissionsPolicy, network_buildPreferHeader as buildPreferHeader, network_buildPriorityHeader as buildPriorityHeader, network_buildRangeHeader as buildRangeHeader, network_buildReferrerPolicy as buildReferrerPolicy, network_buildRetryAfterHeader as buildRetryAfterHeader, network_buildRobotsMetaTag as buildRobotsMetaTag, network_buildVaryHeader as buildVaryHeader, network_buildXContentTypeOptionsHeader as buildXContentTypeOptionsHeader, network_buildXRobotsTag as buildXRobotsTag, network_calculateCookieSizeBudget as calculateCookieSizeBudget, network_checkSetCookieHeader as checkSetCookieHeader, network_countryCodeToFlag as countryCodeToFlag, network_extractMultipartBoundary as extractMultipartBoundary, 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_listCloseCodes as listCloseCodes, network_listOpcodes as listOpcodes, network_lookupCloseCode as lookupCloseCode, network_lookupOpcode as lookupOpcode, network_parseAcceptLanguage as parseAcceptLanguage, network_parseClientHintHeaders as parseClientHintHeaders, network_parseContentDisposition as parseContentDisposition, network_parseContentRangeHeader as parseContentRangeHeader, network_parseDnsResponse as parseDnsResponse, network_parseGeoResponse as parseGeoResponse, network_parseHar as parseHar, network_parseHsts as parseHsts, network_parseIpv6Address as parseIpv6Address, network_parseMultipartFormData as parseMultipartFormData, network_parsePermissionsPolicy as parsePermissionsPolicy, network_parsePreferHeader as parsePreferHeader, network_parsePriorityHeader as parsePriorityHeader, network_parseRetryAfterHeader as parseRetryAfterHeader, network_parseRobotsMetaTag as parseRobotsMetaTag, network_parseUserAgent as parseUserAgent, network_parseVaryHeader as parseVaryHeader, network_parseXContentTypeOptionsHeader as parseXContentTypeOptionsHeader, network_parseXRobotsTag as parseXRobotsTag, network_searchHeaders as searchHeaders, network_searchStatusCodes as searchStatusCodes, network_splitSitemap as splitSitemap, 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 };
|
|
1301
|
+
export { type network_AcceptLanguageEntry as AcceptLanguageEntry, type network_AcceptLanguageResult as AcceptLanguageResult, 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_CloseCodeInfo as CloseCodeInfo, type network_CloseCodeRange as CloseCodeRange, type network_ContentDispositionBuildOptions as ContentDispositionBuildOptions, type network_ContentDispositionBuildResult as ContentDispositionBuildResult, type network_ContentDispositionParseResult as ContentDispositionParseResult, type network_ContentRangeResult as ContentRangeResult, type network_ContentTypeRiskResult as ContentTypeRiskResult, type network_ContentTypeSniffRisk as ContentTypeSniffRisk, type network_CookieAttributes as CookieAttributes, type network_CookieCheckResult as CookieCheckResult, type network_CookieSizeBudgetResult as CookieSizeBudgetResult, type network_CookieSizeEntry as CookieSizeEntry, 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_HstsOptions as HstsOptions, type network_HstsResult as HstsResult, 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, type network_MultipartParseResult as MultipartParseResult, type network_MultipartPart as MultipartPart, type network_OpcodeCategory as OpcodeCategory, type network_OpcodeInfo as OpcodeInfo, 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, type network_PreferParameter as PreferParameter, type network_PreferPreference as PreferPreference, type network_PreferResult as PreferResult, type network_PriorityResult as PriorityResult, 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_RetryAfterDateResult as RetryAfterDateResult, type network_RetryAfterResult as RetryAfterResult, type network_RetryAfterSecondsResult as RetryAfterSecondsResult, type network_RobotsGroup as RobotsGroup, type network_RobotsIssue as RobotsIssue, type network_RobotsMetaTagFlag as RobotsMetaTagFlag, type network_RobotsMetaTagOptions as RobotsMetaTagOptions, type network_RobotsMetaTagResult as RobotsMetaTagResult, type network_RobotsRule as RobotsRule, type network_RobotsValidationResult as RobotsValidationResult, network_STATUS_CODES as STATUS_CODES, type network_SameSiteValue as SameSiteValue, type network_SecurityHeaderCheck as SecurityHeaderCheck, type network_SecurityHeaderStatus as SecurityHeaderStatus, type network_SecurityHeadersScorecard as SecurityHeadersScorecard, type network_SitemapIndexEntry as SitemapIndexEntry, type network_SitemapIssue as SitemapIssue, type network_SitemapSplitFile as SitemapSplitFile, type network_SitemapUrlEntry as SitemapUrlEntry, type network_SitemapValidationResult as SitemapValidationResult, type network_SplitSitemapOptions as SplitSitemapOptions, type network_SplitSitemapResult as SplitSitemapResult, 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, type network_XContentTypeOptionsHeader as XContentTypeOptionsHeader, type network_XContentTypeOptionsParseResult as XContentTypeOptionsParseResult, type network_XRobotsTagFlag as XRobotsTagFlag, type network_XRobotsTagOptions as XRobotsTagOptions, type network_XRobotsTagResult as XRobotsTagResult, network_X_CONTENT_TYPE_OPTIONS_HEADER as X_CONTENT_TYPE_OPTIONS_HEADER, network_analyzeEmailHeaders as analyzeEmailHeaders, network_assessContentTypeRisk as assessContentTypeRisk, network_buildAcceptLanguage as buildAcceptLanguage, network_buildCacheControl as buildCacheControl, network_buildClientHints as buildClientHints, network_buildContentDisposition as buildContentDisposition, network_buildDnsQueryUrl as buildDnsQueryUrl, network_buildGeoUrl as buildGeoUrl, network_buildHsts as buildHsts, network_buildLinkHeader as buildLinkHeader, network_buildMapUrl as buildMapUrl, network_buildPermissionsPolicy as buildPermissionsPolicy, network_buildPreferHeader as buildPreferHeader, network_buildPriorityHeader as buildPriorityHeader, network_buildRangeHeader as buildRangeHeader, network_buildReferrerPolicy as buildReferrerPolicy, network_buildRetryAfterHeader as buildRetryAfterHeader, network_buildRobotsMetaTag as buildRobotsMetaTag, network_buildVaryHeader as buildVaryHeader, network_buildXContentTypeOptionsHeader as buildXContentTypeOptionsHeader, network_buildXRobotsTag as buildXRobotsTag, network_calculateCookieSizeBudget as calculateCookieSizeBudget, network_checkSetCookieHeader as checkSetCookieHeader, network_countryCodeToFlag as countryCodeToFlag, network_extractMultipartBoundary as extractMultipartBoundary, 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_listCloseCodes as listCloseCodes, network_listOpcodes as listOpcodes, network_lookupCloseCode as lookupCloseCode, network_lookupOpcode as lookupOpcode, network_parseAcceptLanguage as parseAcceptLanguage, network_parseClientHintHeaders as parseClientHintHeaders, network_parseContentDisposition as parseContentDisposition, network_parseContentRangeHeader as parseContentRangeHeader, network_parseDnsResponse as parseDnsResponse, network_parseGeoResponse as parseGeoResponse, network_parseHar as parseHar, network_parseHsts as parseHsts, network_parseIpv6Address as parseIpv6Address, network_parseMultipartFormData as parseMultipartFormData, network_parsePermissionsPolicy as parsePermissionsPolicy, network_parsePreferHeader as parsePreferHeader, network_parsePriorityHeader as parsePriorityHeader, network_parseRetryAfterHeader as parseRetryAfterHeader, network_parseRobotsMetaTag as parseRobotsMetaTag, network_parseUserAgent as parseUserAgent, network_parseVaryHeader as parseVaryHeader, network_parseXContentTypeOptionsHeader as parseXContentTypeOptionsHeader, network_parseXRobotsTag as parseXRobotsTag, network_scoreSecurityHeaders as scoreSecurityHeaders, network_searchHeaders as searchHeaders, network_searchStatusCodes as searchStatusCodes, network_splitSitemap as splitSitemap, 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 };
|
|
1270
1302
|
}
|
|
1271
1303
|
|
|
1272
|
-
export { type OpcodeInfo as $, type AcceptLanguageEntry as A, type BuildRangeHeaderOptions as B, CLIENT_HINTS as C, DNS_RECORD_TYPES as D, type EmailHeaderAnalysis as E, type HarEntry as F, type GeoResult as G, HTTP_HEADERS as H, type HarParseResult as I, type HarSummary as J, type HeaderCategory as K, type HstsOptions as L, type HstsResult as M, type HttpHeader as N, type Ipv6AddressType as O, type Ipv6ParseResult as P, LINK_REL_VALUES as Q, type LinkHeaderEntry as R, type LinkHeaderEntryInput as S, type LinkHeaderResult as T, type LinkRel as U, type ManifestIconInfo as V, type ManifestIssue as W, type ManifestValidationResult as X, type MultipartParseResult as Y, type MultipartPart as Z, type OpcodeCategory as _, type AcceptLanguageResult as a,
|
|
1304
|
+
export { type OpcodeInfo as $, type AcceptLanguageEntry as A, type BuildRangeHeaderOptions as B, CLIENT_HINTS as C, DNS_RECORD_TYPES as D, type EmailHeaderAnalysis as E, type HarEntry as F, type GeoResult as G, HTTP_HEADERS as H, type HarParseResult as I, type HarSummary as J, type HeaderCategory as K, type HstsOptions as L, type HstsResult as M, type HttpHeader as N, type Ipv6AddressType as O, type Ipv6ParseResult as P, LINK_REL_VALUES as Q, type LinkHeaderEntry as R, type LinkHeaderEntryInput as S, type LinkHeaderResult as T, type LinkRel as U, type ManifestIconInfo as V, type ManifestIssue as W, type ManifestValidationResult as X, type MultipartParseResult as Y, type MultipartPart as Z, type OpcodeCategory as _, type AcceptLanguageResult as a, buildPermissionsPolicy as a$, PERMISSIONS_POLICY_FEATURES as a0, type ParsedClientHint as a1, type ParsedDnsResult as a2, type ParsedGeoResult as a3, type PermissionsPolicyDirective as a4, type PermissionsPolicyFeatureInput as a5, type PermissionsPolicyResult as a6, type PreferParameter as a7, type PreferPreference as a8, type PreferResult as a9, type SitemapSplitFile as aA, type SitemapUrlEntry as aB, type SitemapValidationResult as aC, type SplitSitemapOptions as aD, type SplitSitemapResult as aE, type StatusCode as aF, type UaDeviceType as aG, type UserAgentInfo as aH, type VaryHeaderEntry as aI, type VaryHeaderResult as aJ, type XContentTypeOptionsHeader as aK, type XContentTypeOptionsParseResult as aL, type XRobotsTagFlag as aM, type XRobotsTagOptions as aN, type XRobotsTagResult as aO, X_CONTENT_TYPE_OPTIONS_HEADER as aP, analyzeEmailHeaders as aQ, assessContentTypeRisk as aR, buildAcceptLanguage as aS, buildCacheControl as aT, buildClientHints as aU, buildContentDisposition as aV, buildDnsQueryUrl as aW, buildGeoUrl as aX, buildHsts as aY, buildLinkHeader as aZ, buildMapUrl as a_, type PriorityResult as aa, REFERRER_POLICY_VALUES as ab, type RangeEntry as ac, type RangeEntryInput as ad, type RangeHeaderResult as ae, type ReceivedHop as af, type ReferrerPolicyEntry as ag, type ReferrerPolicyResult as ah, type ReferrerPolicyValue as ai, type RetryAfterDateResult as aj, type RetryAfterResult as ak, type RetryAfterSecondsResult as al, type RobotsGroup as am, type RobotsIssue as an, type RobotsMetaTagFlag as ao, type RobotsMetaTagOptions as ap, type RobotsMetaTagResult as aq, type RobotsRule as ar, type RobotsValidationResult as as, STATUS_CODES as at, type SameSiteValue as au, type SecurityHeaderCheck as av, type SecurityHeaderStatus as aw, type SecurityHeadersScorecard as ax, type SitemapIndexEntry as ay, type SitemapIssue as az, type AuthResultEntry as b, buildPreferHeader as b0, buildPriorityHeader as b1, buildRangeHeader as b2, buildReferrerPolicy as b3, buildRetryAfterHeader as b4, buildRobotsMetaTag as b5, buildVaryHeader as b6, buildXContentTypeOptionsHeader as b7, buildXRobotsTag as b8, calculateCookieSizeBudget as b9, parseHar as bA, parseHsts as bB, parseIpv6Address as bC, parseMultipartFormData as bD, parsePermissionsPolicy as bE, parsePreferHeader as bF, parsePriorityHeader as bG, parseRetryAfterHeader as bH, parseRobotsMetaTag as bI, parseUserAgent as bJ, parseVaryHeader as bK, parseXContentTypeOptionsHeader as bL, parseXRobotsTag as bM, scoreSecurityHeaders as bN, searchHeaders as bO, searchStatusCodes as bP, splitSitemap as bQ, statusCodeToText as bR, typeNumberToLabel as bS, validateDomain as bT, validateHeaderName as bU, validateHeaderValue as bV, validateManifest as bW, validateRobotsTxt as bX, validateSitemap as bY, checkSetCookieHeader as ba, countryCodeToFlag as bb, extractMultipartBoundary as bc, formatCoordinates as bd, formatTtl as be, getByCategory as bf, getHeader as bg, getHeadersByCategory as bh, getStatusByCategory as bi, getStatusCode as bj, isClientError as bk, isServerError as bl, isSuccess as bm, isValidIp as bn, isValidIpv4 as bo, isValidIpv6 as bp, listCloseCodes as bq, listOpcodes as br, lookupCloseCode as bs, lookupOpcode as bt, parseAcceptLanguage as bu, parseClientHintHeaders as bv, parseContentDisposition as bw, parseContentRangeHeader as bx, parseDnsResponse as by, parseGeoResponse as bz, type CacheControlDirective as c, type CacheControlOptions as d, type CacheControlResult as e, type ClientHintDef as f, type ClientHintValueType as g, type ClientHintsBuildResult as h, type ClientHintsParseResult as i, type CloseCodeInfo as j, type CloseCodeRange as k, type ContentDispositionBuildOptions as l, type ContentDispositionBuildResult as m, network as n, type ContentDispositionParseResult as o, type ContentRangeResult as p, type ContentTypeRiskResult as q, type ContentTypeSniffRisk as r, type CookieAttributes as s, type CookieCheckResult as t, type CookieSizeBudgetResult as u, type CookieSizeEntry as v, type DnsRecord as w, type DnsRecordType as x, type DnsResponse as y, type EmailHeaderField as z };
|
|
@@ -1090,6 +1090,34 @@ interface CookieSizeBudgetResult {
|
|
|
1090
1090
|
declare function calculateCookieSizeBudget(cookieHeader: string, budgetBytes?: number): CookieSizeBudgetResult | {
|
|
1091
1091
|
error: string;
|
|
1092
1092
|
};
|
|
1093
|
+
type SecurityHeaderStatus = 'pass' | 'warning' | 'missing';
|
|
1094
|
+
interface SecurityHeaderCheck {
|
|
1095
|
+
header: string;
|
|
1096
|
+
status: SecurityHeaderStatus;
|
|
1097
|
+
value: string | null;
|
|
1098
|
+
note: string;
|
|
1099
|
+
}
|
|
1100
|
+
interface SecurityHeadersScorecard {
|
|
1101
|
+
checks: SecurityHeaderCheck[];
|
|
1102
|
+
score: number;
|
|
1103
|
+
grade: 'A' | 'B' | 'C' | 'D' | 'F';
|
|
1104
|
+
passCount: number;
|
|
1105
|
+
warningCount: number;
|
|
1106
|
+
missingCount: number;
|
|
1107
|
+
totalChecks: number;
|
|
1108
|
+
}
|
|
1109
|
+
/**
|
|
1110
|
+
* Parse a pasted block of raw HTTP response headers (one "Name: value" pair
|
|
1111
|
+
* per line) and score it against a fixed list of commonly recommended
|
|
1112
|
+
* security headers, flagging each as pass, warning, or missing, with an
|
|
1113
|
+
* overall 0-100 score and A-F letter grade. Evaluates the header text you
|
|
1114
|
+
* give it, not a live request, and each check is intentionally shallow —
|
|
1115
|
+
* this is a quick scorecard, not a replacement for a header's own dedicated
|
|
1116
|
+
* builder/validator tool (e.g. the CSP Header Builder) for a deeper look.
|
|
1117
|
+
*/
|
|
1118
|
+
declare function scoreSecurityHeaders(rawHeaders: string): SecurityHeadersScorecard | {
|
|
1119
|
+
error: string;
|
|
1120
|
+
};
|
|
1093
1121
|
|
|
1094
1122
|
type network_AcceptLanguageEntry = AcceptLanguageEntry;
|
|
1095
1123
|
type network_AcceptLanguageResult = AcceptLanguageResult;
|
|
@@ -1175,6 +1203,9 @@ type network_RobotsRule = RobotsRule;
|
|
|
1175
1203
|
type network_RobotsValidationResult = RobotsValidationResult;
|
|
1176
1204
|
declare const network_STATUS_CODES: typeof STATUS_CODES;
|
|
1177
1205
|
type network_SameSiteValue = SameSiteValue;
|
|
1206
|
+
type network_SecurityHeaderCheck = SecurityHeaderCheck;
|
|
1207
|
+
type network_SecurityHeaderStatus = SecurityHeaderStatus;
|
|
1208
|
+
type network_SecurityHeadersScorecard = SecurityHeadersScorecard;
|
|
1178
1209
|
type network_SitemapIndexEntry = SitemapIndexEntry;
|
|
1179
1210
|
type network_SitemapIssue = SitemapIssue;
|
|
1180
1211
|
type network_SitemapSplitFile = SitemapSplitFile;
|
|
@@ -1254,6 +1285,7 @@ declare const network_parseUserAgent: typeof parseUserAgent;
|
|
|
1254
1285
|
declare const network_parseVaryHeader: typeof parseVaryHeader;
|
|
1255
1286
|
declare const network_parseXContentTypeOptionsHeader: typeof parseXContentTypeOptionsHeader;
|
|
1256
1287
|
declare const network_parseXRobotsTag: typeof parseXRobotsTag;
|
|
1288
|
+
declare const network_scoreSecurityHeaders: typeof scoreSecurityHeaders;
|
|
1257
1289
|
declare const network_searchHeaders: typeof searchHeaders;
|
|
1258
1290
|
declare const network_searchStatusCodes: typeof searchStatusCodes;
|
|
1259
1291
|
declare const network_splitSitemap: typeof splitSitemap;
|
|
@@ -1266,7 +1298,7 @@ declare const network_validateManifest: typeof validateManifest;
|
|
|
1266
1298
|
declare const network_validateRobotsTxt: typeof validateRobotsTxt;
|
|
1267
1299
|
declare const network_validateSitemap: typeof validateSitemap;
|
|
1268
1300
|
declare namespace network {
|
|
1269
|
-
export { type network_AcceptLanguageEntry as AcceptLanguageEntry, type network_AcceptLanguageResult as AcceptLanguageResult, 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_CloseCodeInfo as CloseCodeInfo, type network_CloseCodeRange as CloseCodeRange, type network_ContentDispositionBuildOptions as ContentDispositionBuildOptions, type network_ContentDispositionBuildResult as ContentDispositionBuildResult, type network_ContentDispositionParseResult as ContentDispositionParseResult, type network_ContentRangeResult as ContentRangeResult, type network_ContentTypeRiskResult as ContentTypeRiskResult, type network_ContentTypeSniffRisk as ContentTypeSniffRisk, type network_CookieAttributes as CookieAttributes, type network_CookieCheckResult as CookieCheckResult, type network_CookieSizeBudgetResult as CookieSizeBudgetResult, type network_CookieSizeEntry as CookieSizeEntry, 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_HstsOptions as HstsOptions, type network_HstsResult as HstsResult, 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, type network_MultipartParseResult as MultipartParseResult, type network_MultipartPart as MultipartPart, type network_OpcodeCategory as OpcodeCategory, type network_OpcodeInfo as OpcodeInfo, 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, type network_PreferParameter as PreferParameter, type network_PreferPreference as PreferPreference, type network_PreferResult as PreferResult, type network_PriorityResult as PriorityResult, 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_RetryAfterDateResult as RetryAfterDateResult, type network_RetryAfterResult as RetryAfterResult, type network_RetryAfterSecondsResult as RetryAfterSecondsResult, type network_RobotsGroup as RobotsGroup, type network_RobotsIssue as RobotsIssue, type network_RobotsMetaTagFlag as RobotsMetaTagFlag, type network_RobotsMetaTagOptions as RobotsMetaTagOptions, type network_RobotsMetaTagResult as RobotsMetaTagResult, 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_SitemapSplitFile as SitemapSplitFile, type network_SitemapUrlEntry as SitemapUrlEntry, type network_SitemapValidationResult as SitemapValidationResult, type network_SplitSitemapOptions as SplitSitemapOptions, type network_SplitSitemapResult as SplitSitemapResult, 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, type network_XContentTypeOptionsHeader as XContentTypeOptionsHeader, type network_XContentTypeOptionsParseResult as XContentTypeOptionsParseResult, type network_XRobotsTagFlag as XRobotsTagFlag, type network_XRobotsTagOptions as XRobotsTagOptions, type network_XRobotsTagResult as XRobotsTagResult, network_X_CONTENT_TYPE_OPTIONS_HEADER as X_CONTENT_TYPE_OPTIONS_HEADER, network_analyzeEmailHeaders as analyzeEmailHeaders, network_assessContentTypeRisk as assessContentTypeRisk, network_buildAcceptLanguage as buildAcceptLanguage, network_buildCacheControl as buildCacheControl, network_buildClientHints as buildClientHints, network_buildContentDisposition as buildContentDisposition, network_buildDnsQueryUrl as buildDnsQueryUrl, network_buildGeoUrl as buildGeoUrl, network_buildHsts as buildHsts, network_buildLinkHeader as buildLinkHeader, network_buildMapUrl as buildMapUrl, network_buildPermissionsPolicy as buildPermissionsPolicy, network_buildPreferHeader as buildPreferHeader, network_buildPriorityHeader as buildPriorityHeader, network_buildRangeHeader as buildRangeHeader, network_buildReferrerPolicy as buildReferrerPolicy, network_buildRetryAfterHeader as buildRetryAfterHeader, network_buildRobotsMetaTag as buildRobotsMetaTag, network_buildVaryHeader as buildVaryHeader, network_buildXContentTypeOptionsHeader as buildXContentTypeOptionsHeader, network_buildXRobotsTag as buildXRobotsTag, network_calculateCookieSizeBudget as calculateCookieSizeBudget, network_checkSetCookieHeader as checkSetCookieHeader, network_countryCodeToFlag as countryCodeToFlag, network_extractMultipartBoundary as extractMultipartBoundary, 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_listCloseCodes as listCloseCodes, network_listOpcodes as listOpcodes, network_lookupCloseCode as lookupCloseCode, network_lookupOpcode as lookupOpcode, network_parseAcceptLanguage as parseAcceptLanguage, network_parseClientHintHeaders as parseClientHintHeaders, network_parseContentDisposition as parseContentDisposition, network_parseContentRangeHeader as parseContentRangeHeader, network_parseDnsResponse as parseDnsResponse, network_parseGeoResponse as parseGeoResponse, network_parseHar as parseHar, network_parseHsts as parseHsts, network_parseIpv6Address as parseIpv6Address, network_parseMultipartFormData as parseMultipartFormData, network_parsePermissionsPolicy as parsePermissionsPolicy, network_parsePreferHeader as parsePreferHeader, network_parsePriorityHeader as parsePriorityHeader, network_parseRetryAfterHeader as parseRetryAfterHeader, network_parseRobotsMetaTag as parseRobotsMetaTag, network_parseUserAgent as parseUserAgent, network_parseVaryHeader as parseVaryHeader, network_parseXContentTypeOptionsHeader as parseXContentTypeOptionsHeader, network_parseXRobotsTag as parseXRobotsTag, network_searchHeaders as searchHeaders, network_searchStatusCodes as searchStatusCodes, network_splitSitemap as splitSitemap, 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 };
|
|
1301
|
+
export { type network_AcceptLanguageEntry as AcceptLanguageEntry, type network_AcceptLanguageResult as AcceptLanguageResult, 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_CloseCodeInfo as CloseCodeInfo, type network_CloseCodeRange as CloseCodeRange, type network_ContentDispositionBuildOptions as ContentDispositionBuildOptions, type network_ContentDispositionBuildResult as ContentDispositionBuildResult, type network_ContentDispositionParseResult as ContentDispositionParseResult, type network_ContentRangeResult as ContentRangeResult, type network_ContentTypeRiskResult as ContentTypeRiskResult, type network_ContentTypeSniffRisk as ContentTypeSniffRisk, type network_CookieAttributes as CookieAttributes, type network_CookieCheckResult as CookieCheckResult, type network_CookieSizeBudgetResult as CookieSizeBudgetResult, type network_CookieSizeEntry as CookieSizeEntry, 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_HstsOptions as HstsOptions, type network_HstsResult as HstsResult, 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, type network_MultipartParseResult as MultipartParseResult, type network_MultipartPart as MultipartPart, type network_OpcodeCategory as OpcodeCategory, type network_OpcodeInfo as OpcodeInfo, 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, type network_PreferParameter as PreferParameter, type network_PreferPreference as PreferPreference, type network_PreferResult as PreferResult, type network_PriorityResult as PriorityResult, 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_RetryAfterDateResult as RetryAfterDateResult, type network_RetryAfterResult as RetryAfterResult, type network_RetryAfterSecondsResult as RetryAfterSecondsResult, type network_RobotsGroup as RobotsGroup, type network_RobotsIssue as RobotsIssue, type network_RobotsMetaTagFlag as RobotsMetaTagFlag, type network_RobotsMetaTagOptions as RobotsMetaTagOptions, type network_RobotsMetaTagResult as RobotsMetaTagResult, type network_RobotsRule as RobotsRule, type network_RobotsValidationResult as RobotsValidationResult, network_STATUS_CODES as STATUS_CODES, type network_SameSiteValue as SameSiteValue, type network_SecurityHeaderCheck as SecurityHeaderCheck, type network_SecurityHeaderStatus as SecurityHeaderStatus, type network_SecurityHeadersScorecard as SecurityHeadersScorecard, type network_SitemapIndexEntry as SitemapIndexEntry, type network_SitemapIssue as SitemapIssue, type network_SitemapSplitFile as SitemapSplitFile, type network_SitemapUrlEntry as SitemapUrlEntry, type network_SitemapValidationResult as SitemapValidationResult, type network_SplitSitemapOptions as SplitSitemapOptions, type network_SplitSitemapResult as SplitSitemapResult, 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, type network_XContentTypeOptionsHeader as XContentTypeOptionsHeader, type network_XContentTypeOptionsParseResult as XContentTypeOptionsParseResult, type network_XRobotsTagFlag as XRobotsTagFlag, type network_XRobotsTagOptions as XRobotsTagOptions, type network_XRobotsTagResult as XRobotsTagResult, network_X_CONTENT_TYPE_OPTIONS_HEADER as X_CONTENT_TYPE_OPTIONS_HEADER, network_analyzeEmailHeaders as analyzeEmailHeaders, network_assessContentTypeRisk as assessContentTypeRisk, network_buildAcceptLanguage as buildAcceptLanguage, network_buildCacheControl as buildCacheControl, network_buildClientHints as buildClientHints, network_buildContentDisposition as buildContentDisposition, network_buildDnsQueryUrl as buildDnsQueryUrl, network_buildGeoUrl as buildGeoUrl, network_buildHsts as buildHsts, network_buildLinkHeader as buildLinkHeader, network_buildMapUrl as buildMapUrl, network_buildPermissionsPolicy as buildPermissionsPolicy, network_buildPreferHeader as buildPreferHeader, network_buildPriorityHeader as buildPriorityHeader, network_buildRangeHeader as buildRangeHeader, network_buildReferrerPolicy as buildReferrerPolicy, network_buildRetryAfterHeader as buildRetryAfterHeader, network_buildRobotsMetaTag as buildRobotsMetaTag, network_buildVaryHeader as buildVaryHeader, network_buildXContentTypeOptionsHeader as buildXContentTypeOptionsHeader, network_buildXRobotsTag as buildXRobotsTag, network_calculateCookieSizeBudget as calculateCookieSizeBudget, network_checkSetCookieHeader as checkSetCookieHeader, network_countryCodeToFlag as countryCodeToFlag, network_extractMultipartBoundary as extractMultipartBoundary, 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_listCloseCodes as listCloseCodes, network_listOpcodes as listOpcodes, network_lookupCloseCode as lookupCloseCode, network_lookupOpcode as lookupOpcode, network_parseAcceptLanguage as parseAcceptLanguage, network_parseClientHintHeaders as parseClientHintHeaders, network_parseContentDisposition as parseContentDisposition, network_parseContentRangeHeader as parseContentRangeHeader, network_parseDnsResponse as parseDnsResponse, network_parseGeoResponse as parseGeoResponse, network_parseHar as parseHar, network_parseHsts as parseHsts, network_parseIpv6Address as parseIpv6Address, network_parseMultipartFormData as parseMultipartFormData, network_parsePermissionsPolicy as parsePermissionsPolicy, network_parsePreferHeader as parsePreferHeader, network_parsePriorityHeader as parsePriorityHeader, network_parseRetryAfterHeader as parseRetryAfterHeader, network_parseRobotsMetaTag as parseRobotsMetaTag, network_parseUserAgent as parseUserAgent, network_parseVaryHeader as parseVaryHeader, network_parseXContentTypeOptionsHeader as parseXContentTypeOptionsHeader, network_parseXRobotsTag as parseXRobotsTag, network_scoreSecurityHeaders as scoreSecurityHeaders, network_searchHeaders as searchHeaders, network_searchStatusCodes as searchStatusCodes, network_splitSitemap as splitSitemap, 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 };
|
|
1270
1302
|
}
|
|
1271
1303
|
|
|
1272
|
-
export { type OpcodeInfo as $, type AcceptLanguageEntry as A, type BuildRangeHeaderOptions as B, CLIENT_HINTS as C, DNS_RECORD_TYPES as D, type EmailHeaderAnalysis as E, type HarEntry as F, type GeoResult as G, HTTP_HEADERS as H, type HarParseResult as I, type HarSummary as J, type HeaderCategory as K, type HstsOptions as L, type HstsResult as M, type HttpHeader as N, type Ipv6AddressType as O, type Ipv6ParseResult as P, LINK_REL_VALUES as Q, type LinkHeaderEntry as R, type LinkHeaderEntryInput as S, type LinkHeaderResult as T, type LinkRel as U, type ManifestIconInfo as V, type ManifestIssue as W, type ManifestValidationResult as X, type MultipartParseResult as Y, type MultipartPart as Z, type OpcodeCategory as _, type AcceptLanguageResult as a,
|
|
1304
|
+
export { type OpcodeInfo as $, type AcceptLanguageEntry as A, type BuildRangeHeaderOptions as B, CLIENT_HINTS as C, DNS_RECORD_TYPES as D, type EmailHeaderAnalysis as E, type HarEntry as F, type GeoResult as G, HTTP_HEADERS as H, type HarParseResult as I, type HarSummary as J, type HeaderCategory as K, type HstsOptions as L, type HstsResult as M, type HttpHeader as N, type Ipv6AddressType as O, type Ipv6ParseResult as P, LINK_REL_VALUES as Q, type LinkHeaderEntry as R, type LinkHeaderEntryInput as S, type LinkHeaderResult as T, type LinkRel as U, type ManifestIconInfo as V, type ManifestIssue as W, type ManifestValidationResult as X, type MultipartParseResult as Y, type MultipartPart as Z, type OpcodeCategory as _, type AcceptLanguageResult as a, buildPermissionsPolicy as a$, PERMISSIONS_POLICY_FEATURES as a0, type ParsedClientHint as a1, type ParsedDnsResult as a2, type ParsedGeoResult as a3, type PermissionsPolicyDirective as a4, type PermissionsPolicyFeatureInput as a5, type PermissionsPolicyResult as a6, type PreferParameter as a7, type PreferPreference as a8, type PreferResult as a9, type SitemapSplitFile as aA, type SitemapUrlEntry as aB, type SitemapValidationResult as aC, type SplitSitemapOptions as aD, type SplitSitemapResult as aE, type StatusCode as aF, type UaDeviceType as aG, type UserAgentInfo as aH, type VaryHeaderEntry as aI, type VaryHeaderResult as aJ, type XContentTypeOptionsHeader as aK, type XContentTypeOptionsParseResult as aL, type XRobotsTagFlag as aM, type XRobotsTagOptions as aN, type XRobotsTagResult as aO, X_CONTENT_TYPE_OPTIONS_HEADER as aP, analyzeEmailHeaders as aQ, assessContentTypeRisk as aR, buildAcceptLanguage as aS, buildCacheControl as aT, buildClientHints as aU, buildContentDisposition as aV, buildDnsQueryUrl as aW, buildGeoUrl as aX, buildHsts as aY, buildLinkHeader as aZ, buildMapUrl as a_, type PriorityResult as aa, REFERRER_POLICY_VALUES as ab, type RangeEntry as ac, type RangeEntryInput as ad, type RangeHeaderResult as ae, type ReceivedHop as af, type ReferrerPolicyEntry as ag, type ReferrerPolicyResult as ah, type ReferrerPolicyValue as ai, type RetryAfterDateResult as aj, type RetryAfterResult as ak, type RetryAfterSecondsResult as al, type RobotsGroup as am, type RobotsIssue as an, type RobotsMetaTagFlag as ao, type RobotsMetaTagOptions as ap, type RobotsMetaTagResult as aq, type RobotsRule as ar, type RobotsValidationResult as as, STATUS_CODES as at, type SameSiteValue as au, type SecurityHeaderCheck as av, type SecurityHeaderStatus as aw, type SecurityHeadersScorecard as ax, type SitemapIndexEntry as ay, type SitemapIssue as az, type AuthResultEntry as b, buildPreferHeader as b0, buildPriorityHeader as b1, buildRangeHeader as b2, buildReferrerPolicy as b3, buildRetryAfterHeader as b4, buildRobotsMetaTag as b5, buildVaryHeader as b6, buildXContentTypeOptionsHeader as b7, buildXRobotsTag as b8, calculateCookieSizeBudget as b9, parseHar as bA, parseHsts as bB, parseIpv6Address as bC, parseMultipartFormData as bD, parsePermissionsPolicy as bE, parsePreferHeader as bF, parsePriorityHeader as bG, parseRetryAfterHeader as bH, parseRobotsMetaTag as bI, parseUserAgent as bJ, parseVaryHeader as bK, parseXContentTypeOptionsHeader as bL, parseXRobotsTag as bM, scoreSecurityHeaders as bN, searchHeaders as bO, searchStatusCodes as bP, splitSitemap as bQ, statusCodeToText as bR, typeNumberToLabel as bS, validateDomain as bT, validateHeaderName as bU, validateHeaderValue as bV, validateManifest as bW, validateRobotsTxt as bX, validateSitemap as bY, checkSetCookieHeader as ba, countryCodeToFlag as bb, extractMultipartBoundary as bc, formatCoordinates as bd, formatTtl as be, getByCategory as bf, getHeader as bg, getHeadersByCategory as bh, getStatusByCategory as bi, getStatusCode as bj, isClientError as bk, isServerError as bl, isSuccess as bm, isValidIp as bn, isValidIpv4 as bo, isValidIpv6 as bp, listCloseCodes as bq, listOpcodes as br, lookupCloseCode as bs, lookupOpcode as bt, parseAcceptLanguage as bu, parseClientHintHeaders as bv, parseContentDisposition as bw, parseContentRangeHeader as bx, parseDnsResponse as by, parseGeoResponse as bz, type CacheControlDirective as c, type CacheControlOptions as d, type CacheControlResult as e, type ClientHintDef as f, type ClientHintValueType as g, type ClientHintsBuildResult as h, type ClientHintsParseResult as i, type CloseCodeInfo as j, type CloseCodeRange as k, type ContentDispositionBuildOptions as l, type ContentDispositionBuildResult as m, network as n, type ContentDispositionParseResult as o, type ContentRangeResult as p, type ContentTypeRiskResult as q, type ContentTypeSniffRisk as r, type CookieAttributes as s, type CookieCheckResult as t, type CookieSizeBudgetResult as u, type CookieSizeEntry as v, type DnsRecord as w, type DnsRecordType as x, type DnsResponse as y, type EmailHeaderField as z };
|
|
@@ -409,6 +409,53 @@ declare function getEmojiByChar(char: string): EmojiEntry | undefined;
|
|
|
409
409
|
declare function getEmojiByCategory(category: string): EmojiEntry[];
|
|
410
410
|
/** All distinct category names present in the table, in table order. */
|
|
411
411
|
declare function getEmojiCategories(): string[];
|
|
412
|
+
interface WordyPhraseMatch {
|
|
413
|
+
phrase: string;
|
|
414
|
+
suggestion: string;
|
|
415
|
+
count: number;
|
|
416
|
+
indices: number[];
|
|
417
|
+
}
|
|
418
|
+
interface WordyPhraseResult {
|
|
419
|
+
totalWords: number;
|
|
420
|
+
totalMatches: number;
|
|
421
|
+
/** Matches per 100 words, to one decimal place. */
|
|
422
|
+
density: number;
|
|
423
|
+
matches: WordyPhraseMatch[];
|
|
424
|
+
}
|
|
425
|
+
/**
|
|
426
|
+
* Scan text against a curated table of wordy/redundant phrases ("due to the
|
|
427
|
+
* fact that", "in order to", "at this point in time") and flag each
|
|
428
|
+
* occurrence with a suggested concise replacement and character offsets.
|
|
429
|
+
* Dictionary-based heuristic, same shape as detectFillerWords: a flagged
|
|
430
|
+
* phrase is a candidate to tighten, not always wrong in context.
|
|
431
|
+
*/
|
|
432
|
+
declare function detectWordyPhrases(text: string): WordyPhraseResult;
|
|
433
|
+
interface OxfordCommaInstance {
|
|
434
|
+
/** A short readable window of text around the matched "and"/"or". */
|
|
435
|
+
snippet: string;
|
|
436
|
+
hasOxfordComma: boolean;
|
|
437
|
+
index: number;
|
|
438
|
+
}
|
|
439
|
+
interface OxfordCommaResult {
|
|
440
|
+
totalLists: number;
|
|
441
|
+
withOxfordComma: number;
|
|
442
|
+
withoutOxfordComma: number;
|
|
443
|
+
/** True when every detected list uses the same Oxford-comma style, or when no lists were found. */
|
|
444
|
+
consistent: boolean;
|
|
445
|
+
instances: OxfordCommaInstance[];
|
|
446
|
+
}
|
|
447
|
+
/**
|
|
448
|
+
* Scan a document for comma-before-and/or usage in three-or-more-item lists
|
|
449
|
+
* and flag inconsistency: some lists using the Oxford (serial) comma while
|
|
450
|
+
* others in the same document don't. For each "and"/"or" conjunction found,
|
|
451
|
+
* it counts the commas since the start of the enclosing sentence; one or
|
|
452
|
+
* more prior commas means the conjunction is closing a list of at least
|
|
453
|
+
* three items, which is where the Oxford comma question applies. This is a
|
|
454
|
+
* heuristic over punctuation, not a grammar parser, so an unrelated comma
|
|
455
|
+
* earlier in the same sentence (e.g. an introductory clause) can occasionally
|
|
456
|
+
* be counted as part of a list.
|
|
457
|
+
*/
|
|
458
|
+
declare function checkOxfordCommaConsistency(text: string): OxfordCommaResult;
|
|
412
459
|
|
|
413
460
|
type text_AsciiFont = AsciiFont;
|
|
414
461
|
type text_AsciiOptions = AsciiOptions;
|
|
@@ -439,6 +486,8 @@ type text_LoremUnit = LoremUnit;
|
|
|
439
486
|
declare const text_MORSE_CODE: typeof MORSE_CODE;
|
|
440
487
|
type text_MarkdownResult = MarkdownResult;
|
|
441
488
|
type text_MorseOptions = MorseOptions;
|
|
489
|
+
type text_OxfordCommaInstance = OxfordCommaInstance;
|
|
490
|
+
type text_OxfordCommaResult = OxfordCommaResult;
|
|
442
491
|
type text_ParsedDiff = ParsedDiff;
|
|
443
492
|
type text_ParsedTable = ParsedTable;
|
|
444
493
|
type text_PassiveVoiceMatch = PassiveVoiceMatch;
|
|
@@ -454,6 +503,8 @@ type text_StringDistanceResult = StringDistanceResult;
|
|
|
454
503
|
type text_TableOptions = TableOptions;
|
|
455
504
|
type text_TextAnalysis = TextAnalysis;
|
|
456
505
|
type text_WordCountResult = WordCountResult;
|
|
506
|
+
type text_WordyPhraseMatch = WordyPhraseMatch;
|
|
507
|
+
type text_WordyPhraseResult = WordyPhraseResult;
|
|
457
508
|
declare const text_addBorder: typeof addBorder;
|
|
458
509
|
declare const text_analyzeKeywordDensity: typeof analyzeKeywordDensity;
|
|
459
510
|
declare const text_analyzeSentenceLengths: typeof analyzeSentenceLengths;
|
|
@@ -462,6 +513,7 @@ declare const text_applyOp: typeof applyOp;
|
|
|
462
513
|
declare const text_applyOps: typeof applyOps;
|
|
463
514
|
declare const text_calculateStringDistance: typeof calculateStringDistance;
|
|
464
515
|
declare const text_centerText: typeof centerText;
|
|
516
|
+
declare const text_checkOxfordCommaConsistency: typeof checkOxfordCommaConsistency;
|
|
465
517
|
declare const text_convertAll: typeof convertAll;
|
|
466
518
|
declare const text_convertCase: typeof convertCase;
|
|
467
519
|
declare const text_countWords: typeof countWords;
|
|
@@ -470,6 +522,7 @@ declare const text_csvToMarkdown: typeof csvToMarkdown;
|
|
|
470
522
|
declare const text_detectDelimiter: typeof detectDelimiter;
|
|
471
523
|
declare const text_detectFillerWords: typeof detectFillerWords;
|
|
472
524
|
declare const text_detectPassiveVoice: typeof detectPassiveVoice;
|
|
525
|
+
declare const text_detectWordyPhrases: typeof detectWordyPhrases;
|
|
473
526
|
declare const text_diffLines: typeof diffLines;
|
|
474
527
|
declare const text_diffLinesSimple: typeof diffLinesSimple;
|
|
475
528
|
declare const text_diffStats: typeof diffStats;
|
|
@@ -515,7 +568,7 @@ declare const text_textToMorse: typeof textToMorse;
|
|
|
515
568
|
declare const text_unescapeString: typeof unescapeString;
|
|
516
569
|
declare const text_wordFrequency: typeof wordFrequency;
|
|
517
570
|
declare namespace text {
|
|
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 };
|
|
571
|
+
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_OxfordCommaInstance as OxfordCommaInstance, type text_OxfordCommaResult as OxfordCommaResult, 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, type text_WordyPhraseMatch as WordyPhraseMatch, type text_WordyPhraseResult as WordyPhraseResult, 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_checkOxfordCommaConsistency as checkOxfordCommaConsistency, 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_detectWordyPhrases as detectWordyPhrases, 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 };
|
|
519
572
|
}
|
|
520
573
|
|
|
521
|
-
export {
|
|
574
|
+
export { applyOp as $, type AsciiFont as A, type PassiveVoiceSentence as B, CASE_FORMATS as C, DEFAULT_CONVERT_OPTIONS as D, EMOJI_TABLE as E, type FillerCategory as F, type ReadabilityScore as G, type SentenceLengthDistribution as H, type SlugSeparator as I, type StringDistanceMode as J, type KeywordDensityEntry as K, LINE_OPS as L, MORSE_CODE as M, type StringDistanceResult as N, type OxfordCommaInstance as O, type ParsedDiff as P, type TextAnalysis as Q, type ReadabilityResult as R, type SentenceLengthBucket as S, type TableOptions as T, type WordyPhraseMatch as U, type WordyPhraseResult as V, type WordCountResult as W, addBorder as X, analyzeKeywordDensity as Y, analyzeSentenceLengths as Z, analyzeText as _, type AsciiOptions as a, applyOps as a0, calculateStringDistance as a1, centerText as a2, checkOxfordCommaConsistency as a3, convertAll as a4, convertCase as a5, countWords as a6, csvToHtml as a7, csvToMarkdown as a8, detectDelimiter as a9, markdownToHtml as aA, morseToText as aB, numberToOrdinal as aC, numberToRoman as aD, numberToWords as aE, ordinalWords as aF, parseDiff as aG, parseTableData as aH, readabilityScore as aI, renderMarkdown as aJ, romanToNumber as aK, scoreReadability as aL, searchEmoji as aM, sentenceCount as aN, slugify as aO, slugifyAll as aP, syllableCount as aQ, textToAscii as aR, textToMorse as aS, unescapeString as aT, wordFrequency as aU, detectFillerWords as aa, detectPassiveVoice as ab, detectWordyPhrases as ac, diffLines as ad, diffLinesSimple as ae, diffStats as af, escapeAll as ag, escapeString as ah, extractHeadings as ai, formatReadingTime as aj, generate as ak, generateDiff as al, generateHtmlTable as am, generateMarkdownTable as an, generateParagraphs as ao, generateSentences as ap, generateWords as aq, getAvailableFonts as ar, getEmojiByCategory as as, getEmojiByChar as at, getEmojiByShortcode as au, getEmojiCategories as av, getMorseForChar as aw, getMorseTiming as ax, htmlToMarkdown as ay, isValidMorse 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 OxfordCommaResult as w, type ParsedTable as x, type PassiveVoiceMatch as y, type PassiveVoiceResult as z };
|
|
@@ -409,6 +409,53 @@ declare function getEmojiByChar(char: string): EmojiEntry | undefined;
|
|
|
409
409
|
declare function getEmojiByCategory(category: string): EmojiEntry[];
|
|
410
410
|
/** All distinct category names present in the table, in table order. */
|
|
411
411
|
declare function getEmojiCategories(): string[];
|
|
412
|
+
interface WordyPhraseMatch {
|
|
413
|
+
phrase: string;
|
|
414
|
+
suggestion: string;
|
|
415
|
+
count: number;
|
|
416
|
+
indices: number[];
|
|
417
|
+
}
|
|
418
|
+
interface WordyPhraseResult {
|
|
419
|
+
totalWords: number;
|
|
420
|
+
totalMatches: number;
|
|
421
|
+
/** Matches per 100 words, to one decimal place. */
|
|
422
|
+
density: number;
|
|
423
|
+
matches: WordyPhraseMatch[];
|
|
424
|
+
}
|
|
425
|
+
/**
|
|
426
|
+
* Scan text against a curated table of wordy/redundant phrases ("due to the
|
|
427
|
+
* fact that", "in order to", "at this point in time") and flag each
|
|
428
|
+
* occurrence with a suggested concise replacement and character offsets.
|
|
429
|
+
* Dictionary-based heuristic, same shape as detectFillerWords: a flagged
|
|
430
|
+
* phrase is a candidate to tighten, not always wrong in context.
|
|
431
|
+
*/
|
|
432
|
+
declare function detectWordyPhrases(text: string): WordyPhraseResult;
|
|
433
|
+
interface OxfordCommaInstance {
|
|
434
|
+
/** A short readable window of text around the matched "and"/"or". */
|
|
435
|
+
snippet: string;
|
|
436
|
+
hasOxfordComma: boolean;
|
|
437
|
+
index: number;
|
|
438
|
+
}
|
|
439
|
+
interface OxfordCommaResult {
|
|
440
|
+
totalLists: number;
|
|
441
|
+
withOxfordComma: number;
|
|
442
|
+
withoutOxfordComma: number;
|
|
443
|
+
/** True when every detected list uses the same Oxford-comma style, or when no lists were found. */
|
|
444
|
+
consistent: boolean;
|
|
445
|
+
instances: OxfordCommaInstance[];
|
|
446
|
+
}
|
|
447
|
+
/**
|
|
448
|
+
* Scan a document for comma-before-and/or usage in three-or-more-item lists
|
|
449
|
+
* and flag inconsistency: some lists using the Oxford (serial) comma while
|
|
450
|
+
* others in the same document don't. For each "and"/"or" conjunction found,
|
|
451
|
+
* it counts the commas since the start of the enclosing sentence; one or
|
|
452
|
+
* more prior commas means the conjunction is closing a list of at least
|
|
453
|
+
* three items, which is where the Oxford comma question applies. This is a
|
|
454
|
+
* heuristic over punctuation, not a grammar parser, so an unrelated comma
|
|
455
|
+
* earlier in the same sentence (e.g. an introductory clause) can occasionally
|
|
456
|
+
* be counted as part of a list.
|
|
457
|
+
*/
|
|
458
|
+
declare function checkOxfordCommaConsistency(text: string): OxfordCommaResult;
|
|
412
459
|
|
|
413
460
|
type text_AsciiFont = AsciiFont;
|
|
414
461
|
type text_AsciiOptions = AsciiOptions;
|
|
@@ -439,6 +486,8 @@ type text_LoremUnit = LoremUnit;
|
|
|
439
486
|
declare const text_MORSE_CODE: typeof MORSE_CODE;
|
|
440
487
|
type text_MarkdownResult = MarkdownResult;
|
|
441
488
|
type text_MorseOptions = MorseOptions;
|
|
489
|
+
type text_OxfordCommaInstance = OxfordCommaInstance;
|
|
490
|
+
type text_OxfordCommaResult = OxfordCommaResult;
|
|
442
491
|
type text_ParsedDiff = ParsedDiff;
|
|
443
492
|
type text_ParsedTable = ParsedTable;
|
|
444
493
|
type text_PassiveVoiceMatch = PassiveVoiceMatch;
|
|
@@ -454,6 +503,8 @@ type text_StringDistanceResult = StringDistanceResult;
|
|
|
454
503
|
type text_TableOptions = TableOptions;
|
|
455
504
|
type text_TextAnalysis = TextAnalysis;
|
|
456
505
|
type text_WordCountResult = WordCountResult;
|
|
506
|
+
type text_WordyPhraseMatch = WordyPhraseMatch;
|
|
507
|
+
type text_WordyPhraseResult = WordyPhraseResult;
|
|
457
508
|
declare const text_addBorder: typeof addBorder;
|
|
458
509
|
declare const text_analyzeKeywordDensity: typeof analyzeKeywordDensity;
|
|
459
510
|
declare const text_analyzeSentenceLengths: typeof analyzeSentenceLengths;
|
|
@@ -462,6 +513,7 @@ declare const text_applyOp: typeof applyOp;
|
|
|
462
513
|
declare const text_applyOps: typeof applyOps;
|
|
463
514
|
declare const text_calculateStringDistance: typeof calculateStringDistance;
|
|
464
515
|
declare const text_centerText: typeof centerText;
|
|
516
|
+
declare const text_checkOxfordCommaConsistency: typeof checkOxfordCommaConsistency;
|
|
465
517
|
declare const text_convertAll: typeof convertAll;
|
|
466
518
|
declare const text_convertCase: typeof convertCase;
|
|
467
519
|
declare const text_countWords: typeof countWords;
|
|
@@ -470,6 +522,7 @@ declare const text_csvToMarkdown: typeof csvToMarkdown;
|
|
|
470
522
|
declare const text_detectDelimiter: typeof detectDelimiter;
|
|
471
523
|
declare const text_detectFillerWords: typeof detectFillerWords;
|
|
472
524
|
declare const text_detectPassiveVoice: typeof detectPassiveVoice;
|
|
525
|
+
declare const text_detectWordyPhrases: typeof detectWordyPhrases;
|
|
473
526
|
declare const text_diffLines: typeof diffLines;
|
|
474
527
|
declare const text_diffLinesSimple: typeof diffLinesSimple;
|
|
475
528
|
declare const text_diffStats: typeof diffStats;
|
|
@@ -515,7 +568,7 @@ declare const text_textToMorse: typeof textToMorse;
|
|
|
515
568
|
declare const text_unescapeString: typeof unescapeString;
|
|
516
569
|
declare const text_wordFrequency: typeof wordFrequency;
|
|
517
570
|
declare namespace text {
|
|
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 };
|
|
571
|
+
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_OxfordCommaInstance as OxfordCommaInstance, type text_OxfordCommaResult as OxfordCommaResult, 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, type text_WordyPhraseMatch as WordyPhraseMatch, type text_WordyPhraseResult as WordyPhraseResult, 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_checkOxfordCommaConsistency as checkOxfordCommaConsistency, 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_detectWordyPhrases as detectWordyPhrases, 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 };
|
|
519
572
|
}
|
|
520
573
|
|
|
521
|
-
export {
|
|
574
|
+
export { applyOp as $, type AsciiFont as A, type PassiveVoiceSentence as B, CASE_FORMATS as C, DEFAULT_CONVERT_OPTIONS as D, EMOJI_TABLE as E, type FillerCategory as F, type ReadabilityScore as G, type SentenceLengthDistribution as H, type SlugSeparator as I, type StringDistanceMode as J, type KeywordDensityEntry as K, LINE_OPS as L, MORSE_CODE as M, type StringDistanceResult as N, type OxfordCommaInstance as O, type ParsedDiff as P, type TextAnalysis as Q, type ReadabilityResult as R, type SentenceLengthBucket as S, type TableOptions as T, type WordyPhraseMatch as U, type WordyPhraseResult as V, type WordCountResult as W, addBorder as X, analyzeKeywordDensity as Y, analyzeSentenceLengths as Z, analyzeText as _, type AsciiOptions as a, applyOps as a0, calculateStringDistance as a1, centerText as a2, checkOxfordCommaConsistency as a3, convertAll as a4, convertCase as a5, countWords as a6, csvToHtml as a7, csvToMarkdown as a8, detectDelimiter as a9, markdownToHtml as aA, morseToText as aB, numberToOrdinal as aC, numberToRoman as aD, numberToWords as aE, ordinalWords as aF, parseDiff as aG, parseTableData as aH, readabilityScore as aI, renderMarkdown as aJ, romanToNumber as aK, scoreReadability as aL, searchEmoji as aM, sentenceCount as aN, slugify as aO, slugifyAll as aP, syllableCount as aQ, textToAscii as aR, textToMorse as aS, unescapeString as aT, wordFrequency as aU, detectFillerWords as aa, detectPassiveVoice as ab, detectWordyPhrases as ac, diffLines as ad, diffLinesSimple as ae, diffStats as af, escapeAll as ag, escapeString as ah, extractHeadings as ai, formatReadingTime as aj, generate as ak, generateDiff as al, generateHtmlTable as am, generateMarkdownTable as an, generateParagraphs as ao, generateSentences as ap, generateWords as aq, getAvailableFonts as ar, getEmojiByCategory as as, getEmojiByChar as at, getEmojiByShortcode as au, getEmojiCategories as av, getMorseForChar as aw, getMorseTiming as ax, htmlToMarkdown as ay, isValidMorse 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 OxfordCommaResult as w, type ParsedTable as x, type PassiveVoiceMatch as y, type PassiveVoiceResult as z };
|
package/dist/tools/media.cjs
CHANGED
|
@@ -567,6 +567,74 @@ function readPdfPageDimensions(bytes) {
|
|
|
567
567
|
if (out.length === 0) return { error: "Could not locate any page objects in this PDF" };
|
|
568
568
|
return { version, pageCount: out.length, pages: out };
|
|
569
569
|
}
|
|
570
|
+
function parsePdfOutlineDest(dict) {
|
|
571
|
+
const directRef = dict.match(/\/Dest\s*\[\s*(\d+)\s+(\d+)\s+R/);
|
|
572
|
+
if (directRef) return { destType: "page", target: `${directRef[1]} ${directRef[2]} R` };
|
|
573
|
+
const directName = dict.match(/\/Dest\s*\/([^\s/()<>[\]]+)/);
|
|
574
|
+
if (directName) return { destType: "named", target: directName[1] };
|
|
575
|
+
const directString = dict.match(/\/Dest\s*\(((?:\\.|[^\\()])*)\)/);
|
|
576
|
+
if (directString) return { destType: "named", target: decodePdfString(directString[1], false) };
|
|
577
|
+
const actionUri = dict.match(/\/S\s*\/URI[\s\S]*?\/URI\s*\(((?:\\.|[^\\()])*)\)/);
|
|
578
|
+
if (actionUri) return { destType: "uri", target: decodePdfString(actionUri[1], false) };
|
|
579
|
+
const actionGotoRef = dict.match(/\/S\s*\/GoTo[\s\S]*?\/D\s*\[\s*(\d+)\s+(\d+)\s+R/);
|
|
580
|
+
if (actionGotoRef) return { destType: "page", target: `${actionGotoRef[1]} ${actionGotoRef[2]} R` };
|
|
581
|
+
const actionGotoName = dict.match(/\/S\s*\/GoTo[\s\S]*?\/D\s*\/([^\s/()<>[\]]+)/);
|
|
582
|
+
if (actionGotoName) return { destType: "named", target: actionGotoName[1] };
|
|
583
|
+
return { destType: "none", target: null };
|
|
584
|
+
}
|
|
585
|
+
function walkPdfOutlineChain(objMap, startRef, level, visited, out) {
|
|
586
|
+
let ref = startRef;
|
|
587
|
+
while (ref) {
|
|
588
|
+
if (visited.has(ref)) break;
|
|
589
|
+
visited.add(ref);
|
|
590
|
+
const body = objMap.get(ref);
|
|
591
|
+
if (!body) break;
|
|
592
|
+
const titleRaw = extractDictField(body, "Title");
|
|
593
|
+
const { destType, target } = parsePdfOutlineDest(body);
|
|
594
|
+
out.push({ title: titleRaw ?? "(untitled)", level, destType, target });
|
|
595
|
+
const firstMatch = body.match(/\/First\s+(\d+)\s+(\d+)\s+R/);
|
|
596
|
+
if (firstMatch) walkPdfOutlineChain(objMap, `${firstMatch[1]} ${firstMatch[2]}`, level + 1, visited, out);
|
|
597
|
+
const nextMatch = body.match(/\/Next\s+(\d+)\s+(\d+)\s+R/);
|
|
598
|
+
ref = nextMatch ? `${nextMatch[1]} ${nextMatch[2]}` : null;
|
|
599
|
+
}
|
|
600
|
+
}
|
|
601
|
+
function readPdfOutline(bytes) {
|
|
602
|
+
if (bytes.length < 8) return { error: "File too small to be a PDF" };
|
|
603
|
+
const header = bytesToLatin1(bytes.subarray(0, 16));
|
|
604
|
+
const versionMatch = header.match(/%PDF-(\d\.\d)/);
|
|
605
|
+
if (!versionMatch) return { error: "Not a valid PDF file (missing %PDF header)" };
|
|
606
|
+
const version = versionMatch[1];
|
|
607
|
+
const text = bytesToLatin1(bytes);
|
|
608
|
+
const objBlocks = [...text.matchAll(/(\d+)\s+(\d+)\s+obj([\s\S]*?)endobj/g)];
|
|
609
|
+
const objMap = /* @__PURE__ */ new Map();
|
|
610
|
+
for (const b of objBlocks) objMap.set(`${b[1]} ${b[2]}`, b[3]);
|
|
611
|
+
let outlinesBody = null;
|
|
612
|
+
const trailerMatches = [...text.matchAll(/trailer\s*<<([\s\S]*?)>>/g)];
|
|
613
|
+
if (trailerMatches.length > 0) {
|
|
614
|
+
const trailer = trailerMatches[trailerMatches.length - 1][1];
|
|
615
|
+
const rootRef = trailer.match(/\/Root\s+(\d+)\s+(\d+)\s+R/);
|
|
616
|
+
if (rootRef) {
|
|
617
|
+
const catalogBody = objMap.get(`${rootRef[1]} ${rootRef[2]}`);
|
|
618
|
+
const outlinesRef = catalogBody?.match(/\/Outlines\s+(\d+)\s+(\d+)\s+R/);
|
|
619
|
+
if (outlinesRef) outlinesBody = objMap.get(`${outlinesRef[1]} ${outlinesRef[2]}`) ?? null;
|
|
620
|
+
}
|
|
621
|
+
}
|
|
622
|
+
if (!outlinesBody) {
|
|
623
|
+
for (const b of objBlocks) {
|
|
624
|
+
if (/\/Type\s*\/Outlines\b/.test(b[3])) {
|
|
625
|
+
outlinesBody = b[3];
|
|
626
|
+
break;
|
|
627
|
+
}
|
|
628
|
+
}
|
|
629
|
+
}
|
|
630
|
+
if (!outlinesBody) return { error: "No /Outlines bookmark tree found in this PDF" };
|
|
631
|
+
const out = [];
|
|
632
|
+
const firstMatch = outlinesBody.match(/\/First\s+(\d+)\s+(\d+)\s+R/);
|
|
633
|
+
if (firstMatch) {
|
|
634
|
+
walkPdfOutlineChain(objMap, `${firstMatch[1]} ${firstMatch[2]}`, 0, /* @__PURE__ */ new Set(), out);
|
|
635
|
+
}
|
|
636
|
+
return { version, bookmarkCount: out.length, bookmarks: out };
|
|
637
|
+
}
|
|
570
638
|
var AUDIO_FORMAT_LABELS = {
|
|
571
639
|
1: "PCM",
|
|
572
640
|
3: "IEEE float",
|
|
@@ -1432,6 +1500,7 @@ exports.readId3Tags = readId3Tags;
|
|
|
1432
1500
|
exports.readImageInfo = readImageInfo;
|
|
1433
1501
|
exports.readMidiInfo = readMidiInfo;
|
|
1434
1502
|
exports.readPdfMetadata = readPdfMetadata;
|
|
1503
|
+
exports.readPdfOutline = readPdfOutline;
|
|
1435
1504
|
exports.readPdfPageDimensions = readPdfPageDimensions;
|
|
1436
1505
|
exports.readVideoInfo = readVideoInfo;
|
|
1437
1506
|
exports.readWavInfo = readWavInfo;
|
package/dist/tools/media.d.cts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { E as ExifData, a as ExifError, F as FlacInfo, b as FlacInfoError, G as GifInfo, c as GifInfoError, I as IcoImageEntry, d as IcoInfo, e as IcoInfoError, f as Id3Tags, g as Id3TagsError, h as ImageFormat, i as ImageInfo, j as ImageInfoError, M as MidiDivision, k as MidiInfo, l as MidiInfoError, n as MidiTimeSignature, o as MidiTrackInfo, P as PdfMetadata, p as PdfMetadataError, q as
|
|
1
|
+
export { E as ExifData, a as ExifError, F as FlacInfo, b as FlacInfoError, G as GifInfo, c as GifInfoError, I as IcoImageEntry, d as IcoInfo, e as IcoInfoError, f as Id3Tags, g as Id3TagsError, h as ImageFormat, i as ImageInfo, j as ImageInfoError, M as MidiDivision, k as MidiInfo, l as MidiInfoError, n as MidiTimeSignature, o as MidiTrackInfo, P as PdfMetadata, p as PdfMetadataError, q as PdfOutlineDestType, r as PdfOutlineError, s as PdfOutlineItem, t as PdfOutlineResult, u as PdfPageDimension, v as PdfPageDimensionsResult, w as PdfPageOrientation, V as VideoInfo, x as VideoInfoError, W as WavInfo, y as WavInfoError, z as inspectGifFrames, A as readExifData, B as readFlacInfo, C as readIcoInfo, D as readId3Tags, H as readImageInfo, J as readMidiInfo, K as readPdfMetadata, L as readPdfOutline, N as readPdfPageDimensions, O as readVideoInfo, Q as readWavInfo } from '../media-DF8BS-iA.cjs';
|
package/dist/tools/media.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { E as ExifData, a as ExifError, F as FlacInfo, b as FlacInfoError, G as GifInfo, c as GifInfoError, I as IcoImageEntry, d as IcoInfo, e as IcoInfoError, f as Id3Tags, g as Id3TagsError, h as ImageFormat, i as ImageInfo, j as ImageInfoError, M as MidiDivision, k as MidiInfo, l as MidiInfoError, n as MidiTimeSignature, o as MidiTrackInfo, P as PdfMetadata, p as PdfMetadataError, q as
|
|
1
|
+
export { E as ExifData, a as ExifError, F as FlacInfo, b as FlacInfoError, G as GifInfo, c as GifInfoError, I as IcoImageEntry, d as IcoInfo, e as IcoInfoError, f as Id3Tags, g as Id3TagsError, h as ImageFormat, i as ImageInfo, j as ImageInfoError, M as MidiDivision, k as MidiInfo, l as MidiInfoError, n as MidiTimeSignature, o as MidiTrackInfo, P as PdfMetadata, p as PdfMetadataError, q as PdfOutlineDestType, r as PdfOutlineError, s as PdfOutlineItem, t as PdfOutlineResult, u as PdfPageDimension, v as PdfPageDimensionsResult, w as PdfPageOrientation, V as VideoInfo, x as VideoInfoError, W as WavInfo, y as WavInfoError, z as inspectGifFrames, A as readExifData, B as readFlacInfo, C as readIcoInfo, D as readId3Tags, H as readImageInfo, J as readMidiInfo, K as readPdfMetadata, L as readPdfOutline, N as readPdfPageDimensions, O as readVideoInfo, Q as readWavInfo } from '../media-DF8BS-iA.js';
|
package/dist/tools/media.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { inspectGifFrames, readExifData, readFlacInfo, readIcoInfo, readId3Tags, readImageInfo, readMidiInfo, readPdfMetadata, readPdfPageDimensions, readVideoInfo, readWavInfo } from '../chunk-
|
|
1
|
+
export { inspectGifFrames, readExifData, readFlacInfo, readIcoInfo, readId3Tags, readImageInfo, readMidiInfo, readPdfMetadata, readPdfOutline, readPdfPageDimensions, readVideoInfo, readWavInfo } from '../chunk-ZWFZRDQ4.js';
|
|
2
2
|
import '../chunk-MLKGABMK.js';
|