@willwade/aac-processors 0.0.30 → 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/README.md +52 -852
- package/dist/browser/core/baseProcessor.js +241 -0
- package/dist/browser/core/stringCasing.js +179 -0
- package/dist/browser/core/treeStructure.js +255 -0
- package/dist/browser/index.browser.js +73 -0
- package/dist/browser/processors/applePanelsProcessor.js +582 -0
- package/dist/browser/processors/astericsGridProcessor.js +1509 -0
- package/dist/browser/processors/dotProcessor.js +221 -0
- package/dist/browser/processors/gridset/commands.js +962 -0
- package/dist/browser/processors/gridset/crypto.js +53 -0
- package/dist/browser/processors/gridset/password.js +43 -0
- package/dist/browser/processors/gridset/pluginTypes.js +277 -0
- package/dist/browser/processors/gridset/resolver.js +137 -0
- package/dist/browser/processors/gridset/symbolAlignment.js +276 -0
- package/dist/browser/processors/gridset/symbols.js +421 -0
- package/dist/browser/processors/gridsetProcessor.js +2002 -0
- package/dist/browser/processors/obfProcessor.js +705 -0
- package/dist/browser/processors/opmlProcessor.js +274 -0
- package/dist/browser/types/aac.js +38 -0
- package/dist/browser/utilities/analytics/utils/idGenerator.js +89 -0
- package/dist/browser/utilities/translation/translationProcessor.js +200 -0
- package/dist/browser/utils/io.js +95 -0
- package/dist/browser/validation/baseValidator.js +156 -0
- package/dist/browser/validation/gridsetValidator.js +355 -0
- package/dist/browser/validation/obfValidator.js +500 -0
- package/dist/browser/validation/validationTypes.js +46 -0
- package/dist/cli/index.js +5 -5
- package/dist/core/analyze.d.ts +2 -2
- package/dist/core/analyze.js +2 -2
- package/dist/core/baseProcessor.d.ts +5 -4
- package/dist/core/baseProcessor.js +22 -27
- package/dist/core/treeStructure.d.ts +5 -5
- package/dist/core/treeStructure.js +1 -4
- package/dist/index.browser.d.ts +37 -0
- package/dist/index.browser.js +99 -0
- package/dist/index.d.ts +1 -48
- package/dist/index.js +1 -136
- package/dist/index.node.d.ts +48 -0
- package/dist/index.node.js +152 -0
- package/dist/processors/applePanelsProcessor.d.ts +5 -4
- package/dist/processors/applePanelsProcessor.js +58 -62
- package/dist/processors/astericsGridProcessor.d.ts +7 -6
- package/dist/processors/astericsGridProcessor.js +31 -42
- package/dist/processors/dotProcessor.d.ts +5 -4
- package/dist/processors/dotProcessor.js +25 -33
- package/dist/processors/excelProcessor.d.ts +4 -3
- package/dist/processors/excelProcessor.js +6 -3
- package/dist/processors/gridset/crypto.d.ts +18 -0
- package/dist/processors/gridset/crypto.js +57 -0
- package/dist/processors/gridset/helpers.d.ts +1 -1
- package/dist/processors/gridset/helpers.js +18 -8
- package/dist/processors/gridset/password.d.ts +20 -3
- package/dist/processors/gridset/password.js +17 -3
- package/dist/processors/gridset/wordlistHelpers.d.ts +3 -3
- package/dist/processors/gridset/wordlistHelpers.js +21 -20
- package/dist/processors/gridsetProcessor.d.ts +7 -12
- package/dist/processors/gridsetProcessor.js +116 -77
- package/dist/processors/obfProcessor.d.ts +9 -7
- package/dist/processors/obfProcessor.js +131 -56
- package/dist/processors/obfsetProcessor.d.ts +5 -4
- package/dist/processors/obfsetProcessor.js +10 -16
- package/dist/processors/opmlProcessor.d.ts +5 -4
- package/dist/processors/opmlProcessor.js +27 -34
- package/dist/processors/snapProcessor.d.ts +8 -7
- package/dist/processors/snapProcessor.js +15 -12
- package/dist/processors/touchchatProcessor.d.ts +8 -7
- package/dist/processors/touchchatProcessor.js +22 -17
- package/dist/types/aac.d.ts +0 -2
- package/dist/types/aac.js +2 -0
- package/dist/utils/io.d.ts +12 -0
- package/dist/utils/io.js +107 -0
- package/dist/validation/gridsetValidator.js +7 -7
- package/dist/validation/snapValidator.js +28 -35
- package/docs/BROWSER_USAGE.md +618 -0
- package/examples/README.md +77 -0
- package/examples/browser-test-server.js +81 -0
- package/examples/browser-test.html +331 -0
- package/examples/vitedemo/QUICKSTART.md +74 -0
- package/examples/vitedemo/README.md +157 -0
- package/examples/vitedemo/index.html +376 -0
- package/examples/vitedemo/package-lock.json +1221 -0
- package/examples/vitedemo/package.json +18 -0
- package/examples/vitedemo/src/main.ts +519 -0
- package/examples/vitedemo/test-files/example.dot +14 -0
- package/examples/vitedemo/test-files/example.grd +1 -0
- package/examples/vitedemo/test-files/example.gridset +0 -0
- package/examples/vitedemo/test-files/example.obz +0 -0
- package/examples/vitedemo/test-files/example.opml +18 -0
- package/examples/vitedemo/test-files/simple.obf +53 -0
- package/examples/vitedemo/tsconfig.json +24 -0
- package/examples/vitedemo/vite.config.ts +34 -0
- package/package.json +20 -4
|
@@ -119,9 +119,9 @@ class BaseProcessor {
|
|
|
119
119
|
* @param filePath - Path to the AAC file
|
|
120
120
|
* @returns Promise with extracted strings and metadata
|
|
121
121
|
*/
|
|
122
|
-
extractStringsWithMetadataGeneric(filePath) {
|
|
122
|
+
async extractStringsWithMetadataGeneric(filePath) {
|
|
123
123
|
try {
|
|
124
|
-
const tree = this.loadIntoTree(filePath);
|
|
124
|
+
const tree = await this.loadIntoTree(filePath);
|
|
125
125
|
const extractedMap = new Map();
|
|
126
126
|
// Process all pages and buttons
|
|
127
127
|
Object.values(tree.pages).forEach((page) => {
|
|
@@ -165,10 +165,10 @@ class BaseProcessor {
|
|
|
165
165
|
});
|
|
166
166
|
});
|
|
167
167
|
const extractedStrings = Array.from(extractedMap.values());
|
|
168
|
-
return
|
|
168
|
+
return { errors: [], extractedStrings };
|
|
169
169
|
}
|
|
170
170
|
catch (error) {
|
|
171
|
-
return
|
|
171
|
+
return {
|
|
172
172
|
errors: [
|
|
173
173
|
{
|
|
174
174
|
message: error instanceof Error ? error.message : 'Unknown extraction error',
|
|
@@ -176,7 +176,7 @@ class BaseProcessor {
|
|
|
176
176
|
},
|
|
177
177
|
],
|
|
178
178
|
extractedStrings: [],
|
|
179
|
-
}
|
|
179
|
+
};
|
|
180
180
|
}
|
|
181
181
|
}
|
|
182
182
|
/**
|
|
@@ -187,28 +187,23 @@ class BaseProcessor {
|
|
|
187
187
|
* @param sourceStrings - Array of source string data
|
|
188
188
|
* @returns Promise with path to the generated translated file
|
|
189
189
|
*/
|
|
190
|
-
generateTranslatedDownloadGeneric(filePath, translatedStrings, sourceStrings) {
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
return Promise.resolve(outputPath);
|
|
208
|
-
}
|
|
209
|
-
catch (error) {
|
|
210
|
-
return Promise.reject(new Error(`Failed to generate translated download: ${error instanceof Error ? error.message : 'Unknown error'}`));
|
|
211
|
-
}
|
|
190
|
+
async generateTranslatedDownloadGeneric(filePath, translatedStrings, sourceStrings) {
|
|
191
|
+
// Build translation map from the provided data
|
|
192
|
+
const translations = new Map();
|
|
193
|
+
sourceStrings.forEach((sourceString) => {
|
|
194
|
+
const translated = translatedStrings.find((ts) => ts.sourcestringid.toString() === sourceString.id.toString());
|
|
195
|
+
if (translated) {
|
|
196
|
+
const translatedText = translated.overridestring.length > 0
|
|
197
|
+
? translated.overridestring
|
|
198
|
+
: translated.translatedstring;
|
|
199
|
+
translations.set(sourceString.sourcestring, translatedText);
|
|
200
|
+
}
|
|
201
|
+
});
|
|
202
|
+
// Generate output path based on file extension
|
|
203
|
+
const outputPath = this.generateTranslatedOutputPath(filePath);
|
|
204
|
+
// Use existing processTexts method (now async)
|
|
205
|
+
await this.processTexts(filePath, translations, outputPath);
|
|
206
|
+
return outputPath;
|
|
212
207
|
}
|
|
213
208
|
/**
|
|
214
209
|
* Helper method to add extracted strings to the map, handling duplicates
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export { AACTreeMetadata, SnapMetadata, GridSetMetadata, AstericsGridMetadata, TouchChatMetadata, CellScanningOrder, ScanningSelectionMethod, };
|
|
1
|
+
import type { AACStyle, AACTreeMetadata, SnapMetadata, GridSetMetadata, AstericsGridMetadata, TouchChatMetadata, CellScanningOrder, ScanningSelectionMethod } from '../types/aac';
|
|
2
|
+
export type { AACStyle, AACTreeMetadata, SnapMetadata, GridSetMetadata, AstericsGridMetadata, TouchChatMetadata, CellScanningOrder, ScanningSelectionMethod, };
|
|
3
3
|
export declare enum AACSemanticCategory {
|
|
4
4
|
COMMUNICATION = "communication",// Speech, text output
|
|
5
5
|
NAVIGATION = "navigation",// Page/grid navigation
|
|
@@ -108,7 +108,7 @@ export interface AACSemanticAction {
|
|
|
108
108
|
add_to_sentence?: boolean;
|
|
109
109
|
};
|
|
110
110
|
}
|
|
111
|
-
export declare class AACButton
|
|
111
|
+
export declare class AACButton {
|
|
112
112
|
id: string;
|
|
113
113
|
label: string;
|
|
114
114
|
message: string;
|
|
@@ -195,7 +195,7 @@ export declare class AACButton implements IAACButton {
|
|
|
195
195
|
message?: string;
|
|
196
196
|
} | null;
|
|
197
197
|
}
|
|
198
|
-
export declare class AACPage
|
|
198
|
+
export declare class AACPage {
|
|
199
199
|
id: string;
|
|
200
200
|
name: string;
|
|
201
201
|
grid: Array<Array<AACButton | null>>;
|
|
@@ -233,7 +233,7 @@ export declare class AACPage implements IAACPage {
|
|
|
233
233
|
});
|
|
234
234
|
addButton(button: AACButton): void;
|
|
235
235
|
}
|
|
236
|
-
export declare class AACTree
|
|
236
|
+
export declare class AACTree {
|
|
237
237
|
pages: {
|
|
238
238
|
[key: string]: AACPage;
|
|
239
239
|
};
|
|
@@ -1,9 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.AACTree = exports.AACPage = exports.AACButton = exports.AACScanType = exports.AACSemanticIntent = exports.AACSemanticCategory =
|
|
4
|
-
const aac_1 = require("../types/aac");
|
|
5
|
-
Object.defineProperty(exports, "CellScanningOrder", { enumerable: true, get: function () { return aac_1.CellScanningOrder; } });
|
|
6
|
-
Object.defineProperty(exports, "ScanningSelectionMethod", { enumerable: true, get: function () { return aac_1.ScanningSelectionMethod; } });
|
|
3
|
+
exports.AACTree = exports.AACPage = exports.AACButton = exports.AACScanType = exports.AACSemanticIntent = exports.AACSemanticCategory = void 0;
|
|
7
4
|
// Semantic action categories for cross-platform compatibility
|
|
8
5
|
var AACSemanticCategory;
|
|
9
6
|
(function (AACSemanticCategory) {
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* AACProcessors Browser Entry
|
|
3
|
+
*
|
|
4
|
+
* Browser-safe exports only (no Node-only dependencies).
|
|
5
|
+
*
|
|
6
|
+
* **NOTE: Gridset .gridsetx files**
|
|
7
|
+
* GridsetProcessor supports regular `.gridset` files in browser.
|
|
8
|
+
* Encrypted `.gridsetx` files require Node.js for crypto operations and are not supported in browser.
|
|
9
|
+
*/
|
|
10
|
+
export * from './core/treeStructure';
|
|
11
|
+
export * from './core/baseProcessor';
|
|
12
|
+
export * from './core/stringCasing';
|
|
13
|
+
export { DotProcessor } from './processors/dotProcessor';
|
|
14
|
+
export { OpmlProcessor } from './processors/opmlProcessor';
|
|
15
|
+
export { ObfProcessor } from './processors/obfProcessor';
|
|
16
|
+
export { GridsetProcessor } from './processors/gridsetProcessor';
|
|
17
|
+
export { ApplePanelsProcessor } from './processors/applePanelsProcessor';
|
|
18
|
+
export { AstericsGridProcessor } from './processors/astericsGridProcessor';
|
|
19
|
+
import { BaseProcessor } from './core/baseProcessor';
|
|
20
|
+
/**
|
|
21
|
+
* Factory function to get the appropriate processor for a file extension
|
|
22
|
+
* @param filePathOrExtension - File path or extension (e.g., '.dot', '/path/to/file.obf')
|
|
23
|
+
* @returns The appropriate processor instance
|
|
24
|
+
* @throws Error if the file extension is not supported
|
|
25
|
+
*/
|
|
26
|
+
export declare function getProcessor(filePathOrExtension: string): BaseProcessor;
|
|
27
|
+
/**
|
|
28
|
+
* Get all supported file extensions
|
|
29
|
+
* @returns Array of supported file extensions
|
|
30
|
+
*/
|
|
31
|
+
export declare function getSupportedExtensions(): string[];
|
|
32
|
+
/**
|
|
33
|
+
* Check if a file extension is supported
|
|
34
|
+
* @param extension - File extension to check
|
|
35
|
+
* @returns True if the extension is supported
|
|
36
|
+
*/
|
|
37
|
+
export declare function isExtensionSupported(extension: string): boolean;
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* AACProcessors Browser Entry
|
|
4
|
+
*
|
|
5
|
+
* Browser-safe exports only (no Node-only dependencies).
|
|
6
|
+
*
|
|
7
|
+
* **NOTE: Gridset .gridsetx files**
|
|
8
|
+
* GridsetProcessor supports regular `.gridset` files in browser.
|
|
9
|
+
* Encrypted `.gridsetx` files require Node.js for crypto operations and are not supported in browser.
|
|
10
|
+
*/
|
|
11
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
12
|
+
if (k2 === undefined) k2 = k;
|
|
13
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
14
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
15
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
16
|
+
}
|
|
17
|
+
Object.defineProperty(o, k2, desc);
|
|
18
|
+
}) : (function(o, m, k, k2) {
|
|
19
|
+
if (k2 === undefined) k2 = k;
|
|
20
|
+
o[k2] = m[k];
|
|
21
|
+
}));
|
|
22
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
23
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
24
|
+
};
|
|
25
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
exports.AstericsGridProcessor = exports.ApplePanelsProcessor = exports.GridsetProcessor = exports.ObfProcessor = exports.OpmlProcessor = exports.DotProcessor = void 0;
|
|
27
|
+
exports.getProcessor = getProcessor;
|
|
28
|
+
exports.getSupportedExtensions = getSupportedExtensions;
|
|
29
|
+
exports.isExtensionSupported = isExtensionSupported;
|
|
30
|
+
// ===================================================================
|
|
31
|
+
// CORE TYPES
|
|
32
|
+
// ===================================================================
|
|
33
|
+
__exportStar(require("./core/treeStructure"), exports);
|
|
34
|
+
__exportStar(require("./core/baseProcessor"), exports);
|
|
35
|
+
__exportStar(require("./core/stringCasing"), exports);
|
|
36
|
+
// ===================================================================
|
|
37
|
+
// BROWSER-SAFE PROCESSORS
|
|
38
|
+
// ===================================================================
|
|
39
|
+
var dotProcessor_1 = require("./processors/dotProcessor");
|
|
40
|
+
Object.defineProperty(exports, "DotProcessor", { enumerable: true, get: function () { return dotProcessor_1.DotProcessor; } });
|
|
41
|
+
var opmlProcessor_1 = require("./processors/opmlProcessor");
|
|
42
|
+
Object.defineProperty(exports, "OpmlProcessor", { enumerable: true, get: function () { return opmlProcessor_1.OpmlProcessor; } });
|
|
43
|
+
var obfProcessor_1 = require("./processors/obfProcessor");
|
|
44
|
+
Object.defineProperty(exports, "ObfProcessor", { enumerable: true, get: function () { return obfProcessor_1.ObfProcessor; } });
|
|
45
|
+
var gridsetProcessor_1 = require("./processors/gridsetProcessor");
|
|
46
|
+
Object.defineProperty(exports, "GridsetProcessor", { enumerable: true, get: function () { return gridsetProcessor_1.GridsetProcessor; } });
|
|
47
|
+
var applePanelsProcessor_1 = require("./processors/applePanelsProcessor");
|
|
48
|
+
Object.defineProperty(exports, "ApplePanelsProcessor", { enumerable: true, get: function () { return applePanelsProcessor_1.ApplePanelsProcessor; } });
|
|
49
|
+
var astericsGridProcessor_1 = require("./processors/astericsGridProcessor");
|
|
50
|
+
Object.defineProperty(exports, "AstericsGridProcessor", { enumerable: true, get: function () { return astericsGridProcessor_1.AstericsGridProcessor; } });
|
|
51
|
+
const dotProcessor_2 = require("./processors/dotProcessor");
|
|
52
|
+
const opmlProcessor_2 = require("./processors/opmlProcessor");
|
|
53
|
+
const obfProcessor_2 = require("./processors/obfProcessor");
|
|
54
|
+
const gridsetProcessor_2 = require("./processors/gridsetProcessor");
|
|
55
|
+
const applePanelsProcessor_2 = require("./processors/applePanelsProcessor");
|
|
56
|
+
const astericsGridProcessor_2 = require("./processors/astericsGridProcessor");
|
|
57
|
+
/**
|
|
58
|
+
* Factory function to get the appropriate processor for a file extension
|
|
59
|
+
* @param filePathOrExtension - File path or extension (e.g., '.dot', '/path/to/file.obf')
|
|
60
|
+
* @returns The appropriate processor instance
|
|
61
|
+
* @throws Error if the file extension is not supported
|
|
62
|
+
*/
|
|
63
|
+
function getProcessor(filePathOrExtension) {
|
|
64
|
+
const extension = filePathOrExtension.includes('.')
|
|
65
|
+
? filePathOrExtension.substring(filePathOrExtension.lastIndexOf('.'))
|
|
66
|
+
: filePathOrExtension;
|
|
67
|
+
switch (extension.toLowerCase()) {
|
|
68
|
+
case '.dot':
|
|
69
|
+
return new dotProcessor_2.DotProcessor();
|
|
70
|
+
case '.opml':
|
|
71
|
+
return new opmlProcessor_2.OpmlProcessor();
|
|
72
|
+
case '.obf':
|
|
73
|
+
case '.obz':
|
|
74
|
+
return new obfProcessor_2.ObfProcessor();
|
|
75
|
+
case '.gridset':
|
|
76
|
+
return new gridsetProcessor_2.GridsetProcessor();
|
|
77
|
+
case '.plist':
|
|
78
|
+
return new applePanelsProcessor_2.ApplePanelsProcessor();
|
|
79
|
+
case '.grd':
|
|
80
|
+
return new astericsGridProcessor_2.AstericsGridProcessor();
|
|
81
|
+
default:
|
|
82
|
+
throw new Error(`Unsupported file extension: ${extension}`);
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* Get all supported file extensions
|
|
87
|
+
* @returns Array of supported file extensions
|
|
88
|
+
*/
|
|
89
|
+
function getSupportedExtensions() {
|
|
90
|
+
return ['.dot', '.opml', '.obf', '.obz', '.gridset', '.plist', '.grd'];
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* Check if a file extension is supported
|
|
94
|
+
* @param extension - File extension to check
|
|
95
|
+
* @returns True if the extension is supported
|
|
96
|
+
*/
|
|
97
|
+
function isExtensionSupported(extension) {
|
|
98
|
+
return getSupportedExtensions().includes(extension.toLowerCase());
|
|
99
|
+
}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,48 +1 @@
|
|
|
1
|
-
|
|
2
|
-
* AACProcessors Library
|
|
3
|
-
*
|
|
4
|
-
* A comprehensive TypeScript library for processing AAC file formats.
|
|
5
|
-
*
|
|
6
|
-
* @module aac-processors
|
|
7
|
-
*/
|
|
8
|
-
export * from './core/treeStructure';
|
|
9
|
-
export * from './core/baseProcessor';
|
|
10
|
-
export * from './core/stringCasing';
|
|
11
|
-
export * from './processors';
|
|
12
|
-
export * as Analytics from './utilities/analytics';
|
|
13
|
-
export * from './utilities/analytics';
|
|
14
|
-
export * as Validation from './validation';
|
|
15
|
-
export * as Gridset from './gridset';
|
|
16
|
-
export * as Snap from './snap';
|
|
17
|
-
export * as OBF from './obf';
|
|
18
|
-
export * as Obfset from './obfset';
|
|
19
|
-
export * as TouchChat from './touchchat';
|
|
20
|
-
export * as Dot from './dot';
|
|
21
|
-
export * as Excel from './excel';
|
|
22
|
-
export * as Opml from './opml';
|
|
23
|
-
export * as ApplePanels from './applePanels';
|
|
24
|
-
export * as AstericsGrid from './astericsGrid';
|
|
25
|
-
export * as Translation from './translation';
|
|
26
|
-
import { BaseProcessor } from './core/baseProcessor';
|
|
27
|
-
/**
|
|
28
|
-
* Factory function to get the appropriate processor for a file extension
|
|
29
|
-
* @param filePathOrExtension - File path or extension (e.g., '.dot', '/path/to/file.obf')
|
|
30
|
-
* @returns The appropriate processor instance
|
|
31
|
-
* @throws Error if the file extension is not supported
|
|
32
|
-
*
|
|
33
|
-
* @example
|
|
34
|
-
* const processor = getProcessor('/path/to/file.gridset');
|
|
35
|
-
* const tree = processor.loadIntoTree('/path/to/file.gridset');
|
|
36
|
-
*/
|
|
37
|
-
export declare function getProcessor(filePathOrExtension: string): BaseProcessor;
|
|
38
|
-
/**
|
|
39
|
-
* Get all supported file extensions
|
|
40
|
-
* @returns Array of supported file extensions
|
|
41
|
-
*/
|
|
42
|
-
export declare function getSupportedExtensions(): string[];
|
|
43
|
-
/**
|
|
44
|
-
* Check if a file extension is supported
|
|
45
|
-
* @param extension - File extension to check
|
|
46
|
-
* @returns True if the extension is supported
|
|
47
|
-
*/
|
|
48
|
-
export declare function isExtensionSupported(extension: string): boolean;
|
|
1
|
+
export * from './index.node';
|
package/dist/index.js
CHANGED
|
@@ -1,11 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* AACProcessors Library
|
|
4
|
-
*
|
|
5
|
-
* A comprehensive TypeScript library for processing AAC file formats.
|
|
6
|
-
*
|
|
7
|
-
* @module aac-processors
|
|
8
|
-
*/
|
|
9
2
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
10
3
|
if (k2 === undefined) k2 = k;
|
|
11
4
|
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
@@ -17,136 +10,8 @@ var __createBinding = (this && this.__createBinding) || (Object.create ? (functi
|
|
|
17
10
|
if (k2 === undefined) k2 = k;
|
|
18
11
|
o[k2] = m[k];
|
|
19
12
|
}));
|
|
20
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
21
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
22
|
-
}) : function(o, v) {
|
|
23
|
-
o["default"] = v;
|
|
24
|
-
});
|
|
25
13
|
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
26
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
27
15
|
};
|
|
28
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
29
|
-
if (mod && mod.__esModule) return mod;
|
|
30
|
-
var result = {};
|
|
31
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
32
|
-
__setModuleDefault(result, mod);
|
|
33
|
-
return result;
|
|
34
|
-
};
|
|
35
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
-
|
|
37
|
-
exports.getProcessor = getProcessor;
|
|
38
|
-
exports.getSupportedExtensions = getSupportedExtensions;
|
|
39
|
-
exports.isExtensionSupported = isExtensionSupported;
|
|
40
|
-
// ===================================================================
|
|
41
|
-
// CORE TYPES (always needed)
|
|
42
|
-
// ===================================================================
|
|
43
|
-
__exportStar(require("./core/treeStructure"), exports);
|
|
44
|
-
__exportStar(require("./core/baseProcessor"), exports);
|
|
45
|
-
__exportStar(require("./core/stringCasing"), exports);
|
|
46
|
-
// ===================================================================
|
|
47
|
-
// PROCESSORS (main functionality)
|
|
48
|
-
// ===================================================================
|
|
49
|
-
__exportStar(require("./processors"), exports);
|
|
50
|
-
// ===================================================================
|
|
51
|
-
// NAMESPACES
|
|
52
|
-
// ===================================================================
|
|
53
|
-
// Analytics namespace
|
|
54
|
-
exports.Analytics = __importStar(require("./utilities/analytics"));
|
|
55
|
-
// Also export analytics classes directly for convenience
|
|
56
|
-
__exportStar(require("./utilities/analytics"), exports);
|
|
57
|
-
// Validation namespace
|
|
58
|
-
exports.Validation = __importStar(require("./validation"));
|
|
59
|
-
// Processor namespaces (platform-specific utilities)
|
|
60
|
-
exports.Gridset = __importStar(require("./gridset"));
|
|
61
|
-
exports.Snap = __importStar(require("./snap"));
|
|
62
|
-
exports.OBF = __importStar(require("./obf"));
|
|
63
|
-
exports.Obfset = __importStar(require("./obfset"));
|
|
64
|
-
exports.TouchChat = __importStar(require("./touchchat"));
|
|
65
|
-
exports.Dot = __importStar(require("./dot"));
|
|
66
|
-
exports.Excel = __importStar(require("./excel"));
|
|
67
|
-
exports.Opml = __importStar(require("./opml"));
|
|
68
|
-
exports.ApplePanels = __importStar(require("./applePanels"));
|
|
69
|
-
exports.AstericsGrid = __importStar(require("./astericsGrid"));
|
|
70
|
-
exports.Translation = __importStar(require("./translation"));
|
|
71
|
-
const dotProcessor_1 = require("./processors/dotProcessor");
|
|
72
|
-
const excelProcessor_1 = require("./processors/excelProcessor");
|
|
73
|
-
const opmlProcessor_1 = require("./processors/opmlProcessor");
|
|
74
|
-
const obfProcessor_1 = require("./processors/obfProcessor");
|
|
75
|
-
const gridsetProcessor_1 = require("./processors/gridsetProcessor");
|
|
76
|
-
const snapProcessor_1 = require("./processors/snapProcessor");
|
|
77
|
-
const touchchatProcessor_1 = require("./processors/touchchatProcessor");
|
|
78
|
-
const applePanelsProcessor_1 = require("./processors/applePanelsProcessor");
|
|
79
|
-
const astericsGridProcessor_1 = require("./processors/astericsGridProcessor");
|
|
80
|
-
const obfsetProcessor_1 = require("./processors/obfsetProcessor");
|
|
81
|
-
/**
|
|
82
|
-
* Factory function to get the appropriate processor for a file extension
|
|
83
|
-
* @param filePathOrExtension - File path or extension (e.g., '.dot', '/path/to/file.obf')
|
|
84
|
-
* @returns The appropriate processor instance
|
|
85
|
-
* @throws Error if the file extension is not supported
|
|
86
|
-
*
|
|
87
|
-
* @example
|
|
88
|
-
* const processor = getProcessor('/path/to/file.gridset');
|
|
89
|
-
* const tree = processor.loadIntoTree('/path/to/file.gridset');
|
|
90
|
-
*/
|
|
91
|
-
function getProcessor(filePathOrExtension) {
|
|
92
|
-
// Extract extension from file path
|
|
93
|
-
const extension = filePathOrExtension.includes('.')
|
|
94
|
-
? filePathOrExtension.substring(filePathOrExtension.lastIndexOf('.'))
|
|
95
|
-
: filePathOrExtension;
|
|
96
|
-
switch (extension.toLowerCase()) {
|
|
97
|
-
case '.dot':
|
|
98
|
-
return new dotProcessor_1.DotProcessor();
|
|
99
|
-
case '.xlsx':
|
|
100
|
-
return new excelProcessor_1.ExcelProcessor();
|
|
101
|
-
case '.opml':
|
|
102
|
-
return new opmlProcessor_1.OpmlProcessor();
|
|
103
|
-
case '.obf':
|
|
104
|
-
case '.obz':
|
|
105
|
-
return new obfProcessor_1.ObfProcessor();
|
|
106
|
-
case '.obfset':
|
|
107
|
-
return new obfsetProcessor_1.ObfsetProcessor();
|
|
108
|
-
case '.gridset':
|
|
109
|
-
case '.gridsetx':
|
|
110
|
-
return new gridsetProcessor_1.GridsetProcessor();
|
|
111
|
-
case '.spb':
|
|
112
|
-
case '.sps':
|
|
113
|
-
return new snapProcessor_1.SnapProcessor();
|
|
114
|
-
case '.ce':
|
|
115
|
-
return new touchchatProcessor_1.TouchChatProcessor();
|
|
116
|
-
case '.plist':
|
|
117
|
-
return new applePanelsProcessor_1.ApplePanelsProcessor();
|
|
118
|
-
case '.grd':
|
|
119
|
-
return new astericsGridProcessor_1.AstericsGridProcessor();
|
|
120
|
-
default:
|
|
121
|
-
throw new Error(`Unsupported file extension: ${extension}`);
|
|
122
|
-
}
|
|
123
|
-
}
|
|
124
|
-
/**
|
|
125
|
-
* Get all supported file extensions
|
|
126
|
-
* @returns Array of supported file extensions
|
|
127
|
-
*/
|
|
128
|
-
function getSupportedExtensions() {
|
|
129
|
-
return [
|
|
130
|
-
'.dot',
|
|
131
|
-
'.xlsx',
|
|
132
|
-
'.opml',
|
|
133
|
-
'.obf',
|
|
134
|
-
'.obz',
|
|
135
|
-
'.obfset',
|
|
136
|
-
'.gridset',
|
|
137
|
-
'.gridsetx',
|
|
138
|
-
'.spb',
|
|
139
|
-
'.sps',
|
|
140
|
-
'.ce',
|
|
141
|
-
'.plist',
|
|
142
|
-
'.grd',
|
|
143
|
-
];
|
|
144
|
-
}
|
|
145
|
-
/**
|
|
146
|
-
* Check if a file extension is supported
|
|
147
|
-
* @param extension - File extension to check
|
|
148
|
-
* @returns True if the extension is supported
|
|
149
|
-
*/
|
|
150
|
-
function isExtensionSupported(extension) {
|
|
151
|
-
return getSupportedExtensions().includes(extension.toLowerCase());
|
|
152
|
-
}
|
|
17
|
+
__exportStar(require("./index.node"), exports);
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* AACProcessors Library
|
|
3
|
+
*
|
|
4
|
+
* A comprehensive TypeScript library for processing AAC file formats.
|
|
5
|
+
*
|
|
6
|
+
* @module aac-processors
|
|
7
|
+
*/
|
|
8
|
+
export * from './core/treeStructure';
|
|
9
|
+
export * from './core/baseProcessor';
|
|
10
|
+
export * from './core/stringCasing';
|
|
11
|
+
export * from './processors';
|
|
12
|
+
export * as Analytics from './utilities/analytics';
|
|
13
|
+
export * from './utilities/analytics';
|
|
14
|
+
export * as Validation from './validation';
|
|
15
|
+
export * as Gridset from './gridset';
|
|
16
|
+
export * as Snap from './snap';
|
|
17
|
+
export * as OBF from './obf';
|
|
18
|
+
export * as Obfset from './obfset';
|
|
19
|
+
export * as TouchChat from './touchchat';
|
|
20
|
+
export * as Dot from './dot';
|
|
21
|
+
export * as Excel from './excel';
|
|
22
|
+
export * as Opml from './opml';
|
|
23
|
+
export * as ApplePanels from './applePanels';
|
|
24
|
+
export * as AstericsGrid from './astericsGrid';
|
|
25
|
+
export * as Translation from './translation';
|
|
26
|
+
import { BaseProcessor } from './core/baseProcessor';
|
|
27
|
+
/**
|
|
28
|
+
* Factory function to get the appropriate processor for a file extension
|
|
29
|
+
* @param filePathOrExtension - File path or extension (e.g., '.dot', '/path/to/file.obf')
|
|
30
|
+
* @returns The appropriate processor instance
|
|
31
|
+
* @throws Error if the file extension is not supported
|
|
32
|
+
*
|
|
33
|
+
* @example
|
|
34
|
+
* const processor = getProcessor('/path/to/file.gridset');
|
|
35
|
+
* const tree = processor.loadIntoTree('/path/to/file.gridset');
|
|
36
|
+
*/
|
|
37
|
+
export declare function getProcessor(filePathOrExtension: string): BaseProcessor;
|
|
38
|
+
/**
|
|
39
|
+
* Get all supported file extensions
|
|
40
|
+
* @returns Array of supported file extensions
|
|
41
|
+
*/
|
|
42
|
+
export declare function getSupportedExtensions(): string[];
|
|
43
|
+
/**
|
|
44
|
+
* Check if a file extension is supported
|
|
45
|
+
* @param extension - File extension to check
|
|
46
|
+
* @returns True if the extension is supported
|
|
47
|
+
*/
|
|
48
|
+
export declare function isExtensionSupported(extension: string): boolean;
|
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* AACProcessors Library
|
|
4
|
+
*
|
|
5
|
+
* A comprehensive TypeScript library for processing AAC file formats.
|
|
6
|
+
*
|
|
7
|
+
* @module aac-processors
|
|
8
|
+
*/
|
|
9
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
12
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
13
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
14
|
+
}
|
|
15
|
+
Object.defineProperty(o, k2, desc);
|
|
16
|
+
}) : (function(o, m, k, k2) {
|
|
17
|
+
if (k2 === undefined) k2 = k;
|
|
18
|
+
o[k2] = m[k];
|
|
19
|
+
}));
|
|
20
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
21
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
22
|
+
}) : function(o, v) {
|
|
23
|
+
o["default"] = v;
|
|
24
|
+
});
|
|
25
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
26
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
27
|
+
};
|
|
28
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
29
|
+
if (mod && mod.__esModule) return mod;
|
|
30
|
+
var result = {};
|
|
31
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
32
|
+
__setModuleDefault(result, mod);
|
|
33
|
+
return result;
|
|
34
|
+
};
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.Translation = exports.AstericsGrid = exports.ApplePanels = exports.Opml = exports.Excel = exports.Dot = exports.TouchChat = exports.Obfset = exports.OBF = exports.Snap = exports.Gridset = exports.Validation = exports.Analytics = void 0;
|
|
37
|
+
exports.getProcessor = getProcessor;
|
|
38
|
+
exports.getSupportedExtensions = getSupportedExtensions;
|
|
39
|
+
exports.isExtensionSupported = isExtensionSupported;
|
|
40
|
+
// ===================================================================
|
|
41
|
+
// CORE TYPES (always needed)
|
|
42
|
+
// ===================================================================
|
|
43
|
+
__exportStar(require("./core/treeStructure"), exports);
|
|
44
|
+
__exportStar(require("./core/baseProcessor"), exports);
|
|
45
|
+
__exportStar(require("./core/stringCasing"), exports);
|
|
46
|
+
// ===================================================================
|
|
47
|
+
// PROCESSORS (main functionality)
|
|
48
|
+
// ===================================================================
|
|
49
|
+
__exportStar(require("./processors"), exports);
|
|
50
|
+
// ===================================================================
|
|
51
|
+
// NAMESPACES
|
|
52
|
+
// ===================================================================
|
|
53
|
+
// Analytics namespace
|
|
54
|
+
exports.Analytics = __importStar(require("./utilities/analytics"));
|
|
55
|
+
// Also export analytics classes directly for convenience
|
|
56
|
+
__exportStar(require("./utilities/analytics"), exports);
|
|
57
|
+
// Validation namespace
|
|
58
|
+
exports.Validation = __importStar(require("./validation"));
|
|
59
|
+
// Processor namespaces (platform-specific utilities)
|
|
60
|
+
exports.Gridset = __importStar(require("./gridset"));
|
|
61
|
+
exports.Snap = __importStar(require("./snap"));
|
|
62
|
+
exports.OBF = __importStar(require("./obf"));
|
|
63
|
+
exports.Obfset = __importStar(require("./obfset"));
|
|
64
|
+
exports.TouchChat = __importStar(require("./touchchat"));
|
|
65
|
+
exports.Dot = __importStar(require("./dot"));
|
|
66
|
+
exports.Excel = __importStar(require("./excel"));
|
|
67
|
+
exports.Opml = __importStar(require("./opml"));
|
|
68
|
+
exports.ApplePanels = __importStar(require("./applePanels"));
|
|
69
|
+
exports.AstericsGrid = __importStar(require("./astericsGrid"));
|
|
70
|
+
exports.Translation = __importStar(require("./translation"));
|
|
71
|
+
const dotProcessor_1 = require("./processors/dotProcessor");
|
|
72
|
+
const excelProcessor_1 = require("./processors/excelProcessor");
|
|
73
|
+
const opmlProcessor_1 = require("./processors/opmlProcessor");
|
|
74
|
+
const obfProcessor_1 = require("./processors/obfProcessor");
|
|
75
|
+
const gridsetProcessor_1 = require("./processors/gridsetProcessor");
|
|
76
|
+
const snapProcessor_1 = require("./processors/snapProcessor");
|
|
77
|
+
const touchchatProcessor_1 = require("./processors/touchchatProcessor");
|
|
78
|
+
const applePanelsProcessor_1 = require("./processors/applePanelsProcessor");
|
|
79
|
+
const astericsGridProcessor_1 = require("./processors/astericsGridProcessor");
|
|
80
|
+
const obfsetProcessor_1 = require("./processors/obfsetProcessor");
|
|
81
|
+
/**
|
|
82
|
+
* Factory function to get the appropriate processor for a file extension
|
|
83
|
+
* @param filePathOrExtension - File path or extension (e.g., '.dot', '/path/to/file.obf')
|
|
84
|
+
* @returns The appropriate processor instance
|
|
85
|
+
* @throws Error if the file extension is not supported
|
|
86
|
+
*
|
|
87
|
+
* @example
|
|
88
|
+
* const processor = getProcessor('/path/to/file.gridset');
|
|
89
|
+
* const tree = processor.loadIntoTree('/path/to/file.gridset');
|
|
90
|
+
*/
|
|
91
|
+
function getProcessor(filePathOrExtension) {
|
|
92
|
+
// Extract extension from file path
|
|
93
|
+
const extension = filePathOrExtension.includes('.')
|
|
94
|
+
? filePathOrExtension.substring(filePathOrExtension.lastIndexOf('.'))
|
|
95
|
+
: filePathOrExtension;
|
|
96
|
+
switch (extension.toLowerCase()) {
|
|
97
|
+
case '.dot':
|
|
98
|
+
return new dotProcessor_1.DotProcessor();
|
|
99
|
+
case '.xlsx':
|
|
100
|
+
return new excelProcessor_1.ExcelProcessor();
|
|
101
|
+
case '.opml':
|
|
102
|
+
return new opmlProcessor_1.OpmlProcessor();
|
|
103
|
+
case '.obf':
|
|
104
|
+
case '.obz':
|
|
105
|
+
return new obfProcessor_1.ObfProcessor();
|
|
106
|
+
case '.obfset':
|
|
107
|
+
return new obfsetProcessor_1.ObfsetProcessor();
|
|
108
|
+
case '.gridset':
|
|
109
|
+
case '.gridsetx':
|
|
110
|
+
return new gridsetProcessor_1.GridsetProcessor();
|
|
111
|
+
case '.spb':
|
|
112
|
+
case '.sps':
|
|
113
|
+
return new snapProcessor_1.SnapProcessor();
|
|
114
|
+
case '.ce':
|
|
115
|
+
return new touchchatProcessor_1.TouchChatProcessor();
|
|
116
|
+
case '.plist':
|
|
117
|
+
return new applePanelsProcessor_1.ApplePanelsProcessor();
|
|
118
|
+
case '.grd':
|
|
119
|
+
return new astericsGridProcessor_1.AstericsGridProcessor();
|
|
120
|
+
default:
|
|
121
|
+
throw new Error(`Unsupported file extension: ${extension}`);
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
/**
|
|
125
|
+
* Get all supported file extensions
|
|
126
|
+
* @returns Array of supported file extensions
|
|
127
|
+
*/
|
|
128
|
+
function getSupportedExtensions() {
|
|
129
|
+
return [
|
|
130
|
+
'.dot',
|
|
131
|
+
'.xlsx',
|
|
132
|
+
'.opml',
|
|
133
|
+
'.obf',
|
|
134
|
+
'.obz',
|
|
135
|
+
'.obfset',
|
|
136
|
+
'.gridset',
|
|
137
|
+
'.gridsetx',
|
|
138
|
+
'.spb',
|
|
139
|
+
'.sps',
|
|
140
|
+
'.ce',
|
|
141
|
+
'.plist',
|
|
142
|
+
'.grd',
|
|
143
|
+
];
|
|
144
|
+
}
|
|
145
|
+
/**
|
|
146
|
+
* Check if a file extension is supported
|
|
147
|
+
* @param extension - File extension to check
|
|
148
|
+
* @returns True if the extension is supported
|
|
149
|
+
*/
|
|
150
|
+
function isExtensionSupported(extension) {
|
|
151
|
+
return getSupportedExtensions().includes(extension.toLowerCase());
|
|
152
|
+
}
|