med-pdf-nmo 0.1.0 → 0.1.2

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 CHANGED
@@ -157,6 +157,7 @@ const result = await answerQuestion(pdf, {
157
157
  - `mode`: alias for `type`.
158
158
  - `cacheKey`: optional PDF text cache key.
159
159
  - `pdfjsLib`: optional explicit PDF.js module override.
160
+ - `pdfVerbosity`: optional PDF.js logging level. By default only PDF.js errors are shown, so non-fatal font warnings such as `TT: undefined function` are suppressed.
160
161
 
161
162
  Variants can be plain strings:
162
163
 
package/README.ru.md CHANGED
@@ -157,6 +157,7 @@ const result = await answerQuestion(pdf, {
157
157
  - `mode`: алиас для `type`.
158
158
  - `cacheKey`: необязательный ключ кеша для текста PDF.
159
159
  - `pdfjsLib`: необязательная явная передача PDF.js модуля.
160
+ - `pdfVerbosity`: необязательный уровень логирования PDF.js. По умолчанию показываются только ошибки PDF.js, поэтому нефатальные font warnings вроде `TT: undefined function` подавляются.
160
161
 
161
162
  Варианты можно передавать строками:
162
163
 
package/dist/index.d.ts CHANGED
@@ -41,6 +41,8 @@ export interface AnswerQuestionOptions {
41
41
  cacheKey?: string;
42
42
  /** Явно переданный модуль PDF.js, полезно для браузерного окружения. */
43
43
  pdfjsLib?: any;
44
+ /** Уровень логирования PDF.js. По умолчанию показываются только ошибки. */
45
+ pdfVerbosity?: number;
44
46
  }
45
47
  /**
46
48
  * Высокоуровневый результат, который возвращает {@link answerQuestion}.
package/dist/index.js CHANGED
@@ -29,7 +29,7 @@ export async function answerQuestion(pdf, options = { question: "" }) {
29
29
  question: options.question,
30
30
  answers,
31
31
  mode: options.type ?? options.mode ?? "single",
32
- }, { pdfjsLib: options.pdfjsLib });
32
+ }, { pdfjsLib: options.pdfjsLib, pdfVerbosity: options.pdfVerbosity });
33
33
  const selectedAnswers = output.selected
34
34
  .map((id) => answers.find((answer) => answer.id === id))
35
35
  .filter(Boolean);