taglib-wasm 0.4.10 → 0.5.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.
- package/dist/index.d.ts +24 -7
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +36 -1
- package/dist/src/constants.d.ts +1014 -69
- package/dist/src/constants.d.ts.map +1 -1
- package/dist/src/constants.js +450 -57
- package/dist/src/errors.d.ts +22 -10
- package/dist/src/errors.d.ts.map +1 -1
- package/dist/src/errors.js +44 -42
- package/dist/src/folder-api.d.ts +5 -2
- package/dist/src/folder-api.d.ts.map +1 -1
- package/dist/src/folder-api.js +141 -74
- package/dist/src/mod.d.ts +2 -0
- package/dist/src/mod.d.ts.map +1 -1
- package/dist/src/mod.js +9 -1
- package/dist/src/simple.d.ts +19 -0
- package/dist/src/simple.d.ts.map +1 -1
- package/dist/src/simple.js +40 -0
- package/dist/src/taglib.d.ts +67 -2
- package/dist/src/taglib.d.ts.map +1 -1
- package/dist/src/taglib.js +77 -1
- package/dist/src/worker-pool.d.ts +162 -0
- package/dist/src/worker-pool.d.ts.map +1 -0
- package/dist/src/worker-pool.js +248 -0
- package/dist/src/workers/taglib-worker.d.ts +8 -0
- package/dist/src/workers/taglib-worker.d.ts.map +1 -0
- package/dist/src/workers/taglib-worker.js +193 -0
- package/dist/taglib.wasm +0 -0
- package/package.json +14 -14
package/dist/index.d.ts
CHANGED
|
@@ -65,16 +65,22 @@ export { EnvironmentError, FileOperationError, InvalidFormatError, isEnvironment
|
|
|
65
65
|
* @see {@link readTagsBatch} - Read tags from multiple files efficiently
|
|
66
66
|
* @see {@link readPropertiesBatch} - Read properties from multiple files efficiently
|
|
67
67
|
* @see {@link readMetadataBatch} - Read complete metadata from multiple files efficiently
|
|
68
|
+
* @see {@link setWorkerPoolMode} - Enable/disable worker pool for Simple API
|
|
68
69
|
*/
|
|
69
|
-
export { addPicture, applyPictures, applyTags, type BatchOptions, type BatchResult, clearPictures, clearTags, findPictureByType, getCoverArt, getFormat, getPictureMetadata, isValidAudioFile, readMetadataBatch, readPictures, readProperties, readPropertiesBatch, readTags, readTagsBatch, replacePictureByType, setCoverArt, updateTags, } from "./src/simple.ts";
|
|
70
|
+
export { addPicture, applyPictures, applyTags, type BatchOptions, type BatchResult, clearPictures, clearTags, findPictureByType, getCoverArt, getFormat, getPictureMetadata, isValidAudioFile, readMetadataBatch, readPictures, readProperties, readPropertiesBatch, readTags, readTagsBatch, replacePictureByType, setCoverArt, setWorkerPoolMode, updateTags, } from "./src/simple.ts";
|
|
70
71
|
/**
|
|
71
|
-
*
|
|
72
|
-
* @see {@link
|
|
73
|
-
* @see {@link
|
|
74
|
-
* @see {@link
|
|
75
|
-
* @see {@link
|
|
72
|
+
* Enhanced property constants and utilities with rich metadata.
|
|
73
|
+
* @see {@link PROPERTIES} - Comprehensive property definitions with metadata
|
|
74
|
+
* @see {@link PropertyKey} - Type-safe property keys
|
|
75
|
+
* @see {@link PropertyValue} - Type-safe property values
|
|
76
|
+
* @see {@link isValidProperty} - Validate property keys
|
|
77
|
+
* @see {@link getPropertyMetadata} - Get property metadata
|
|
78
|
+
* @see {@link getAllPropertyKeys} - Get all valid property keys
|
|
79
|
+
* @see {@link getPropertiesByFormat} - Filter properties by format support
|
|
80
|
+
* @see {@link Tags} - Legacy tag name constants (deprecated)
|
|
81
|
+
* @see {@link FormatMappings} - Format-specific field mappings (deprecated)
|
|
76
82
|
*/
|
|
77
|
-
export { FormatMappings, getAllTagNames, isValidTagName, Tags, } from "./src/constants.ts";
|
|
83
|
+
export { FormatMappings, getAllProperties, getAllPropertyKeys, getAllTagNames, getPropertiesByFormat, getPropertyMetadata, isValidProperty, isValidTagName, PROPERTIES, Tags, } from "./src/constants.ts";
|
|
78
84
|
/**
|
|
79
85
|
* File I/O utilities for cover art operations.
|
|
80
86
|
* @see {@link exportCoverArt} - Export cover art to file
|
|
@@ -105,12 +111,23 @@ export { canvasToPicture, createPictureDownloadURL, createPictureGallery, dataUR
|
|
|
105
111
|
* @see {@link Tag} - Basic metadata structure
|
|
106
112
|
* @see {@link ExtendedTag} - Extended metadata with advanced fields
|
|
107
113
|
* @see {@link AudioProperties} - Audio technical properties
|
|
114
|
+
* @see {@link PropertyKey} - Type-safe property keys with autocomplete
|
|
115
|
+
* @see {@link PropertyValue} - Type-safe property values
|
|
108
116
|
*/
|
|
109
117
|
export type { AudioFormat, AudioProperties, ExtendedTag, FieldMapping, FileType, Picture, PropertyMap, Tag, TagName, } from "./src/types.ts";
|
|
118
|
+
export type { PropertyKey, PropertyValue } from "./src/constants.ts";
|
|
110
119
|
/**
|
|
111
120
|
* Enum exports
|
|
112
121
|
*/
|
|
113
122
|
export { PictureType } from "./src/types.ts";
|
|
123
|
+
/**
|
|
124
|
+
* Worker pool exports for parallel processing.
|
|
125
|
+
* @see {@link TagLibWorkerPool} - Worker pool for parallel file processing
|
|
126
|
+
* @see {@link getGlobalWorkerPool} - Get/create global worker pool instance
|
|
127
|
+
* @see {@link terminateGlobalWorkerPool} - Terminate global worker pool
|
|
128
|
+
*/
|
|
129
|
+
export { getGlobalWorkerPool, TagLibWorkerPool, terminateGlobalWorkerPool, } from "./src/worker-pool.ts";
|
|
130
|
+
export type { BatchOperation, WorkerPoolOptions, WorkerTask, } from "./src/worker-pool.ts";
|
|
114
131
|
/**
|
|
115
132
|
* Wasm module types for advanced usage.
|
|
116
133
|
* @see {@link TagLibModule} - Full TagLib Wasm module interface
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AAEH;;;;;GAKG;AACH,OAAO,EACL,aAAa,IAAI,SAAS,EAC1B,YAAY,EACZ,MAAM,GACP,MAAM,iBAAiB,CAAC;AAEzB;;;;;;;;;;GAUG;AACH,OAAO,EACL,gBAAgB,EAChB,kBAAkB,EAClB,kBAAkB,EAClB,kBAAkB,EAClB,oBAAoB,EACpB,oBAAoB,EACpB,aAAa,EACb,eAAe,EACf,aAAa,EACb,wBAAwB,EACxB,WAAW,EACX,aAAa,EACb,iBAAiB,EACjB,WAAW,EACX,yBAAyB,EACzB,sBAAsB,GACvB,MAAM,iBAAiB,CAAC;AAEzB
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AAEH;;;;;GAKG;AACH,OAAO,EACL,aAAa,IAAI,SAAS,EAC1B,YAAY,EACZ,MAAM,GACP,MAAM,iBAAiB,CAAC;AAEzB;;;;;;;;;;GAUG;AACH,OAAO,EACL,gBAAgB,EAChB,kBAAkB,EAClB,kBAAkB,EAClB,kBAAkB,EAClB,oBAAoB,EACpB,oBAAoB,EACpB,aAAa,EACb,eAAe,EACf,aAAa,EACb,wBAAwB,EACxB,WAAW,EACX,aAAa,EACb,iBAAiB,EACjB,WAAW,EACX,yBAAyB,EACzB,sBAAsB,GACvB,MAAM,iBAAiB,CAAC;AAEzB;;;;;;;;;;;;;;;GAeG;AACH,OAAO,EACL,UAAU,EACV,aAAa,EACb,SAAS,EACT,KAAK,YAAY,EACjB,KAAK,WAAW,EAChB,aAAa,EACb,SAAS,EACT,iBAAiB,EACjB,WAAW,EACX,SAAS,EACT,kBAAkB,EAClB,gBAAgB,EAChB,iBAAiB,EACjB,YAAY,EACZ,cAAc,EACd,mBAAmB,EACnB,QAAQ,EACR,aAAa,EACb,oBAAoB,EACpB,WAAW,EACX,iBAAiB,EACjB,UAAU,GACX,MAAM,iBAAiB,CAAC;AAEzB;;;;;;;;;;;GAWG;AACH,OAAO,EACL,cAAc,EACd,gBAAgB,EAChB,kBAAkB,EAClB,cAAc,EACd,qBAAqB,EACrB,mBAAmB,EACnB,eAAe,EACf,cAAc,EACd,UAAU,EACV,IAAI,GACL,MAAM,oBAAoB,CAAC;AAC5B;;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AC;CAClB;AAED;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,wBAAsB,gBAAgB,CACpC,OAAO,CAAC,EAAE,iBAAiB,GAC1B,OAAO,CAAC,YAAY,CAAC,CA2CvB"}
|
package/dist/index.js
CHANGED
|
@@ -41,12 +41,19 @@ import {
|
|
|
41
41
|
readTagsBatch,
|
|
42
42
|
replacePictureByType,
|
|
43
43
|
setCoverArt,
|
|
44
|
+
setWorkerPoolMode,
|
|
44
45
|
updateTags
|
|
45
46
|
} from "./src/simple.js";
|
|
46
47
|
import {
|
|
47
48
|
FormatMappings,
|
|
49
|
+
getAllProperties,
|
|
50
|
+
getAllPropertyKeys,
|
|
48
51
|
getAllTagNames,
|
|
52
|
+
getPropertiesByFormat,
|
|
53
|
+
getPropertyMetadata,
|
|
54
|
+
isValidProperty,
|
|
49
55
|
isValidTagName,
|
|
56
|
+
PROPERTIES,
|
|
50
57
|
Tags
|
|
51
58
|
} from "./src/constants.js";
|
|
52
59
|
import {
|
|
@@ -77,8 +84,26 @@ import {
|
|
|
77
84
|
setCoverArtFromCanvas
|
|
78
85
|
} from "./src/web-utils.js";
|
|
79
86
|
import { PictureType } from "./src/types.js";
|
|
87
|
+
import {
|
|
88
|
+
getGlobalWorkerPool,
|
|
89
|
+
TagLibWorkerPool,
|
|
90
|
+
terminateGlobalWorkerPool
|
|
91
|
+
} from "./src/worker-pool.js";
|
|
80
92
|
async function loadTagLibModule(options) {
|
|
81
|
-
|
|
93
|
+
let createTagLibModule;
|
|
94
|
+
try {
|
|
95
|
+
const module2 = await import("./taglib-wrapper.js");
|
|
96
|
+
createTagLibModule = module2.default;
|
|
97
|
+
} catch {
|
|
98
|
+
try {
|
|
99
|
+
const module2 = await import("./dist/taglib-wrapper.js");
|
|
100
|
+
createTagLibModule = module2.default;
|
|
101
|
+
} catch {
|
|
102
|
+
throw new Error(
|
|
103
|
+
"Could not load taglib-wrapper.js from either ./build or ./dist"
|
|
104
|
+
);
|
|
105
|
+
}
|
|
106
|
+
}
|
|
82
107
|
const moduleConfig = {};
|
|
83
108
|
if (options?.wasmBinary) {
|
|
84
109
|
moduleConfig.wasmBinary = options.wasmBinary;
|
|
@@ -102,11 +127,13 @@ export {
|
|
|
102
127
|
InvalidFormatError,
|
|
103
128
|
MemoryError,
|
|
104
129
|
MetadataError,
|
|
130
|
+
PROPERTIES,
|
|
105
131
|
PictureType,
|
|
106
132
|
SUPPORTED_FORMATS,
|
|
107
133
|
TagLib,
|
|
108
134
|
TagLibError,
|
|
109
135
|
TagLibInitializationError,
|
|
136
|
+
TagLibWorkerPool,
|
|
110
137
|
Tags,
|
|
111
138
|
UnsupportedFormatError,
|
|
112
139
|
addPicture,
|
|
@@ -128,10 +155,15 @@ export {
|
|
|
128
155
|
findCoverArtFiles,
|
|
129
156
|
findDuplicates,
|
|
130
157
|
findPictureByType,
|
|
158
|
+
getAllProperties,
|
|
159
|
+
getAllPropertyKeys,
|
|
131
160
|
getAllTagNames,
|
|
132
161
|
getCoverArt,
|
|
133
162
|
getFormat,
|
|
163
|
+
getGlobalWorkerPool,
|
|
134
164
|
getPictureMetadata,
|
|
165
|
+
getPropertiesByFormat,
|
|
166
|
+
getPropertyMetadata,
|
|
135
167
|
imageFileToPicture,
|
|
136
168
|
importCoverArt,
|
|
137
169
|
importPictureWithType,
|
|
@@ -143,6 +175,7 @@ export {
|
|
|
143
175
|
isTagLibError,
|
|
144
176
|
isUnsupportedFormatError,
|
|
145
177
|
isValidAudioFile,
|
|
178
|
+
isValidProperty,
|
|
146
179
|
isValidTagName,
|
|
147
180
|
loadPictureFromFile,
|
|
148
181
|
loadTagLibModule,
|
|
@@ -158,6 +191,8 @@ export {
|
|
|
158
191
|
scanFolder,
|
|
159
192
|
setCoverArt,
|
|
160
193
|
setCoverArtFromCanvas,
|
|
194
|
+
setWorkerPoolMode,
|
|
195
|
+
terminateGlobalWorkerPool,
|
|
161
196
|
updateFolderTags,
|
|
162
197
|
updateTags
|
|
163
198
|
};
|