@syncmatters/script-api 1.0.13 → 1.0.14

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.
@@ -22,6 +22,12 @@ export interface XmlParseOptions {
22
22
  * When set, xmlParse streams matching elements; omit for a full-document Promise.
23
23
  */
24
24
  emit?: string[];
25
+ /**
26
+ * XPath subset expressions (same syntax as `emit`) naming elements to prune: a matching
27
+ * element and its whole subtree are dropped before any `emit` matching or recording, so
28
+ * documents padded with unread markup cost neither parse time nor memory. Requires `emit`.
29
+ */
30
+ skip?: string[];
25
31
  }
26
32
  /**
27
33
  * One matched element from a streaming xmlParse({ source, emit }) call.
@@ -17,9 +17,10 @@ export declare function localNameOf(qname: string): string;
17
17
  /**
18
18
  * Compile one XPath-subset expression.
19
19
  * Supported: `//Name`, `/A/B/C`, `A/B` (local names only; prefixes ignored).
20
+ * `label` names the option being compiled so errors point at `emit` or `skip`.
20
21
  */
21
- export declare function compileEmitExpression(raw: string): XmlEmitMatcher;
22
- export declare function compileEmitExpressions(emit: string[]): XmlEmitMatcher[];
22
+ export declare function compileEmitExpression(raw: string, label?: string): XmlEmitMatcher;
23
+ export declare function compileEmitExpressions(expressions: string[], label?: string): XmlEmitMatcher[];
23
24
  /** True if the current element stack (local names) matches the compiled expression. */
24
25
  export declare function matchesEmit(matcher: XmlEmitMatcher, pathLocalNames: string[]): boolean;
25
26
  /** Last path step local name for a matcher (the element that starts a potential match). */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@syncmatters/script-api",
3
- "version": "1.0.13",
3
+ "version": "1.0.14",
4
4
  "description": "TypeScript type definitions for the SyncMatters script API (types only - scripts execute on the SyncMatters platform)",
5
5
  "types": "./index.d.ts",
6
6
  "exports": {
@@ -28,7 +28,7 @@
28
28
  "license": "MIT",
29
29
  "author": "SyncMatters",
30
30
  "homepage": "https://syncmatters.com",
31
- "typesContentHash": "5cb475fa1240d9fa9964086b867786e024b3d3b555313717aafd586bbec05675",
31
+ "typesContentHash": "1908da7a9d689fba3b76a80a652493ef9028ab6cebb2e1c08db9f2cc3cb9ffa5",
32
32
  "dependencies": {
33
33
  "@types/node": "*"
34
34
  }