@i18nprune/core 0.1.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/LICENSE +21 -0
- package/README.md +165 -0
- package/dist/adapters-gp1lXp0T.d.ts +12 -0
- package/dist/capabilities-x74cD2Hu.d.ts +48 -0
- package/dist/cleanup.d.ts +64 -0
- package/dist/cleanup.js +3999 -0
- package/dist/config.d.ts +201 -0
- package/dist/config.js +2865 -0
- package/dist/coreContext-DMaWLvmB.d.ts +388 -0
- package/dist/fs-BUYD8ZhA.d.ts +20 -0
- package/dist/generate.d.ts +487 -0
- package/dist/generate.js +9389 -0
- package/dist/humanEmit-ygNlYX-S.d.ts +79 -0
- package/dist/index-BQuLEQ9b.d.ts +7 -0
- package/dist/index-B_ow_Xvr.d.ts +97 -0
- package/dist/index-BgG01AKL.d.ts +287 -0
- package/dist/index-CIzZl4W8.d.ts +124 -0
- package/dist/index-Csm1w7XD.d.ts +58 -0
- package/dist/index-DLwTogCo.d.ts +43 -0
- package/dist/index-DVT26v11.d.ts +61 -0
- package/dist/index-DdjljwMj.d.ts +39 -0
- package/dist/index-DeIw-cZd.d.ts +52 -0
- package/dist/index-X50E1FIX.d.ts +50 -0
- package/dist/index.d.ts +9180 -0
- package/dist/index.js +21888 -0
- package/dist/init.d.ts +86 -0
- package/dist/init.js +848 -0
- package/dist/listWindow-XEFxQZi1.d.ts +30 -0
- package/dist/localeTargetCodes-BBIQjauw.d.ts +11 -0
- package/dist/locales.d.ts +39 -0
- package/dist/locales.js +2288 -0
- package/dist/missing-BVCvgUC8.d.ts +10 -0
- package/dist/missing.d.ts +85 -0
- package/dist/missing.js +5892 -0
- package/dist/modeResolve-cGVaY5Hh.d.ts +25 -0
- package/dist/path-Bfn3SAts.d.ts +11 -0
- package/dist/profile-BwOP9WKh.d.ts +9 -0
- package/dist/providers-0uMEfT6q.d.ts +82 -0
- package/dist/prune-c6hKZCv_.d.ts +33 -0
- package/dist/quality.d.ts +36 -0
- package/dist/quality.js +3868 -0
- package/dist/report-D5-6bVFj.d.ts +8 -0
- package/dist/report-schema.d.ts +102 -0
- package/dist/report-schema.js +42 -0
- package/dist/resumeCandidates-xR13eEwt.d.ts +200 -0
- package/dist/root-2-kCaBvQ.d.ts +1110 -0
- package/dist/runtime/edge.d.ts +21 -0
- package/dist/runtime/edge.js +87 -0
- package/dist/runtime/helpers/sync.d.ts +16 -0
- package/dist/runtime/helpers/sync.js +117 -0
- package/dist/runtime/node.d.ts +24 -0
- package/dist/runtime/node.js +204 -0
- package/dist/runtime/web.d.ts +21 -0
- package/dist/runtime/web.js +84 -0
- package/dist/shared.d.ts +1177 -0
- package/dist/shared.js +4897 -0
- package/dist/sourceContext-1LQg3HiQ.d.ts +36 -0
- package/dist/sourceSurface-mDtwGo1E.d.ts +122 -0
- package/dist/sync.d.ts +86 -0
- package/dist/sync.js +4971 -0
- package/dist/syncSegment-Bx6He2Mu.d.ts +149 -0
- package/dist/targets-EmtKyr6F.d.ts +23 -0
- package/dist/template-CGM-_WLT.d.ts +139 -0
- package/dist/translate-CIHYp7wi.d.ts +77 -0
- package/dist/types/shared.d.ts +21 -0
- package/dist/types/shared.js +1 -0
- package/dist/types.d.ts +1345 -0
- package/dist/types.js +1 -0
- package/dist/validate.d.ts +126 -0
- package/dist/validate.js +3717 -0
- package/package.json +128 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 i18nprune contributors
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
<div align="center">
|
|
2
|
+
|
|
3
|
+
<h1>@i18nprune/core</h1>
|
|
4
|
+
|
|
5
|
+
[](https://github.com/zamdevio/i18nprune/blob/main/LICENSE)
|
|
6
|
+
[](https://nodejs.org/)
|
|
7
|
+
[](https://www.npmjs.com/package/@i18nprune/core)
|
|
8
|
+
|
|
9
|
+
<p><strong>Validate · sync · generate · review · quality · cleanup · doctor · report · share</strong></p>
|
|
10
|
+
<p>
|
|
11
|
+
Runtime-neutral domain engine for <a href="https://i18nprune.dev">i18nprune</a> — same behavior as the CLI, without shelling out.
|
|
12
|
+
</p>
|
|
13
|
+
<p>
|
|
14
|
+
<a href="https://docs.i18nprune.dev">Documentation</a> ·
|
|
15
|
+
<a href="#quick-start">Quick start</a> ·
|
|
16
|
+
<a href="#subpath-exports">Subpaths</a> ·
|
|
17
|
+
<a href="https://www.npmjs.com/package/i18nprune">CLI package</a>
|
|
18
|
+
</p>
|
|
19
|
+
</div>
|
|
20
|
+
|
|
21
|
+
---
|
|
22
|
+
|
|
23
|
+
Pure TypeScript engine for locale validation, sync, translation, diagnostics, and hosted share/report workflows. **No `console.*` and no direct `process.*` in core** — your host passes **runtime adapters** and an **env** object so the same logic runs in Node scripts, CI, browsers, and edge workers.
|
|
24
|
+
|
|
25
|
+
## Install
|
|
26
|
+
|
|
27
|
+
Requires **Node.js >= 18**.
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
npm install @i18nprune/core
|
|
31
|
+
# or: pnpm add @i18nprune/core
|
|
32
|
+
# or: yarn add @i18nprune/core
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
## Quick start
|
|
36
|
+
|
|
37
|
+
```ts
|
|
38
|
+
import { resolveContext, runSync } from '@i18nprune/core';
|
|
39
|
+
import { createNodeRuntimeAdapters } from '@i18nprune/core/runtime/node';
|
|
40
|
+
|
|
41
|
+
const ctx = await resolveContext({
|
|
42
|
+
projectRoot: process.cwd(),
|
|
43
|
+
adapters: createNodeRuntimeAdapters(),
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
const result = await runSync(
|
|
47
|
+
ctx,
|
|
48
|
+
{ dryRun: true },
|
|
49
|
+
{ onProgress: () => {} },
|
|
50
|
+
);
|
|
51
|
+
|
|
52
|
+
console.log(result.summary);
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
Use **`defineConfig`** / **`loadConfig`** from `@i18nprune/core/config` when you want the same `i18nprune.config.ts` contract as the CLI.
|
|
56
|
+
|
|
57
|
+
## Why embed the SDK
|
|
58
|
+
|
|
59
|
+
| Benefit | What you get |
|
|
60
|
+
|--------|----------------|
|
|
61
|
+
| **Same engine as CLI** | `runValidate`, `runSync`, `runGenerate`, … share issue codes and cache rules with `i18nprune --json`. |
|
|
62
|
+
| **Host-owned UX** | Progress, logging, and exit policy stay in your app; core returns structured results. |
|
|
63
|
+
| **Runtime choice** | Node, browser (`runtime/web`), or edge (`runtime/edge`) adapter factories — one implementation graph per surface. |
|
|
64
|
+
| **Granular imports** | Subpath exports keep bundles small (`/validate`, `/sync`, `/generate`, …). |
|
|
65
|
+
| **Advanced integrations** | Cache, share upload prep, report ingest validation, and translation providers without subprocess overhead. |
|
|
66
|
+
|
|
67
|
+
Cross-platform behavior matches the CLI: Linux, macOS, and Windows path and cache semantics are parity-tested in the monorepo.
|
|
68
|
+
|
|
69
|
+
## Subpath exports
|
|
70
|
+
|
|
71
|
+
Published **`exports`** (see `package.json`):
|
|
72
|
+
|
|
73
|
+
| Subpath | Typical use |
|
|
74
|
+
|---------|----------------|
|
|
75
|
+
| `@i18nprune/core` | Root barrel: `runXxx`, `resolveContext`, namespaces (`validate`, `sync`, `translator`, …). |
|
|
76
|
+
| `@i18nprune/core/config` | `defineConfig`, schema, path resolution. |
|
|
77
|
+
| `@i18nprune/core/validate` | Validation-only graph. |
|
|
78
|
+
| `@i18nprune/core/sync` | Locale shape sync / prune. |
|
|
79
|
+
| `@i18nprune/core/generate` | Provider translation runs. |
|
|
80
|
+
| `@i18nprune/core/missing` | Missing-key workflows. |
|
|
81
|
+
| `@i18nprune/core/quality` | Quality checks. |
|
|
82
|
+
| `@i18nprune/core/cleanup` | Cleanup operations. |
|
|
83
|
+
| `@i18nprune/core/init` | Project bootstrap helpers. |
|
|
84
|
+
| `@i18nprune/core/locales` | Locale layout and listing helpers. |
|
|
85
|
+
| `@i18nprune/core/shared` | Shared primitives (JSON, scanner, constants, run helpers) — namespaced + flat re-exports. |
|
|
86
|
+
| `@i18nprune/core/types` | Public type barrels. |
|
|
87
|
+
| `@i18nprune/core/report-schema` | `ProjectReportDocument` Zod schema and ingest validation. |
|
|
88
|
+
| `@i18nprune/core/runtime/node` | Node `fs` / path adapters. |
|
|
89
|
+
| `@i18nprune/core/runtime/web` | Browser-safe adapter surface. |
|
|
90
|
+
| `@i18nprune/core/runtime/edge` | Worker / edge adapter surface. |
|
|
91
|
+
| `@i18nprune/core/runtime/helpers/sync` | Sync FS helpers shared across runtimes. |
|
|
92
|
+
|
|
93
|
+
Prefer the **smallest subpath** that fits your bundle; fall back to the root entry when you need several domains in one script.
|
|
94
|
+
|
|
95
|
+
## Operation entry points
|
|
96
|
+
|
|
97
|
+
Command-equivalent **`runXxx`** functions (non-exhaustive):
|
|
98
|
+
|
|
99
|
+
| Operation | Entry | CLI twin |
|
|
100
|
+
|-----------|--------|----------|
|
|
101
|
+
| Validate | `runValidate` | `i18nprune validate` |
|
|
102
|
+
| Sync | `runSync` | `i18nprune sync` |
|
|
103
|
+
| Generate | `runGenerate` | `i18nprune generate` |
|
|
104
|
+
| Translate | `runTranslate` | provider pipeline |
|
|
105
|
+
| Missing | `runMissing` | `i18nprune missing` |
|
|
106
|
+
| Quality | `runQuality` | `i18nprune quality` |
|
|
107
|
+
| Review | `runReview` | `i18nprune review` |
|
|
108
|
+
| Cleanup | `runCleanup` | `i18nprune cleanup` |
|
|
109
|
+
| Doctor | `runDoctor` | `i18nprune doctor` |
|
|
110
|
+
| Report | `runReport` | `i18nprune report` |
|
|
111
|
+
| Share | `runShare` | `i18nprune share` |
|
|
112
|
+
| Init | `runInit` | `i18nprune init` |
|
|
113
|
+
|
|
114
|
+
Deep wiring table (maintainer clone): `maintainer/systems/operations/entrypoints.md`.
|
|
115
|
+
|
|
116
|
+
## Runtime adapters
|
|
117
|
+
|
|
118
|
+
| Host | Import |
|
|
119
|
+
|------|--------|
|
|
120
|
+
| Node / scripts / CI | `@i18nprune/core/runtime/node` |
|
|
121
|
+
| Browser tooling | `@i18nprune/core/runtime/web` |
|
|
122
|
+
| Workers / edge | `@i18nprune/core/runtime/edge` |
|
|
123
|
+
|
|
124
|
+
Docs: [Runtime overview](https://docs.i18nprune.dev/runtime/).
|
|
125
|
+
|
|
126
|
+
## Config, cache, and contracts
|
|
127
|
+
|
|
128
|
+
- **Config:** `locales.structure`, cache profiles (`safe` | `balanced` | `fast`), translation providers — see [Config hub](https://docs.i18nprune.dev/config/).
|
|
129
|
+
- **Cache:** per-project analysis + persisted translation cache; hosts must not fork rebuild policy — see [CLI cache](https://docs.i18nprune.dev/cli/cache.md).
|
|
130
|
+
- **CLI JSON parity:** stable issue codes and `--json` envelope helpers via `result` exports — see [CLI JSON](https://docs.i18nprune.dev/cli/json.md) and [Issues](https://docs.i18nprune.dev/issues/).
|
|
131
|
+
- **Reports:** build payloads with `runReport`; validate ingest with `@i18nprune/core/report-schema` before upload.
|
|
132
|
+
|
|
133
|
+
## Examples (monorepo)
|
|
134
|
+
|
|
135
|
+
Runnable SDK samples live under `examples/sdk/` in the [i18nprune repository](https://github.com/zamdevio/i18nprune):
|
|
136
|
+
|
|
137
|
+
- `examples/sdk/sync/runSync.ts`
|
|
138
|
+
- `examples/sdk/generate/runGenerate.ts`
|
|
139
|
+
- `examples/sdk/missing/runMissing.ts`
|
|
140
|
+
- `examples/sdk/quality/runQuality.ts`
|
|
141
|
+
- `examples/sdk/review/runReview.ts`
|
|
142
|
+
- `examples/sdk/doctor/runDoctor.ts`
|
|
143
|
+
- `examples/sdk/share/runShareList.ts`
|
|
144
|
+
- `examples/sdk/translate/runTranslate.ts`
|
|
145
|
+
|
|
146
|
+
## CLI-only users
|
|
147
|
+
|
|
148
|
+
If you only need the terminal tool, install the root package instead:
|
|
149
|
+
|
|
150
|
+
```bash
|
|
151
|
+
npm install -g i18nprune
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
Bundled programmatic surface: `import … from 'i18nprune/core'` (rolled build, not granular subpaths).
|
|
155
|
+
|
|
156
|
+
## Documentation
|
|
157
|
+
|
|
158
|
+
- [SDK operations](https://docs.i18nprune.dev/sdk/operations.html)
|
|
159
|
+
- [Architecture](https://docs.i18nprune.dev/architecture/)
|
|
160
|
+
- [Commands](https://docs.i18nprune.dev/commands/)
|
|
161
|
+
- Live site: [docs.i18nprune.dev](https://docs.i18nprune.dev)
|
|
162
|
+
|
|
163
|
+
## License
|
|
164
|
+
|
|
165
|
+
MIT — see [LICENSE](https://github.com/zamdevio/i18nprune/blob/main/LICENSE) in the monorepo root.
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { C as CoreEngineRuntime, R as RuntimeNetworkCap } from './capabilities-x74cD2Hu.js';
|
|
2
|
+
|
|
3
|
+
type RuntimeKind = 'node' | 'web' | 'edge';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Full host binding for CLI / Workers: project I/O, HTTP, and runtime kind.
|
|
7
|
+
*/
|
|
8
|
+
type RuntimeAdapters = CoreEngineRuntime & RuntimeNetworkCap & {
|
|
9
|
+
kind: RuntimeKind;
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
export type { RuntimeAdapters as R, RuntimeKind as a };
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { R as RuntimeFsPort } from './fs-BUYD8ZhA.js';
|
|
2
|
+
import { R as RuntimePathPort } from './path-Bfn3SAts.js';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* HTTP surface for translation backends and future remote tooling.
|
|
6
|
+
* Hosts supply `globalThis.fetch` (Node 18+, Workers, browsers) or a test double.
|
|
7
|
+
*/
|
|
8
|
+
type RuntimeNetworkPort = {
|
|
9
|
+
fetch: typeof globalThis.fetch;
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
type RuntimeSystemPort = {
|
|
13
|
+
cwd: () => string;
|
|
14
|
+
now: () => number;
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
/** Filesystem port only. */
|
|
18
|
+
type RuntimeFsCap = {
|
|
19
|
+
fs: RuntimeFsPort;
|
|
20
|
+
};
|
|
21
|
+
/** Path port only. */
|
|
22
|
+
type RuntimePathCap = {
|
|
23
|
+
path: RuntimePathPort;
|
|
24
|
+
};
|
|
25
|
+
/** Clock / cwd (no filesystem). */
|
|
26
|
+
type RuntimeSystemCap = {
|
|
27
|
+
system: RuntimeSystemPort;
|
|
28
|
+
};
|
|
29
|
+
/** HTTP client (`fetch`) — not part of {@link CoreEngineRuntime}; use for translate / remote APIs. */
|
|
30
|
+
type RuntimeNetworkCap = {
|
|
31
|
+
network: RuntimeNetworkPort;
|
|
32
|
+
};
|
|
33
|
+
/**
|
|
34
|
+
* Filesystem + path: scanning, locale file listing, meta resolution.
|
|
35
|
+
* Does not include `system` or `network`.
|
|
36
|
+
*/
|
|
37
|
+
type ProjectFilesystemRuntime = RuntimeFsCap & RuntimePathCap;
|
|
38
|
+
/**
|
|
39
|
+
* Path + system only (no `fs`): resolve relative config paths against `cwd()` without reading files through the port.
|
|
40
|
+
*/
|
|
41
|
+
type ConfigPathSystemRuntime = RuntimePathCap & RuntimeSystemCap;
|
|
42
|
+
/**
|
|
43
|
+
* Default “project I/O” bundle: `fs`, `path`, and `system` (`cwd` / `now`).
|
|
44
|
+
* Prefer {@link ProjectFilesystemRuntime} on APIs that never touch `system`.
|
|
45
|
+
*/
|
|
46
|
+
type CoreEngineRuntime = RuntimeFsCap & RuntimePathCap & RuntimeSystemCap;
|
|
47
|
+
|
|
48
|
+
export type { CoreEngineRuntime as C, ProjectFilesystemRuntime as P, RuntimeNetworkCap as R, RuntimeSystemPort as a, ConfigPathSystemRuntime as b, RuntimeFsCap as c, RuntimeNetworkPort as d, RuntimePathCap as e, RuntimeSystemCap as f };
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { S as StringLeaf } from './index-BQuLEQ9b.js';
|
|
2
|
+
import { a as PreservePolicy } from './root-2-kCaBvQ.js';
|
|
3
|
+
import { P as ProjectLiteralKeyUsage, C as CleanupWritePlan, a as CleanupHostHooks, b as CleanupRunOptions, c as CleanupRunResult, d as CleanupSourceSegmentRef } from './sourceSurface-mDtwGo1E.js';
|
|
4
|
+
export { e as CleanupJsonOutput, f as CleanupJsonRunSummary, g as CleanupSegmentWrite, h as CleanupStringPresenceEvidence, R as ResolveCleanupKeysWithStringPresenceInput, r as resolveCleanupKeysWithStringPresencePolicy } from './sourceSurface-mDtwGo1E.js';
|
|
5
|
+
import { C as CoreContext, T as TranslationSurfaceLeaf } from './coreContext-DMaWLvmB.js';
|
|
6
|
+
import 'zod';
|
|
7
|
+
import './path-Bfn3SAts.js';
|
|
8
|
+
import './fs-BUYD8ZhA.js';
|
|
9
|
+
import './providers-0uMEfT6q.js';
|
|
10
|
+
import './index-DdjljwMj.js';
|
|
11
|
+
import './index-X50E1FIX.js';
|
|
12
|
+
import './index-BgG01AKL.js';
|
|
13
|
+
import './capabilities-x74cD2Hu.js';
|
|
14
|
+
import './adapters-gp1lXp0T.js';
|
|
15
|
+
|
|
16
|
+
/** True when `key` is the root path or nested under a root in `usedRoots` (array segment `[` counts as root). */
|
|
17
|
+
declare function pathUnderRoot(key: string, roots: ReadonlySet<string>): boolean;
|
|
18
|
+
type CleanupCandidateInput = {
|
|
19
|
+
leaves: readonly StringLeaf[];
|
|
20
|
+
usage: ProjectLiteralKeyUsage;
|
|
21
|
+
preserve?: PreservePolicy;
|
|
22
|
+
uncertainPrefixes: readonly string[];
|
|
23
|
+
/** When true, drop candidates under {@link pathUnderAnyUncertainPrefix}. */
|
|
24
|
+
filterUncertainPrefixes: boolean;
|
|
25
|
+
};
|
|
26
|
+
/**
|
|
27
|
+
* Unused key paths in source locale JSON after scan + preserve + optional uncertain-prefix rules.
|
|
28
|
+
*/
|
|
29
|
+
declare function computeCleanupCandidateKeys(input: CleanupCandidateInput): {
|
|
30
|
+
allKeyPaths: Set<string>;
|
|
31
|
+
candidates: string[];
|
|
32
|
+
excludedUncertain: number;
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* Pure cleanup application: remove candidate key paths from one locale JSON object.
|
|
37
|
+
*/
|
|
38
|
+
declare function applyCleanupKeysToLocaleJson(localeJson: unknown, keysToRemove: readonly string[]): {
|
|
39
|
+
next: unknown;
|
|
40
|
+
removedPaths: string[];
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
declare function createCleanupSourceWritePlan(ctx: CoreContext, keysToRemove: readonly string[]): CleanupWritePlan;
|
|
44
|
+
declare function writeCleanupPlan(ctx: CoreContext, plan: CleanupWritePlan): void;
|
|
45
|
+
declare function emitCleanupAbortMessage(host: Pick<CleanupHostHooks, 'emit' | 'runId'>, reason: 'no_keys_approved' | 'declined_confirmation'): void;
|
|
46
|
+
declare function emitCleanupAskIgnoredMessage(host: Pick<CleanupHostHooks, 'emit' | 'runId'>): void;
|
|
47
|
+
declare function emitCleanupWriteIntro(host: Pick<CleanupHostHooks, 'emit' | 'runId'>, input: {
|
|
48
|
+
removeCount: number;
|
|
49
|
+
segmentFileCount: number;
|
|
50
|
+
}): void;
|
|
51
|
+
declare function emitCleanupWriteDone(host: Pick<CleanupHostHooks, 'emit' | 'runId'>, input: {
|
|
52
|
+
plan: CleanupWritePlan;
|
|
53
|
+
wrote: boolean;
|
|
54
|
+
}): void;
|
|
55
|
+
declare function runCleanup(ctx: CoreContext, opts: CleanupRunOptions, host: CleanupHostHooks): CleanupRunResult;
|
|
56
|
+
|
|
57
|
+
/** All string leaves for the configured source locale (one file or merged multi-segment layout). */
|
|
58
|
+
declare function readCleanupSourceLeaves(ctx: CoreContext): TranslationSurfaceLeaf[];
|
|
59
|
+
/** Source-locale segment files (flat_file → one path). */
|
|
60
|
+
declare function listCleanupSourceSegmentPaths(ctx: CoreContext): CleanupSourceSegmentRef[];
|
|
61
|
+
/** Segment files that contain at least one of the given key paths on disk. */
|
|
62
|
+
declare function listCleanupSourceSegmentsForKeys(ctx: CoreContext, keys: readonly string[]): CleanupSourceSegmentRef[];
|
|
63
|
+
|
|
64
|
+
export { type CleanupCandidateInput, CleanupHostHooks, CleanupRunOptions, CleanupRunResult, CleanupSourceSegmentRef, CleanupWritePlan, applyCleanupKeysToLocaleJson, computeCleanupCandidateKeys, createCleanupSourceWritePlan, emitCleanupAbortMessage, emitCleanupAskIgnoredMessage, emitCleanupWriteDone, emitCleanupWriteIntro, listCleanupSourceSegmentPaths, listCleanupSourceSegmentsForKeys, pathUnderRoot, readCleanupSourceLeaves, runCleanup, writeCleanupPlan };
|