text-sanctifier 1.1.0 → 1.1.1

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.
@@ -1,3 +1,10 @@
1
+ export type UnicodeTrashReport = import("./inspectText.js").UnicodeTrashReport;
2
+ export type TrashCategory = import("./inspectText.js").TrashCategory;
3
+ export type TrashFinding = import("./inspectText.js").TrashFinding;
4
+ export type TrashCounts = import("./inspectText.js").TrashCounts;
5
+ export type DetailedTrashReport = import("./inspectText.js").DetailedTrashReport;
6
+ export type InspectDetailedOptions = import("./inspectText.js").InspectDetailedOptions;
7
+ export type SanctifyOptions = import("./sanctifyText.js").SanctifyOptions;
1
8
  import { inspectText } from './inspectText.js';
2
9
  import { inspectTextDetailed } from './inspectText.js';
3
10
  import { getRecommendedSanctifierOptions } from './inspectText.js';
@@ -47,6 +47,7 @@ export function getNewlineStats(text: string): {
47
47
  * @return {!SanctifyOptions}
48
48
  */
49
49
  export function getRecommendedSanctifierOptions(report: UnicodeTrashReport): SanctifyOptions;
50
+ export type SanctifyOptions = import("./sanctifyText.js").SanctifyOptions;
50
51
  export type UnicodeTrashReport = {
51
52
  hasControlChars: boolean;
52
53
  hasInvisibleChars: boolean;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "text-sanctifier",
3
- "version": "1.1.0",
3
+ "version": "1.1.1",
4
4
  "type": "module",
5
5
  "description": "A brutal text normalizer and invisible trash scrubber for modern web projects.",
6
6
  "engines": {
@@ -33,9 +33,10 @@
33
33
  "scripts": {
34
34
  "build": "node scripts/buildc.js",
35
35
  "build:types": "tsc -p tsconfig.types.json",
36
+ "test:types": "tsc -p tests/types/tsconfig.json",
36
37
  "test": "node tests/sanctifyText.test.js && node tests/inspectTextDetailed.test.js",
37
38
  "test-min": "node tests/sanctifyText.test.min.js",
38
- "ci": "npm run test && npm run build && npm run build:types && npm run test-min"
39
+ "ci": "npm run test && npm run build && npm run build:types && npm run test:types && npm run test-min"
39
40
  },
40
41
  "keywords": [
41
42
  "text",
package/src/index.d.ts CHANGED
@@ -3,3 +3,10 @@ import { inspectTextDetailed } from './inspectText.js';
3
3
  import { getRecommendedSanctifierOptions } from './inspectText.js';
4
4
  import { summonSanctifier } from './sanctifyText.js';
5
5
  export { inspectText, inspectTextDetailed, getRecommendedSanctifierOptions, summonSanctifier };
6
+ export type UnicodeTrashReport = import('./inspectText.js').UnicodeTrashReport;
7
+ export type TrashCategory = import('./inspectText.js').TrashCategory;
8
+ export type TrashFinding = import('./inspectText.js').TrashFinding;
9
+ export type TrashCounts = import('./inspectText.js').TrashCounts;
10
+ export type DetailedTrashReport = import('./inspectText.js').DetailedTrashReport;
11
+ export type InspectDetailedOptions = import('./inspectText.js').InspectDetailedOptions;
12
+ export type SanctifyOptions = import('./sanctifyText.js').SanctifyOptions;
package/src/index.js CHANGED
@@ -7,6 +7,15 @@ export { inspectText, inspectTextDetailed, getRecommendedSanctifierOptions };
7
7
  import { summonSanctifier } from './sanctifyText.js';
8
8
  export { summonSanctifier };
9
9
 
10
+ // Type-only re-exports so TypeScript consumers can name these from the package root.
11
+ /** @typedef {import('./inspectText.js').UnicodeTrashReport} UnicodeTrashReport */
12
+ /** @typedef {import('./inspectText.js').TrashCategory} TrashCategory */
13
+ /** @typedef {import('./inspectText.js').TrashFinding} TrashFinding */
14
+ /** @typedef {import('./inspectText.js').TrashCounts} TrashCounts */
15
+ /** @typedef {import('./inspectText.js').DetailedTrashReport} DetailedTrashReport */
16
+ /** @typedef {import('./inspectText.js').InspectDetailedOptions} InspectDetailedOptions */
17
+ /** @typedef {import('./sanctifyText.js').SanctifyOptions} SanctifyOptions */
18
+
10
19
 
11
20
  // In Future: export helpers for power users
12
21
  // export { purgeInvisibleTrash, purgeEmojisCharacters, normalizeNewlines, trimSpacesAroundNewlines, collapseParagraphs, collapseExtraSpaces, purgeControlCharacters } from './sanctifyText.js';
@@ -8,6 +8,8 @@ import {
8
8
  normalizeTypographicJank,
9
9
  } from './sanctifyText.js';
10
10
 
11
+ /** @typedef {import('./sanctifyText.js').SanctifyOptions} SanctifyOptions */
12
+
11
13
 
12
14
  /**
13
15
  * @typedef {Object} UnicodeTrashReport