@openpresentation/opf 0.16.0 → 0.18.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/README.md +16 -2
- package/dist/browser.js +38 -0
- package/dist/{catalog-refs-_anZs-Qz.d.ts → catalog-refs-BSfGELpt.d.ts} +1 -1
- package/dist/{catalog-schemas-BZCjgAxu.d.ts → catalog-schemas-CinPh5WA.d.ts} +1 -1
- package/dist/catalog.d.ts +2 -2
- package/dist/catalog.js +3 -23712
- package/dist/{chunk-BSYQDWT4.js → chunk-64YSJZDH.js} +28 -15
- package/dist/{chunk-WEDGVC5W.js → chunk-6WW2EDUW.js} +108 -108
- package/dist/{chunk-5UEUAW57.js → chunk-CJPDTLGD.js} +1 -1
- package/dist/{chunk-FQSIIADJ.js → chunk-DBYZI75U.js} +30 -5
- package/dist/{chunk-PX5AWL7Y.js → chunk-JT3QXA22.js} +99 -29
- package/dist/{chunk-6OR326EA.js → chunk-JXVS7BJK.js} +1 -1
- package/dist/chunk-KXBZ6ZSB.js +991 -0
- package/dist/{chunk-5PDN7BN6.js → chunk-MBU42S5Y.js} +427 -167
- package/dist/{chunk-K4DQQIT4.js → chunk-NS3VYB57.js} +5 -5
- package/dist/chunk-QLFWWHRF.js +919 -0
- package/dist/{chunk-5TO6I3GB.js → chunk-RAKEVM52.js} +1 -1
- package/dist/{chunk-NAWQR7MN.js → chunk-VCGRMNY2.js} +1 -1
- package/dist/chunk-WCG3THTD.js +23712 -0
- package/dist/{chunk-UM24JFUE.js → chunk-YWXB4XAT.js} +2 -2
- package/dist/{chunk-3XDRQYWZ.js → chunk-YZXTXX2D.js} +1 -1
- package/dist/{chunk-SMLMI6IZ.js → chunk-ZCFSDSUX.js} +3 -3
- package/dist/{chunk-KINQFU6X.js → chunk-ZOHFLP3O.js} +19 -12
- package/dist/{composition-D4ADF5c-.d.ts → composition-C-OoqvAr.d.ts} +227 -167
- package/dist/composition.d.ts +2 -2
- package/dist/composition.js +1 -1
- package/dist/conversion-C5foedh6.d.ts +502 -0
- package/dist/conversion-KGDVJM75.js +21 -0
- package/dist/convert.d.ts +3 -3
- package/dist/convert.js +7 -7
- package/dist/data.d.ts +6 -6
- package/dist/data.js +2 -2
- package/dist/deck-report-wszX7uo8.d.ts +40 -0
- package/dist/deck.d.ts +21 -51
- package/dist/deck.js +10 -10
- package/dist/diff.js +5 -5
- package/dist/docs.js +33 -27
- package/dist/examples.d.ts +1 -1
- package/dist/examples.js +418 -451
- package/dist/format.js +2 -2
- package/dist/index.d.ts +179 -16
- package/dist/index.js +51 -796
- package/dist/markdown.d.ts +10 -6
- package/dist/markdown.js +7 -7
- package/dist/node-engine.d.ts +114 -0
- package/dist/node-engine.js +44 -0
- package/dist/{pagination-DzZPFheM.d.ts → pagination-BaUjDrTz.d.ts} +25 -8
- package/dist/pagination.d.ts +3 -3
- package/dist/pagination.js +4 -4
- package/dist/patch.js +4 -4
- package/dist/{presentation-COrFuj2g.d.ts → presentation-HondgJ3l.d.ts} +278 -454
- package/dist/repo-readme.js +1 -1
- package/dist/schemas.d.ts +4 -2
- package/dist/schemas.js +1 -1
- package/dist/spec/catalogs/manifest.json +1 -1
- package/dist/spec/schemas/opf.schema.json +74 -100
- package/dist/types.d.ts +2 -2
- package/dist/{validation-types-HxIgJfKx.d.ts → validation-types-PbGDrNUr.d.ts} +23 -7
- package/dist/validator.d.ts +6 -6
- package/dist/validator.js +3 -3
- package/dist/yaml.d.ts +4 -4
- package/dist/yaml.js +7 -7
- package/package.json +37 -2
package/dist/format.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { OPFFormatError, format, isFormatted, sortPresentationKeys } from './chunk-
|
|
2
|
-
import './chunk-
|
|
1
|
+
export { OPFFormatError, format, isFormatted, sortPresentationKeys } from './chunk-JXVS7BJK.js';
|
|
2
|
+
import './chunk-6WW2EDUW.js';
|
package/dist/index.d.ts
CHANGED
|
@@ -1,25 +1,73 @@
|
|
|
1
1
|
export { SchemaEntry, SchemaName, audience, chartType, colorScheme, fontScheme, language, layout, narrative, presentation, purpose, schemaEntries, schemaNames, schemas, socialPlatform, theme, tone } from './schemas.js';
|
|
2
|
-
|
|
3
|
-
export {
|
|
2
|
+
import { a2 as ConvertInput, a3 as ConvertOptions, a4 as ConvertResult, a5 as ConvertFormat, a6 as OpenOptions, a7 as SaveOptions, a8 as SaveResult } from './conversion-C5foedh6.js';
|
|
3
|
+
export { a9 as ConvertedFile, h as ExportFormat, F as FontsHandle, O as OPFApiError, n as OPFExportError, o as OPFImportError, S as SlideSelection, T as parseSlideSelection } from './conversion-C5foedh6.js';
|
|
4
|
+
import { validate as validate$1 } from './validator.js';
|
|
5
|
+
export { DEFAULT_CHART_PALETTE, DEFAULT_VALIDATION_THRESHOLDS, OPFValidationError, assertValid, assertValidCatalogRecord, findValidationRule, validateCatalogRecord, validationRules } from './validator.js';
|
|
6
|
+
import { R as ResolveVariablesOptions, h as VariableDiagnostic } from './validation-types-PbGDrNUr.js';
|
|
7
|
+
export { B as BuiltinVariableInfo, C as Contract, D as DEFAULT_VARIABLE_DATE_FORMAT, O as OPFVariableError, i as ResolveVariablesResult, j as VARIABLE_KINDS, d as ValidateFonts, a as ValidateOptions, e as ValidationCategory, f as ValidationChecks, V as ValidationReport, g as ValidationRuleCost, c as ValidationRuleInfo, b as ValidationThresholds, k as VariableDeclaration, l as VariableDiagnosticCode, m as VariableDiagnosticSeverity, n as VariableInfo, o as VariableKind, p as VariableUse, q as VariableUseForm, r as VariableValues, s as coerceVariableValue, t as formatVariableNumber, u as hasContentVariables, w as isTemplate, x as listBuiltinVariables, y as listVariables, z as resolveVariables, v as validationCategories, A as variableDeclarations } from './validation-types-PbGDrNUr.js';
|
|
8
|
+
export { a as CHART_TYPES, C as ComposeSlideOptions, E as ENGINE_DEFAULT_CHART_TYPES, b as ENGINE_DEFAULT_COLOR_SCHEME, c as ENGINE_DEFAULT_FONT_SCHEME, d as ENGINE_DEFAULT_THEME, e as FontFamilies, F as Fonts, f as LANGUAGES, g as LOGO_SHAPES, h as LanguageFamilyName, i as LanguageVocabulary, L as LayoutDiagnostic, j as LogoShape, k as LogoVariant, M as MeasureTextWidth, R as ResolveLogoOptions, l as ResolvedLogo, S as SOCIAL_PLATFORMS, m as SocialPlatformVocabulary, T as TextMeasurement, n as TextStyle, o as normalizeLanguageFamily } from './composition-C-OoqvAr.js';
|
|
4
9
|
export { SpecFileEntry, SpecFileKind, SpecFilePath, specFileEntries, specFileKinds, specFilePaths } from './spec-files.js';
|
|
5
|
-
import { P as Presentation } from './presentation-
|
|
10
|
+
import { P as Presentation } from './presentation-HondgJ3l.js';
|
|
6
11
|
export { Audience, ChartType, ColorScheme, FontScheme, Language, Layout, Narrative, Purpose, SocialPlatform, Theme, Tone } from './types.js';
|
|
7
|
-
import {
|
|
8
|
-
export { c as CATALOG_GROUP_PATTERN, d as CATALOG_REFERENCE_PATTERN, e as CatalogRecordMap, f as CatalogRecords, g as CatalogReferenceSite, O as OPFCatalogsOptionError, h as OPFUnresolvedReferenceError, i as ResolvedReference, j as catalogGroupSource, k as catalogKinds, l as catalogRecords, m as catalogReferenceSites, p as parseReference, r as resolveReference, u as unresolvedReference } from './catalog-refs-
|
|
9
|
-
|
|
10
|
-
export {
|
|
11
|
-
export { C as CatalogDisplayKind, a as CatalogRecordKind, c as catalogDisplayKinds, b as catalogSchemaNames } from './catalog-schemas-
|
|
12
|
-
|
|
12
|
+
import { C as CatalogKind, U as UnresolvedReferenceDiagnostic, b as CatalogOptions, a as Catalog, R as RecordProvenance } from './catalog-refs-BSfGELpt.js';
|
|
13
|
+
export { c as CATALOG_GROUP_PATTERN, d as CATALOG_REFERENCE_PATTERN, e as CatalogRecordMap, f as CatalogRecords, g as CatalogReferenceSite, O as OPFCatalogsOptionError, h as OPFUnresolvedReferenceError, i as ResolvedReference, j as catalogGroupSource, k as catalogKinds, l as catalogRecords, m as catalogReferenceSites, p as parseReference, r as resolveReference, u as unresolvedReference } from './catalog-refs-BSfGELpt.js';
|
|
14
|
+
import { a as Finding, J as JsonPatchOperation } from './finding-CT_f_vbD.js';
|
|
15
|
+
export { d as FindingCategory, e as FindingFix, f as FindingFocus, b as FindingLocation, F as FindingReport, c as FindingSeverity, g as FindingSuggestion, V as ValidationIssue } from './finding-CT_f_vbD.js';
|
|
16
|
+
export { C as CatalogDisplayKind, a as CatalogRecordKind, c as catalogDisplayKinds, b as catalogSchemaNames } from './catalog-schemas-CinPh5WA.js';
|
|
17
|
+
import { p as paginate$1 } from './pagination-BaUjDrTz.js';
|
|
18
|
+
export { O as OPFPaginationError, a as PaginatedPage, c as PaginationMapping, d as PaginationOptions, e as PaginationResult, b as PresentationPaginationOptions, P as PresentationPaginationResult, S as SlideContext, f as SlideContextDiagnostic, g as SlideContextOptions, h as paginateSlide, r as resolveSlideContext } from './pagination-BaUjDrTz.js';
|
|
13
19
|
export { ApplyPatchOptions, OPFPatchError, OPFPatchValidationError, PatchResult, applyPatch } from './patch.js';
|
|
14
20
|
export { DiffOptions, MergeConflict, MergeOptions, MergeResult, PresentationDiff, diff, merge } from './diff.js';
|
|
15
21
|
export { FormatOptions, OPFFormatError, format } from './format.js';
|
|
16
22
|
export { FromMarkdownOptions, FromMarkdownResult, OPFMarkdownError, ToMarkdownOptions, ToMarkdownResult, fromMarkdown, toMarkdown } from './markdown.js';
|
|
17
|
-
export {
|
|
18
|
-
export { DataCell, DataImportOptions,
|
|
23
|
+
export { StringifyOptions, parse, stringify } from './deck.js';
|
|
24
|
+
export { DataCell, DataImportOptions, ImportedChart, ImportedChartData, ImportedChartType, ImportedTable, IngestOptions, OPFDataImportError, TabularData, ingest, parseTabularData } from './data.js';
|
|
19
25
|
export { I as ChartComboSeries, C as ChartMapping, a as ChartNumberFix, b as ChartNumberFixOperation, c as ChartNumberFixOptions, D as DataCellValue, d as DataColumn, e as DataDiagnostic, f as DataDiagnosticCode, g as DataResolveOptions, h as DataSourceRef, i as DataStyledCell, j as DataTableCell, k as DataTableHeader, l as DataTableValue, m as DataTextRun, n as Dataset, o as DatasetRef, R as ResolvedChartData, p as ResolvedTableData, q as chartNumber, r as datasetDiagnostics, s as formatDataNumber, t as fromExcelNumberFormat, u as inlineChartData, v as inlineDatasets, w as inlineTableData, x as isDatasetRef, y as isXYChartType, z as numberFormatError, A as resolveChartData, B as resolveTableData, E as suggestChartNumberFix, F as tableCellDisplayValue, G as toExcelNumberFormat, H as unusedDatasets } from './chart-data-BnNqgnC-.js';
|
|
20
26
|
export { FONT_POLICY, FontAvailability, FontAvailabilityCode, FontAvailabilityDiagnostic, FontLicenseClass, FontPolicyDecision, FontPolicyEntry, FontPolicyTable, FontReplacement, FontReplacementCompatibility, FontReplacementMeasurement, applyFontPolicyDecisions, fontAvailabilityDiagnostics, fontPolicyFor } from './font-policy.js';
|
|
27
|
+
export { a as DECK_FORMATS, D as DeckFormat, P as ParseOptions, d as deckFormatOf } from './deck-report-wszX7uo8.js';
|
|
21
28
|
import './json-BFSdESOE.js';
|
|
22
29
|
|
|
30
|
+
/**
|
|
31
|
+
* Slide-scoped built-in variables (FA-31): `{{slide.number}}`, `{{slide.section}}` and `{{deck.slideCount}}`.
|
|
32
|
+
*
|
|
33
|
+
* Their values depend on the slide being composed and on the deck after pagination, so the deck-wide
|
|
34
|
+
* `resolveVariables` leaves them as written (with an escaped `\{{slide.number}}` kept escaped) and they resolve
|
|
35
|
+
* here, per output slide: `resolveSlideVariables` for a slide's own strings and `substituteSlideTokens` for
|
|
36
|
+
* header and footer text, which `layoutFurniture` substitutes so it can mark each slide number as a live field.
|
|
37
|
+
* The organization logo references (`var:organization.logo.icon`, RR-71) are slide-scoped too, because the
|
|
38
|
+
* `onLight`/`onDark` choice follows each slide's background: `resolveSlideVariables` resolves them in a slide's own
|
|
39
|
+
* fields when it is given the presentation, and `layoutFurniture` in zone images.
|
|
40
|
+
* Pure: no clock, locale or I/O. See docs/templates-and-variables.md.
|
|
41
|
+
*/
|
|
42
|
+
/** The slide-scoped built-in names, in picker order. */
|
|
43
|
+
declare const SLIDE_SCOPED_BUILTINS: readonly ["slide.number", "slide.section", "deck.slideCount"];
|
|
44
|
+
type SlideScopedBuiltin = (typeof SLIDE_SCOPED_BUILTINS)[number];
|
|
45
|
+
/**
|
|
46
|
+
* A copy of `slide` with `{{slide.number}}`, `{{slide.section}}` and `{{deck.slideCount}}` substituted in every
|
|
47
|
+
* string (titles, body text, runs, table cells, chart data, notes, code), with the walk and exclusions of
|
|
48
|
+
* `resolveVariables`: `extensions` is never searched, an escaped `\{{slide.number}}` becomes the literal text
|
|
49
|
+
* `{{slide.number}}`, and unknown tokens stay as written. `slide.section` reads the slide's own `section` (empty
|
|
50
|
+
* text when it has none). The slide's own `design.header` and `design.footer` are left as written:
|
|
51
|
+
* `layoutFurniture` substitutes header and footer text itself and marks each slide number as a live field.
|
|
52
|
+
*
|
|
53
|
+
* With `presentation` (RR-71) it also resolves the slide-scoped logo references, a whole string
|
|
54
|
+
* `var:organization.logo[.<shape>]` or `var:organization.<id>.logo[.<shape>]` in any field (an image block, the slide
|
|
55
|
+
* `image`), to the organization's asset for this slide's background (`darkBackground`, the host's luminance test:
|
|
56
|
+
* `onDark` first, else `onLight`); a reference whose organization has no logo is omitted, like an unfilled optional
|
|
57
|
+
* variable, and an unknown one stays as written (validation reports it). The slide's own `design.logo` is left for
|
|
58
|
+
* `resolveLogo`, and zone images for `layoutFurniture`.
|
|
59
|
+
*
|
|
60
|
+
* Engines call it on each output slide after pagination, with the same `slideNumber`, `slideCount` and
|
|
61
|
+
* `darkBackground` they pass to `composeSlide`, and compose and draw the result; `resolveSlideContext` returns it as
|
|
62
|
+
* `slide`. Returns the input object itself when nothing changes; never mutates it.
|
|
63
|
+
*/
|
|
64
|
+
declare function resolveSlideVariables<T>(slide: T, values: {
|
|
65
|
+
slideNumber: number;
|
|
66
|
+
slideCount?: number;
|
|
67
|
+
presentation?: unknown;
|
|
68
|
+
darkBackground?: boolean;
|
|
69
|
+
}): T;
|
|
70
|
+
|
|
23
71
|
/** Whether two records have the same content once embedded (`$schema`, `id` and `x-*` ignored). */
|
|
24
72
|
declare function sameRecord(a: unknown, b: unknown): boolean;
|
|
25
73
|
/** One record `embed` or `copySlides` added to a document. */
|
|
@@ -42,7 +90,7 @@ interface EmbedResult {
|
|
|
42
90
|
* embedded under `catalogs.default` (whose `source` is set to that catalog's). Records already embedded are kept as
|
|
43
91
|
* they are; catalog display metadata (`x-*`), `$schema` and `id` are stripped from the copies. Idempotent.
|
|
44
92
|
*/
|
|
45
|
-
declare function embed(document: unknown, options?: CatalogOptions): EmbedResult;
|
|
93
|
+
declare function embed$1(document: unknown, options?: CatalogOptions): EmbedResult;
|
|
46
94
|
/** A copied record that did not keep its reference. */
|
|
47
95
|
interface CopiedRecordRename {
|
|
48
96
|
kind: CatalogKind;
|
|
@@ -250,7 +298,7 @@ interface HeaderFooterFact {
|
|
|
250
298
|
/** The deck sets it to `false`. */
|
|
251
299
|
suppressed: boolean;
|
|
252
300
|
zones: string[];
|
|
253
|
-
/** Fields set in any zone:
|
|
301
|
+
/** Fields set in any zone: image, text, socials, date. */
|
|
254
302
|
fields: string[];
|
|
255
303
|
}
|
|
256
304
|
interface TableFact {
|
|
@@ -403,7 +451,7 @@ interface PresentationStats {
|
|
|
403
451
|
decorative: number;
|
|
404
452
|
missingAlt: number;
|
|
405
453
|
};
|
|
406
|
-
/** Logo images:
|
|
454
|
+
/** Logo images: every asset of every organization's logo (each shape, and each of onLight and onDark). */
|
|
407
455
|
logos: number;
|
|
408
456
|
watermarks: {
|
|
409
457
|
deck: boolean;
|
|
@@ -521,6 +569,121 @@ interface StatsOptions extends CatalogOptions {
|
|
|
521
569
|
/** Speaking pace for the notes estimate. Default 130. */
|
|
522
570
|
wordsPerMinute?: number;
|
|
523
571
|
}
|
|
524
|
-
declare function stats(presentation: unknown, options?: StatsOptions): PresentationStats;
|
|
572
|
+
declare function stats$1(presentation: unknown, options?: StatsOptions): PresentationStats;
|
|
573
|
+
|
|
574
|
+
interface EditOptions {
|
|
575
|
+
/** The catalogs the result's references resolve in. In Node the default catalog when omitted, as `opf edit` registers it; in the browser build none. */
|
|
576
|
+
catalogs?: readonly Catalog[];
|
|
577
|
+
/** `false` skips the check of the result (work in progress). Default true. */
|
|
578
|
+
validate?: boolean;
|
|
579
|
+
}
|
|
580
|
+
interface EditResult {
|
|
581
|
+
/** The patched deck (a copy). */
|
|
582
|
+
presentation: Presentation;
|
|
583
|
+
/** The warnings and notes of the format and references check (errors throw). */
|
|
584
|
+
findings: Finding[];
|
|
585
|
+
/** The patch that restores the input. */
|
|
586
|
+
inverse: JsonPatchOperation[];
|
|
587
|
+
}
|
|
588
|
+
/** Apply a JSON Patch (`add`, `remove`, `replace`, `move`, `copy`, `test`) to a deck and check the result's format and references. */
|
|
589
|
+
declare function edit$1(deck: unknown, patch: unknown, options?: EditOptions): EditResult;
|
|
590
|
+
|
|
591
|
+
/** The values of one deck, keyed by variable id. */
|
|
592
|
+
type FillRecord = Record<string, unknown>;
|
|
593
|
+
interface FillOptions extends Pick<ResolveVariablesOptions, "partial" | "examples"> {
|
|
594
|
+
/** The form of text data: `csv`, `tsv` or `json`. Omitted: `json` when the text starts with `{` or `[`, else `csv`. */
|
|
595
|
+
format?: "csv" | "tsv" | "json";
|
|
596
|
+
/** CSV: the field separator (default `,`; TSV uses a tab). */
|
|
597
|
+
delimiter?: string;
|
|
598
|
+
/** CSV and TSV: the first row names the columns (default true). */
|
|
599
|
+
header?: boolean;
|
|
600
|
+
/** Join the decks into one: the first deck's fields, then the slides of every deck in order (a repeated slide id gets the record number). */
|
|
601
|
+
combine?: boolean;
|
|
602
|
+
}
|
|
603
|
+
interface FilledDeck {
|
|
604
|
+
/** The record's position, from 1. */
|
|
605
|
+
index: number;
|
|
606
|
+
record: FillRecord;
|
|
607
|
+
presentation: Record<string, unknown>;
|
|
608
|
+
diagnostics: VariableDiagnostic[];
|
|
609
|
+
/** The variables that kept no value. */
|
|
610
|
+
unfilled: string[];
|
|
611
|
+
complete: boolean;
|
|
612
|
+
}
|
|
613
|
+
interface FillResult {
|
|
614
|
+
/** One deck per record, in order. */
|
|
615
|
+
decks: FilledDeck[];
|
|
616
|
+
/** With `combine`: the one deck. */
|
|
617
|
+
presentation?: Record<string, unknown>;
|
|
618
|
+
/** Every deck has a value for every variable. */
|
|
619
|
+
complete: boolean;
|
|
620
|
+
unfilled: string[];
|
|
621
|
+
/** The warnings and errors of every deck, one entry per code, variable and path, with the records it hit. An `error` (a required variable with no value, unless `partial`) means the deck is not usable as it is. */
|
|
622
|
+
diagnostics: (VariableDiagnostic & {
|
|
623
|
+
records: number[];
|
|
624
|
+
})[];
|
|
625
|
+
}
|
|
626
|
+
/**
|
|
627
|
+
* The records of text data. JSON keeps rich values (text runs, lists, image objects): an object is one record and an array of
|
|
628
|
+
* objects one record each. CSV, TSV and tabular JSON (`{ columns, rows }` or a row matrix) give one record per row, keyed by the
|
|
629
|
+
* header, with blank cells left unprovided. Throws `OPFDataImportError` for data that has no records.
|
|
630
|
+
*/
|
|
631
|
+
declare function fillRecords(raw: string, options?: Pick<FillOptions, "format" | "delimiter" | "header">): FillRecord[];
|
|
632
|
+
/**
|
|
633
|
+
* Fill a template: `data` is text (CSV, TSV or JSON), one record or a list of records; omitted, one deck is filled from the
|
|
634
|
+
* variables' own values (and their examples with `examples`). Each deck is the template resolved with one record
|
|
635
|
+
* (`resolveVariables`), no longer marked as a template. Throws `OPFDataImportError` for data without records and a `TypeError`
|
|
636
|
+
* for a template that is not an object.
|
|
637
|
+
*/
|
|
638
|
+
declare function fill(template: unknown, data?: string | FillRecord | readonly FillRecord[], options?: FillOptions): FillResult;
|
|
639
|
+
|
|
640
|
+
/** `validate` with the default catalog registered when `catalogs` is omitted, as `opf validate` does. */
|
|
641
|
+
declare const validate: typeof validate$1;
|
|
642
|
+
/** `stats` with the default catalog registered when `catalogs` is omitted, as `opf stats` does. */
|
|
643
|
+
declare const stats: typeof stats$1;
|
|
644
|
+
/** `paginate` with the default catalog registered when `catalogs` is omitted, as `opf paginate` does. Pass `fonts` (opf-render's `loadFonts()`) for measured page breaks. */
|
|
645
|
+
declare const paginate: typeof paginate$1;
|
|
646
|
+
/** `embed` with the default catalog registered when `catalogs` is omitted, as `opf embed` does. */
|
|
647
|
+
declare const embed: typeof embed$1;
|
|
648
|
+
/** `edit` with the default catalog registered for the check when `catalogs` is omitted, as `opf edit` does. */
|
|
649
|
+
declare const edit: typeof edit$1;
|
|
650
|
+
/**
|
|
651
|
+
* Convert a file, a deck or the bytes of a `.pptx` file. With an `output` path the format comes from its extension and the
|
|
652
|
+
* files are written: `.pdf`, `.pptx`, `.png` and `.svg` are exported (one PNG or SVG per slide, `slides/deck.png` giving
|
|
653
|
+
* `slides/deck-001.png`, ...; one selected slide is written to `output` itself), `.zip` is one archive of the slides (`format`
|
|
654
|
+
* `png`, the default, or `svg`), and `.opf.md`, `.yaml`/`.yml` or `.json` writes the deck in that form. Without an output path,
|
|
655
|
+
* pass `{ format }`: nothing is written and the files come back with their names and bytes.
|
|
656
|
+
*
|
|
657
|
+
* A `.pptx` input is imported first. Local images resolve next to the input file unless `assetDir` says otherwise; URLs are
|
|
658
|
+
* never fetched. Everything is produced before anything is written, and each file is written atomically, replacing an existing
|
|
659
|
+
* output (`overwrite: false` refuses one with `output-exists`, as the commands do without `--force`). Throws `OPFApiError` for the request and the files (`invalid-option`, `input-not-found`,
|
|
660
|
+
* `input-unreadable`, `invalid-presentation`, `output-exists`, `output-not-file`, `output-unwritable`), `OPFImportError` for the
|
|
661
|
+
* import step and `OPFExportError` for the export step (`peer-not-installed`, `peer-too-old`, `peer-load-failed`,
|
|
662
|
+
* `invalid-presentation`, `no-slides`, `all-slides-hidden`, `export-failed`, `import-failed`).
|
|
663
|
+
*
|
|
664
|
+
* Node only (also Bun and Deno): the browser build of the root rejects with `OPFApiError` `node-only`.
|
|
665
|
+
*/
|
|
666
|
+
declare function convert(input: ConvertInput, output: string, options?: ConvertOptions): Promise<ConvertResult>;
|
|
667
|
+
declare function convert(input: ConvertInput, options: ConvertOptions & {
|
|
668
|
+
format: ConvertFormat;
|
|
669
|
+
}): Promise<ConvertResult>;
|
|
670
|
+
/**
|
|
671
|
+
* Open a deck: a `.opf.md`, `.yaml`/`.yml` or `.json` file (the form named by the extension), or a PowerPoint file (a `.pptx`
|
|
672
|
+
* path or its bytes), imported. Returns the presentation. A deck file that fails the format and references check throws
|
|
673
|
+
* `OPFValidationError` (its findings located by line and column in the file); a PowerPoint file that cannot be imported throws
|
|
674
|
+
* `OPFImportError`; a missing file throws `OPFApiError` `input-not-found`. Warnings are not returned: `validate` reports them,
|
|
675
|
+
* and `convert("deck.pptx", "deck.opf.yaml")` returns what an import could not keep.
|
|
676
|
+
*
|
|
677
|
+
* Node only (also Bun and Deno): the browser build of the root rejects with `OPFApiError` `node-only`.
|
|
678
|
+
*/
|
|
679
|
+
declare function open(input: string | Uint8Array | ArrayBuffer, options?: OpenOptions): Promise<Presentation>;
|
|
680
|
+
/**
|
|
681
|
+
* Save a deck in the form its file name names (`.opf.md`, `.yaml`/`.yml` or `.json`), atomically, creating folders, replacing
|
|
682
|
+
* the file. It is checked for format and references first and an invalid deck is refused with `OPFValidationError`;
|
|
683
|
+
* `validate: false` writes work in progress, as an editor's autosave does. Returns `{ path, format }`.
|
|
684
|
+
*
|
|
685
|
+
* Node only (also Bun and Deno): the browser build of the root rejects with `OPFApiError` `node-only`.
|
|
686
|
+
*/
|
|
687
|
+
declare function save(deck: Presentation, path: string, options?: SaveOptions): Promise<SaveResult>;
|
|
525
688
|
|
|
526
|
-
export { Catalog, CatalogKind, CatalogOptions, type CatalogPatchOperation, type CatalogRecordChange, type CatalogRef, type CatalogUpdate, type CopiedRecordRename, type CopySlidesResult, type DatasetFact, type EmbedResult, type EmbeddedRecord, type HeaderFooterFact, type MoveToCustomErrorCode, type MoveToCustomPatchOperation, type MoveToCustomResult, type MovedRecord, OPFMoveToCustomError, Presentation, type PresentationStats, RecordProvenance, type ReferenceFact, type ResolvedDesignRecords, type SlideSizeFact, type SlideStats, type StatsOptions, type StatsSlideRef, type TableFact, UnresolvedReferenceDiagnostic, copySlides, embed, moveToCustom, resolveDesignRecords, resolveFontScheme, sameRecord, stats, updateFromCatalog };
|
|
689
|
+
export { Catalog, CatalogKind, CatalogOptions, type CatalogPatchOperation, type CatalogRecordChange, type CatalogRef, type CatalogUpdate, ConvertFormat, ConvertInput, ConvertOptions, ConvertResult, type CopiedRecordRename, type CopySlidesResult, type DatasetFact, type EditOptions, type EditResult, type EmbedResult, type EmbeddedRecord, type FillOptions, type FillRecord, type FillResult, type FilledDeck, Finding, type HeaderFooterFact, JsonPatchOperation, type MoveToCustomErrorCode, type MoveToCustomPatchOperation, type MoveToCustomResult, type MovedRecord, OPFMoveToCustomError, OpenOptions, Presentation, type PresentationStats, RecordProvenance, type ReferenceFact, ResolveVariablesOptions, type ResolvedDesignRecords, SLIDE_SCOPED_BUILTINS, SaveOptions, SaveResult, type SlideScopedBuiltin, type SlideSizeFact, type SlideStats, type StatsOptions, type StatsSlideRef, type TableFact, UnresolvedReferenceDiagnostic, VariableDiagnostic, convert, copySlides, edit, embed, fill, fillRecords, moveToCustom, open, paginate, resolveDesignRecords, resolveFontScheme, resolveSlideVariables, sameRecord, save, stats, updateFromCatalog, validate };
|