@dragon708/docmind-browser 0.1.0-alpha.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 +14 -0
- package/dist/index.js +17 -0
- package/dist/index.js.map +1 -0
- package/package.json +42 -0
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { AnalyzeOptions, AnalysisResult } from '@dragon708/docmind-core';
|
|
2
|
+
export { AnalysisAnalyzer, AnalysisResult, AnalyzeOptions, DetectFileKindInput, FileKind, FileKindMetadata, GenericAnalysisResult, TextAnalysisResult } from '@dragon708/docmind-core';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Inputs supported by the browser entry (DOM types only — no `fs`, no Node `Buffer` in the public surface).
|
|
6
|
+
* For richer hints (`NamedInput`, etc.), import `analyzeFile` from the `core` package directly.
|
|
7
|
+
*/
|
|
8
|
+
type BrowserAnalyzeInput = File | Blob | ArrayBuffer;
|
|
9
|
+
/**
|
|
10
|
+
* Thin wrapper around `@dragon708/docmind-core`’s `analyzeFile` for browser runtimes.
|
|
11
|
+
*/
|
|
12
|
+
declare function analyzeFile(input: BrowserAnalyzeInput, options?: AnalyzeOptions): Promise<AnalysisResult>;
|
|
13
|
+
|
|
14
|
+
export { type BrowserAnalyzeInput, analyzeFile };
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { analyzeFile as analyzeFile$1, InvalidInputError } from '@dragon708/docmind-core';
|
|
2
|
+
|
|
3
|
+
// src/analyzeFile.ts
|
|
4
|
+
function assertBrowserInput(input) {
|
|
5
|
+
const ok = input instanceof File || input instanceof Blob || input instanceof ArrayBuffer;
|
|
6
|
+
if (!ok) {
|
|
7
|
+
throw new InvalidInputError("Expected a File, Blob, or ArrayBuffer.");
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
async function analyzeFile(input, options) {
|
|
11
|
+
assertBrowserInput(input);
|
|
12
|
+
return analyzeFile$1(input, options);
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export { analyzeFile };
|
|
16
|
+
//# sourceMappingURL=index.js.map
|
|
17
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/analyzeFile.ts"],"names":["analyzeWithCore"],"mappings":";;;AASA,SAAS,mBAAmB,KAAA,EAAsD;AAChF,EAAA,MAAM,EAAA,GACJ,KAAA,YAAiB,IAAA,IACjB,KAAA,YAAiB,QACjB,KAAA,YAAiB,WAAA;AACnB,EAAA,IAAI,CAAC,EAAA,EAAI;AACP,IAAA,MAAM,IAAI,kBAAkB,wCAAwC,CAAA;AAAA,EACtE;AACF;AAKA,eAAsB,WAAA,CACpB,OACA,OAAA,EACyB;AACzB,EAAA,kBAAA,CAAmB,KAAK,CAAA;AACxB,EAAA,OAAOA,aAAA,CAAgB,OAAO,OAAO,CAAA;AACvC","file":"index.js","sourcesContent":["import { analyzeFile as analyzeWithCore, InvalidInputError } from \"@dragon708/docmind-core\";\r\nimport type { AnalyzeOptions, AnalysisResult } from \"@dragon708/docmind-core\";\r\n\r\n/**\r\n * Inputs supported by the browser entry (DOM types only — no `fs`, no Node `Buffer` in the public surface).\r\n * For richer hints (`NamedInput`, etc.), import `analyzeFile` from the `core` package directly.\r\n */\r\nexport type BrowserAnalyzeInput = File | Blob | ArrayBuffer;\r\n\r\nfunction assertBrowserInput(input: unknown): asserts input is BrowserAnalyzeInput {\r\n const ok =\r\n input instanceof File ||\r\n input instanceof Blob ||\r\n input instanceof ArrayBuffer;\r\n if (!ok) {\r\n throw new InvalidInputError(\"Expected a File, Blob, or ArrayBuffer.\");\r\n }\r\n}\r\n\r\n/**\r\n * Thin wrapper around `@dragon708/docmind-core`’s `analyzeFile` for browser runtimes.\r\n */\r\nexport async function analyzeFile(\r\n input: BrowserAnalyzeInput,\r\n options?: AnalyzeOptions,\r\n): Promise<AnalysisResult> {\r\n assertBrowserInput(input);\r\n return analyzeWithCore(input, options);\r\n}\r\n"]}
|
package/package.json
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@dragon708/docmind-browser",
|
|
3
|
+
"version": "0.1.0-alpha.1",
|
|
4
|
+
"description": "Browser-safe DocMind entry (File, Blob, ArrayBuffer) delegating to core.",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"sideEffects": false,
|
|
7
|
+
"main": "./dist/index.js",
|
|
8
|
+
"module": "./dist/index.js",
|
|
9
|
+
"types": "./dist/index.d.ts",
|
|
10
|
+
"exports": {
|
|
11
|
+
".": {
|
|
12
|
+
"types": "./dist/index.d.ts",
|
|
13
|
+
"import": "./dist/index.js",
|
|
14
|
+
"default": "./dist/index.js"
|
|
15
|
+
}
|
|
16
|
+
},
|
|
17
|
+
"files": [
|
|
18
|
+
"dist"
|
|
19
|
+
],
|
|
20
|
+
"publishConfig": {
|
|
21
|
+
"access": "public"
|
|
22
|
+
},
|
|
23
|
+
"scripts": {
|
|
24
|
+
"build": "tsup",
|
|
25
|
+
"dev": "tsup --watch",
|
|
26
|
+
"test": "vitest run",
|
|
27
|
+
"clean": "node -e \"try{require('fs').rmSync('dist',{recursive:true,force:true})}catch(e){}\""
|
|
28
|
+
},
|
|
29
|
+
"keywords": [
|
|
30
|
+
"docmind",
|
|
31
|
+
"browser"
|
|
32
|
+
],
|
|
33
|
+
"license": "MIT",
|
|
34
|
+
"dependencies": {
|
|
35
|
+
"@dragon708/docmind-core": "^0.1.0-alpha.1"
|
|
36
|
+
},
|
|
37
|
+
"devDependencies": {
|
|
38
|
+
"@types/node": "^20.19.37",
|
|
39
|
+
"tsup": "^8.5.1",
|
|
40
|
+
"typescript": "^5.9.3"
|
|
41
|
+
}
|
|
42
|
+
}
|