@ohos-ports/html2canvas-pro 0.0.0-stage → 2.3.2-beta.0
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/LICENSE +21 -0
- package/README.md +86 -2
- package/dist/html2canvas-pro.cjs +11191 -0
- package/dist/html2canvas-pro.cjs.map +1 -0
- package/dist/html2canvas-pro.esm.js +11182 -0
- package/dist/html2canvas-pro.esm.js.map +1 -0
- package/dist/html2canvas-pro.js +11196 -0
- package/dist/html2canvas-pro.js.map +1 -0
- package/dist/html2canvas-pro.min.js +10 -0
- package/dist/lib/config.js +49 -0
- package/dist/lib/core/abort-helper.js +20 -0
- package/dist/lib/core/background-parser.js +41 -0
- package/dist/lib/core/bitwise.js +5 -0
- package/dist/lib/core/cache-storage.js +268 -0
- package/dist/lib/core/config-assembler.js +88 -0
- package/dist/lib/core/constants.js +25 -0
- package/dist/lib/core/context.js +19 -0
- package/dist/lib/core/debugger.js +27 -0
- package/dist/lib/core/features.js +190 -0
- package/dist/lib/core/logger.js +56 -0
- package/dist/lib/core/lru-map.js +66 -0
- package/dist/lib/core/origin-checker.js +53 -0
- package/dist/lib/core/performance-monitor.js +185 -0
- package/dist/lib/core/render-element.js +132 -0
- package/dist/lib/core/util.js +4 -0
- package/dist/lib/core/validator.js +500 -0
- package/dist/lib/css/grouped/background-styles.js +36 -0
- package/dist/lib/css/grouped/border-styles.js +75 -0
- package/dist/lib/css/grouped/font-styles.js +93 -0
- package/dist/lib/css/grouped/layout-styles.js +127 -0
- package/dist/lib/css/index.js +330 -0
- package/dist/lib/css/layout/bounds.js +52 -0
- package/dist/lib/css/layout/text.js +133 -0
- package/dist/lib/css/property-descriptor.js +2 -0
- package/dist/lib/css/property-descriptors/background-blend-mode.js +41 -0
- package/dist/lib/css/property-descriptors/background-clip.js +23 -0
- package/dist/lib/css/property-descriptors/background-color.js +10 -0
- package/dist/lib/css/property-descriptors/background-image.js +24 -0
- package/dist/lib/css/property-descriptors/background-origin.js +23 -0
- package/dist/lib/css/property-descriptors/background-position.js +19 -0
- package/dist/lib/css/property-descriptors/background-repeat.js +33 -0
- package/dist/lib/css/property-descriptors/background-size.js +23 -0
- package/dist/lib/css/property-descriptors/border-color.js +14 -0
- package/dist/lib/css/property-descriptors/border-image-repeat.js +42 -0
- package/dist/lib/css/property-descriptors/border-image-slice.js +45 -0
- package/dist/lib/css/property-descriptors/border-image-source.js +22 -0
- package/dist/lib/css/property-descriptors/border-radius.js +15 -0
- package/dist/lib/css/property-descriptors/border-style.js +26 -0
- package/dist/lib/css/property-descriptors/border-width.js +20 -0
- package/dist/lib/css/property-descriptors/box-decoration-break.js +18 -0
- package/dist/lib/css/property-descriptors/box-shadow.js +54 -0
- package/dist/lib/css/property-descriptors/clip-path.js +189 -0
- package/dist/lib/css/property-descriptors/color.js +10 -0
- package/dist/lib/css/property-descriptors/content.js +19 -0
- package/dist/lib/css/property-descriptors/counter-increment.js +35 -0
- package/dist/lib/css/property-descriptors/counter-reset.js +18 -0
- package/dist/lib/css/property-descriptors/direction.js +18 -0
- package/dist/lib/css/property-descriptors/display.js +81 -0
- package/dist/lib/css/property-descriptors/duration.js +14 -0
- package/dist/lib/css/property-descriptors/filter.js +76 -0
- package/dist/lib/css/property-descriptors/float.js +22 -0
- package/dist/lib/css/property-descriptors/font-family.js +32 -0
- package/dist/lib/css/property-descriptors/font-size.js +10 -0
- package/dist/lib/css/property-descriptors/font-style.js +20 -0
- package/dist/lib/css/property-descriptors/font-variant-ligatures.js +34 -0
- package/dist/lib/css/property-descriptors/font-variant.js +13 -0
- package/dist/lib/css/property-descriptors/font-weight.js +25 -0
- package/dist/lib/css/property-descriptors/image-rendering.js +33 -0
- package/dist/lib/css/property-descriptors/letter-spacing.js +21 -0
- package/dist/lib/css/property-descriptors/line-break.js +23 -0
- package/dist/lib/css/property-descriptors/line-height.js +24 -0
- package/dist/lib/css/property-descriptors/list-style-image.js +17 -0
- package/dist/lib/css/property-descriptors/list-style-position.js +18 -0
- package/dist/lib/css/property-descriptors/list-style-type.js +122 -0
- package/dist/lib/css/property-descriptors/margin.js +13 -0
- package/dist/lib/css/property-descriptors/mix-blend-mode.js +31 -0
- package/dist/lib/css/property-descriptors/object-fit.js +28 -0
- package/dist/lib/css/property-descriptors/object-position.js +42 -0
- package/dist/lib/css/property-descriptors/opacity.js +16 -0
- package/dist/lib/css/property-descriptors/overflow-wrap.js +18 -0
- package/dist/lib/css/property-descriptors/overflow.js +27 -0
- package/dist/lib/css/property-descriptors/padding.js +14 -0
- package/dist/lib/css/property-descriptors/paint-order.js +33 -0
- package/dist/lib/css/property-descriptors/position.js +22 -0
- package/dist/lib/css/property-descriptors/quotes.js +41 -0
- package/dist/lib/css/property-descriptors/rotate.js +27 -0
- package/dist/lib/css/property-descriptors/text-align.js +21 -0
- package/dist/lib/css/property-descriptors/text-decoration-color.js +10 -0
- package/dist/lib/css/property-descriptors/text-decoration-line.js +28 -0
- package/dist/lib/css/property-descriptors/text-decoration-style.js +24 -0
- package/dist/lib/css/property-descriptors/text-decoration-thickness.js +26 -0
- package/dist/lib/css/property-descriptors/text-overflow.js +18 -0
- package/dist/lib/css/property-descriptors/text-shadow.js +46 -0
- package/dist/lib/css/property-descriptors/text-transform.js +20 -0
- package/dist/lib/css/property-descriptors/text-underline-offset.js +23 -0
- package/dist/lib/css/property-descriptors/transform-origin.js +24 -0
- package/dist/lib/css/property-descriptors/transform.js +57 -0
- package/dist/lib/css/property-descriptors/visibility.js +20 -0
- package/dist/lib/css/property-descriptors/webkit-line-clamp.js +26 -0
- package/dist/lib/css/property-descriptors/webkit-text-stroke-color.js +10 -0
- package/dist/lib/css/property-descriptors/webkit-text-stroke-width.js +16 -0
- package/dist/lib/css/property-descriptors/word-break.js +26 -0
- package/dist/lib/css/property-descriptors/writing-mode.js +28 -0
- package/dist/lib/css/property-descriptors/z-index.js +19 -0
- package/dist/lib/css/property-descriptors/zoom.js +18 -0
- package/dist/lib/css/syntax/parser.js +140 -0
- package/dist/lib/css/syntax/token-constants.js +214 -0
- package/dist/lib/css/syntax/token-singletons.js +36 -0
- package/dist/lib/css/syntax/token-types.js +10 -0
- package/dist/lib/css/syntax/tokenizer.js +502 -0
- package/dist/lib/css/type-descriptor.js +2 -0
- package/dist/lib/css/types/angle.js +80 -0
- package/dist/lib/css/types/color-math.js +25 -0
- package/dist/lib/css/types/color-spaces/a98.js +78 -0
- package/dist/lib/css/types/color-spaces/p3.js +86 -0
- package/dist/lib/css/types/color-spaces/pro-photo.js +83 -0
- package/dist/lib/css/types/color-spaces/rec2020.js +85 -0
- package/dist/lib/css/types/color-spaces/srgb.js +79 -0
- package/dist/lib/css/types/color-utilities.js +342 -0
- package/dist/lib/css/types/color.js +400 -0
- package/dist/lib/css/types/functions/-prefix-linear-gradient.js +32 -0
- package/dist/lib/css/types/functions/-prefix-radial-gradient.js +83 -0
- package/dist/lib/css/types/functions/-webkit-gradient.js +59 -0
- package/dist/lib/css/types/functions/counter.js +367 -0
- package/dist/lib/css/types/functions/gradient.js +163 -0
- package/dist/lib/css/types/functions/linear-gradient.js +27 -0
- package/dist/lib/css/types/functions/radial-gradient.js +90 -0
- package/dist/lib/css/types/functions/repeating-linear-gradient.js +9 -0
- package/dist/lib/css/types/image.js +62 -0
- package/dist/lib/css/types/index.js +2 -0
- package/dist/lib/css/types/length-percentage.js +197 -0
- package/dist/lib/css/types/length.js +5 -0
- package/dist/lib/css/types/safe-eval.js +80 -0
- package/dist/lib/css/types/time.js +17 -0
- package/dist/lib/dom/document-cloner.js +597 -0
- package/dist/lib/dom/dom-normalizer.js +115 -0
- package/dist/lib/dom/element-container.js +56 -0
- package/dist/lib/dom/elements/li-element-container.js +11 -0
- package/dist/lib/dom/elements/ol-element-container.js +12 -0
- package/dist/lib/dom/elements/select-element-container.js +12 -0
- package/dist/lib/dom/elements/textarea-element-container.js +11 -0
- package/dist/lib/dom/node-parser.js +112 -0
- package/dist/lib/dom/node-type-guards.js +81 -0
- package/dist/lib/dom/replaced-elements/canvas-element-container.js +13 -0
- package/dist/lib/dom/replaced-elements/iframe-element-container.js +38 -0
- package/dist/lib/dom/replaced-elements/image-element-container.js +14 -0
- package/dist/lib/dom/replaced-elements/index.js +2 -0
- package/dist/lib/dom/replaced-elements/input-element-container.js +89 -0
- package/dist/lib/dom/replaced-elements/svg-element-container.js +19 -0
- package/dist/lib/dom/slot-cloner.js +176 -0
- package/dist/lib/dom/text-container.js +35 -0
- package/dist/lib/index.js +49 -0
- package/dist/lib/options.js +2 -0
- package/dist/lib/render/background.js +188 -0
- package/dist/lib/render/bezier-curve.js +34 -0
- package/dist/lib/render/border.js +104 -0
- package/dist/lib/render/bound-curves.js +188 -0
- package/dist/lib/render/box-sizing.js +20 -0
- package/dist/lib/render/canvas/background-renderer.js +327 -0
- package/dist/lib/render/canvas/border-image-renderer.js +153 -0
- package/dist/lib/render/canvas/border-renderer.js +184 -0
- package/dist/lib/render/canvas/canvas-path.js +25 -0
- package/dist/lib/render/canvas/canvas-renderer.js +312 -0
- package/dist/lib/render/canvas/content-renderer.js +204 -0
- package/dist/lib/render/canvas/effects-renderer.js +171 -0
- package/dist/lib/render/canvas/font-utils.js +29 -0
- package/dist/lib/render/canvas/foreignobject-renderer.js +38 -0
- package/dist/lib/render/canvas/text/text-decoration-renderer.js +99 -0
- package/dist/lib/render/canvas/text-renderer.js +485 -0
- package/dist/lib/render/effects.js +231 -0
- package/dist/lib/render/font-metrics.js +53 -0
- package/dist/lib/render/object-fit.js +91 -0
- package/dist/lib/render/path.js +26 -0
- package/dist/lib/render/renderer-interface.js +2 -0
- package/dist/lib/render/stacking-context.js +340 -0
- package/dist/lib/render/vector.js +16 -0
- package/dist/types/config.d.ts +44 -0
- package/dist/types/core/abort-helper.d.ts +12 -0
- package/dist/types/core/background-parser.d.ts +16 -0
- package/dist/types/core/bitwise.d.ts +1 -0
- package/dist/types/core/cache-storage.d.ts +68 -0
- package/dist/types/core/config-assembler.d.ts +28 -0
- package/dist/types/core/constants.d.ts +22 -0
- package/dist/types/core/context.d.ts +22 -0
- package/dist/types/core/debugger.d.ts +8 -0
- package/dist/types/core/features.d.ts +12 -0
- package/dist/types/core/logger.d.ts +18 -0
- package/dist/types/core/lru-map.d.ts +37 -0
- package/dist/types/core/origin-checker.d.ts +33 -0
- package/dist/types/core/performance-monitor.d.ts +120 -0
- package/dist/types/core/render-element.d.ts +3 -0
- package/dist/types/core/util.d.ts +1 -0
- package/dist/types/core/validator.d.ts +130 -0
- package/dist/types/css/grouped/background-styles.d.ts +16 -0
- package/dist/types/css/grouped/border-styles.d.ts +31 -0
- package/dist/types/css/grouped/font-styles.d.ts +35 -0
- package/dist/types/css/grouped/layout-styles.d.ts +46 -0
- package/dist/types/css/index.d.ts +185 -0
- package/dist/types/css/layout/bounds.d.ts +14 -0
- package/dist/types/css/layout/text.d.ts +10 -0
- package/dist/types/css/property-descriptor.d.ts +40 -0
- package/dist/types/css/property-descriptors/background-blend-mode.d.ts +23 -0
- package/dist/types/css/property-descriptors/background-clip.d.ts +8 -0
- package/dist/types/css/property-descriptors/background-color.d.ts +2 -0
- package/dist/types/css/property-descriptors/background-image.d.ts +3 -0
- package/dist/types/css/property-descriptors/background-origin.d.ts +8 -0
- package/dist/types/css/property-descriptors/background-position.d.ts +5 -0
- package/dist/types/css/property-descriptors/background-repeat.d.ts +9 -0
- package/dist/types/css/property-descriptors/background-size.d.ts +11 -0
- package/dist/types/css/property-descriptors/border-color.d.ts +5 -0
- package/dist/types/css/property-descriptors/border-image-repeat.d.ts +12 -0
- package/dist/types/css/property-descriptors/border-image-slice.d.ts +10 -0
- package/dist/types/css/property-descriptors/border-image-source.d.ts +4 -0
- package/dist/types/css/property-descriptors/border-radius.d.ts +7 -0
- package/dist/types/css/property-descriptors/border-style.d.ts +12 -0
- package/dist/types/css/property-descriptors/border-width.d.ts +5 -0
- package/dist/types/css/property-descriptors/box-decoration-break.d.ts +6 -0
- package/dist/types/css/property-descriptors/box-shadow.d.ts +14 -0
- package/dist/types/css/property-descriptors/clip-path.d.ts +62 -0
- package/dist/types/css/property-descriptors/color.d.ts +2 -0
- package/dist/types/css/property-descriptors/content.d.ts +4 -0
- package/dist/types/css/property-descriptors/counter-increment.d.ts +10 -0
- package/dist/types/css/property-descriptors/counter-reset.d.ts +7 -0
- package/dist/types/css/property-descriptors/direction.d.ts +6 -0
- package/dist/types/css/property-descriptors/display.d.ts +35 -0
- package/dist/types/css/property-descriptors/duration.d.ts +2 -0
- package/dist/types/css/property-descriptors/filter.d.ts +3 -0
- package/dist/types/css/property-descriptors/float.d.ts +9 -0
- package/dist/types/css/property-descriptors/font-family.d.ts +4 -0
- package/dist/types/css/property-descriptors/font-size.d.ts +2 -0
- package/dist/types/css/property-descriptors/font-style.d.ts +7 -0
- package/dist/types/css/property-descriptors/font-variant-ligatures.d.ts +14 -0
- package/dist/types/css/property-descriptors/font-variant.d.ts +2 -0
- package/dist/types/css/property-descriptors/font-weight.d.ts +2 -0
- package/dist/types/css/property-descriptors/image-rendering.d.ts +8 -0
- package/dist/types/css/property-descriptors/letter-spacing.d.ts +2 -0
- package/dist/types/css/property-descriptors/line-break.d.ts +6 -0
- package/dist/types/css/property-descriptors/line-height.d.ts +4 -0
- package/dist/types/css/property-descriptors/list-style-image.d.ts +3 -0
- package/dist/types/css/property-descriptors/list-style-position.d.ts +6 -0
- package/dist/types/css/property-descriptors/list-style-type.d.ts +58 -0
- package/dist/types/css/property-descriptors/margin.d.ts +5 -0
- package/dist/types/css/property-descriptors/mix-blend-mode.d.ts +21 -0
- package/dist/types/css/property-descriptors/object-fit.d.ts +10 -0
- package/dist/types/css/property-descriptors/object-position.d.ts +4 -0
- package/dist/types/css/property-descriptors/opacity.d.ts +2 -0
- package/dist/types/css/property-descriptors/overflow-wrap.d.ts +6 -0
- package/dist/types/css/property-descriptors/overflow.d.ts +9 -0
- package/dist/types/css/property-descriptors/padding.d.ts +5 -0
- package/dist/types/css/property-descriptors/paint-order.d.ts +8 -0
- package/dist/types/css/property-descriptors/position.d.ts +9 -0
- package/dist/types/css/property-descriptors/quotes.d.ts +8 -0
- package/dist/types/css/property-descriptors/rotate.d.ts +3 -0
- package/dist/types/css/property-descriptors/text-align.d.ts +7 -0
- package/dist/types/css/property-descriptors/text-decoration-color.d.ts +2 -0
- package/dist/types/css/property-descriptors/text-decoration-line.d.ts +10 -0
- package/dist/types/css/property-descriptors/text-decoration-style.d.ts +9 -0
- package/dist/types/css/property-descriptors/text-decoration-thickness.d.ts +3 -0
- package/dist/types/css/property-descriptors/text-overflow.d.ts +6 -0
- package/dist/types/css/property-descriptors/text-shadow.d.ts +12 -0
- package/dist/types/css/property-descriptors/text-transform.d.ts +8 -0
- package/dist/types/css/property-descriptors/text-underline-offset.d.ts +3 -0
- package/dist/types/css/property-descriptors/transform-origin.d.ts +4 -0
- package/dist/types/css/property-descriptors/transform.d.ts +4 -0
- package/dist/types/css/property-descriptors/visibility.d.ts +7 -0
- package/dist/types/css/property-descriptors/webkit-line-clamp.d.ts +7 -0
- package/dist/types/css/property-descriptors/webkit-text-stroke-color.d.ts +2 -0
- package/dist/types/css/property-descriptors/webkit-text-stroke-width.d.ts +2 -0
- package/dist/types/css/property-descriptors/word-break.d.ts +7 -0
- package/dist/types/css/property-descriptors/writing-mode.d.ts +11 -0
- package/dist/types/css/property-descriptors/z-index.d.ts +7 -0
- package/dist/types/css/property-descriptors/zoom.d.ts +3 -0
- package/dist/types/css/syntax/parser.d.ts +34 -0
- package/dist/types/css/syntax/token-constants.d.ts +74 -0
- package/dist/types/css/syntax/token-singletons.d.ts +22 -0
- package/dist/types/css/syntax/token-types.d.ts +72 -0
- package/dist/types/css/syntax/tokenizer.d.ts +32 -0
- package/dist/types/css/type-descriptor.d.ts +6 -0
- package/dist/types/css/types/angle.d.ts +7 -0
- package/dist/types/css/types/color-math.d.ts +12 -0
- package/dist/types/css/types/color-spaces/a98.d.ts +39 -0
- package/dist/types/css/types/color-spaces/p3.d.ts +45 -0
- package/dist/types/css/types/color-spaces/pro-photo.d.ts +45 -0
- package/dist/types/css/types/color-spaces/rec2020.d.ts +45 -0
- package/dist/types/css/types/color-spaces/srgb.d.ts +38 -0
- package/dist/types/css/types/color-utilities.d.ts +107 -0
- package/dist/types/css/types/color.d.ts +8 -0
- package/dist/types/css/types/functions/-prefix-linear-gradient.d.ts +4 -0
- package/dist/types/css/types/functions/-prefix-radial-gradient.d.ts +4 -0
- package/dist/types/css/types/functions/-webkit-gradient.d.ts +4 -0
- package/dist/types/css/types/functions/counter.d.ts +10 -0
- package/dist/types/css/types/functions/gradient.d.ts +7 -0
- package/dist/types/css/types/functions/linear-gradient.d.ts +4 -0
- package/dist/types/css/types/functions/radial-gradient.d.ts +12 -0
- package/dist/types/css/types/functions/repeating-linear-gradient.d.ts +4 -0
- package/dist/types/css/types/image.d.ts +56 -0
- package/dist/types/css/types/index.d.ts +1 -0
- package/dist/types/css/types/length-percentage.d.ts +62 -0
- package/dist/types/css/types/length.d.ts +4 -0
- package/dist/types/css/types/safe-eval.d.ts +8 -0
- package/dist/types/css/types/time.d.ts +2 -0
- package/dist/types/dom/document-cloner.d.ts +57 -0
- package/dist/types/dom/dom-normalizer.d.ts +62 -0
- package/dist/types/dom/element-container.d.ts +31 -0
- package/dist/types/dom/elements/li-element-container.d.ts +6 -0
- package/dist/types/dom/elements/ol-element-container.d.ts +7 -0
- package/dist/types/dom/elements/select-element-container.d.ts +6 -0
- package/dist/types/dom/elements/textarea-element-container.d.ts +6 -0
- package/dist/types/dom/node-parser.d.ts +3 -0
- package/dist/types/dom/node-type-guards.d.ts +32 -0
- package/dist/types/dom/replaced-elements/canvas-element-container.d.ts +8 -0
- package/dist/types/dom/replaced-elements/iframe-element-container.d.ts +14 -0
- package/dist/types/dom/replaced-elements/image-element-container.d.ts +8 -0
- package/dist/types/dom/replaced-elements/index.d.ts +4 -0
- package/dist/types/dom/replaced-elements/input-element-container.d.ts +14 -0
- package/dist/types/dom/replaced-elements/svg-element-container.d.ts +8 -0
- package/dist/types/dom/slot-cloner.d.ts +66 -0
- package/dist/types/dom/text-container.d.ts +8 -0
- package/dist/types/index.d.ts +36 -0
- package/dist/types/options.d.ts +62 -0
- package/dist/types/render/background.d.ts +16 -0
- package/dist/types/render/bezier-curve.d.ts +14 -0
- package/dist/types/render/border.d.ts +6 -0
- package/dist/types/render/bound-curves.d.ts +32 -0
- package/dist/types/render/box-sizing.d.ts +4 -0
- package/dist/types/render/canvas/background-renderer.d.ts +94 -0
- package/dist/types/render/canvas/border-image-renderer.d.ts +18 -0
- package/dist/types/render/canvas/border-renderer.d.ts +67 -0
- package/dist/types/render/canvas/canvas-path.d.ts +3 -0
- package/dist/types/render/canvas/canvas-renderer.d.ts +60 -0
- package/dist/types/render/canvas/content-renderer.d.ts +43 -0
- package/dist/types/render/canvas/effects-renderer.d.ts +90 -0
- package/dist/types/render/canvas/font-utils.d.ts +19 -0
- package/dist/types/render/canvas/foreignobject-renderer.d.ts +10 -0
- package/dist/types/render/canvas/text/text-decoration-renderer.d.ts +18 -0
- package/dist/types/render/canvas/text-renderer.d.ts +103 -0
- package/dist/types/render/effects.d.ts +112 -0
- package/dist/types/render/font-metrics.d.ts +11 -0
- package/dist/types/render/object-fit.d.ts +19 -0
- package/dist/types/render/path.d.ts +13 -0
- package/dist/types/render/renderer-interface.d.ts +28 -0
- package/dist/types/render/stacking-context.d.ts +49 -0
- package/dist/types/render/vector.d.ts +9 -0
- package/package.json +139 -4
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Origin Checker
|
|
3
|
+
*
|
|
4
|
+
* Provides origin checking functionality without global static state.
|
|
5
|
+
* Each instance maintains its own anchor element and origin reference.
|
|
6
|
+
*
|
|
7
|
+
* Replaces the static methods in CacheStorage with instance-based approach.
|
|
8
|
+
*/
|
|
9
|
+
export declare class OriginChecker {
|
|
10
|
+
private readonly link;
|
|
11
|
+
private readonly origin;
|
|
12
|
+
constructor(window: Window);
|
|
13
|
+
/**
|
|
14
|
+
* Get the origin (protocol + hostname + port) of a URL
|
|
15
|
+
*
|
|
16
|
+
* @param url - URL to parse
|
|
17
|
+
* @returns Origin string (e.g., "https://example.com:8080")
|
|
18
|
+
*/
|
|
19
|
+
getOrigin(url: string): string;
|
|
20
|
+
/**
|
|
21
|
+
* Check if a URL is from the same origin as the context
|
|
22
|
+
*
|
|
23
|
+
* @param src - URL to check
|
|
24
|
+
* @returns true if same origin, false otherwise
|
|
25
|
+
*/
|
|
26
|
+
isSameOrigin(src: string): boolean;
|
|
27
|
+
/**
|
|
28
|
+
* Get the current context origin
|
|
29
|
+
*
|
|
30
|
+
* @returns The origin of the context window
|
|
31
|
+
*/
|
|
32
|
+
getContextOrigin(): string;
|
|
33
|
+
}
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
import { Context } from './context';
|
|
2
|
+
/**
|
|
3
|
+
* Performance Metric
|
|
4
|
+
*
|
|
5
|
+
* Represents a single performance measurement
|
|
6
|
+
*/
|
|
7
|
+
export interface PerformanceMetric {
|
|
8
|
+
name: string;
|
|
9
|
+
startTime: number;
|
|
10
|
+
endTime?: number;
|
|
11
|
+
duration?: number;
|
|
12
|
+
metadata?: Record<string, unknown>;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Performance Summary
|
|
16
|
+
*
|
|
17
|
+
* Aggregated performance data
|
|
18
|
+
*/
|
|
19
|
+
export interface PerformanceSummary {
|
|
20
|
+
totalDuration: number;
|
|
21
|
+
metrics: PerformanceMetric[];
|
|
22
|
+
breakdown: Array<{
|
|
23
|
+
name: string;
|
|
24
|
+
duration: number;
|
|
25
|
+
percentage: string;
|
|
26
|
+
}>;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Performance Monitor
|
|
30
|
+
*
|
|
31
|
+
* Tracks performance metrics throughout the rendering pipeline.
|
|
32
|
+
* Provides insights into where time is spent during rendering.
|
|
33
|
+
*
|
|
34
|
+
* Usage:
|
|
35
|
+
* ```typescript
|
|
36
|
+
* const monitor = new PerformanceMonitor(context);
|
|
37
|
+
*
|
|
38
|
+
* monitor.start('clone');
|
|
39
|
+
* await cloneDocument();
|
|
40
|
+
* monitor.end('clone');
|
|
41
|
+
*
|
|
42
|
+
* const summary = monitor.getSummary();
|
|
43
|
+
* ```
|
|
44
|
+
*/
|
|
45
|
+
export declare class PerformanceMonitor {
|
|
46
|
+
private readonly context;
|
|
47
|
+
private readonly activeMetrics;
|
|
48
|
+
private readonly completedMetrics;
|
|
49
|
+
private readonly enabled;
|
|
50
|
+
private readonly getTime;
|
|
51
|
+
constructor(context: Context | null, enabled?: boolean);
|
|
52
|
+
/**
|
|
53
|
+
* Start measuring a performance metric
|
|
54
|
+
*
|
|
55
|
+
* @param name - Unique name for this metric
|
|
56
|
+
* @param metadata - Optional metadata to attach
|
|
57
|
+
*/
|
|
58
|
+
start(name: string, metadata?: Record<string, unknown>): void;
|
|
59
|
+
/**
|
|
60
|
+
* End measuring a performance metric
|
|
61
|
+
*
|
|
62
|
+
* @param name - Name of the metric to end
|
|
63
|
+
* @returns The completed metric, or undefined if not found
|
|
64
|
+
*/
|
|
65
|
+
end(name: string): PerformanceMetric | undefined;
|
|
66
|
+
/**
|
|
67
|
+
* Measure a synchronous function
|
|
68
|
+
*
|
|
69
|
+
* @param name - Name for this measurement
|
|
70
|
+
* @param fn - Function to measure
|
|
71
|
+
* @param metadata - Optional metadata
|
|
72
|
+
* @returns The function's return value
|
|
73
|
+
*/
|
|
74
|
+
measure<T>(name: string, fn: () => T, metadata?: Record<string, unknown>): T;
|
|
75
|
+
/**
|
|
76
|
+
* Measure an asynchronous function
|
|
77
|
+
*
|
|
78
|
+
* @param name - Name for this measurement
|
|
79
|
+
* @param fn - Async function to measure
|
|
80
|
+
* @param metadata - Optional metadata
|
|
81
|
+
* @returns Promise resolving to the function's return value
|
|
82
|
+
*/
|
|
83
|
+
measureAsync<T>(name: string, fn: () => Promise<T>, metadata?: Record<string, unknown>): Promise<T>;
|
|
84
|
+
/**
|
|
85
|
+
* Get all completed metrics
|
|
86
|
+
*
|
|
87
|
+
* @returns Array of completed performance metrics
|
|
88
|
+
*/
|
|
89
|
+
getMetrics(): PerformanceMetric[];
|
|
90
|
+
/**
|
|
91
|
+
* Get a specific metric by name
|
|
92
|
+
*
|
|
93
|
+
* @param name - Metric name
|
|
94
|
+
* @returns The metric, or undefined if not found
|
|
95
|
+
*/
|
|
96
|
+
getMetric(name: string): PerformanceMetric | undefined;
|
|
97
|
+
/**
|
|
98
|
+
* Get performance summary
|
|
99
|
+
*
|
|
100
|
+
* @returns Aggregated performance data
|
|
101
|
+
*/
|
|
102
|
+
getSummary(): PerformanceSummary;
|
|
103
|
+
/**
|
|
104
|
+
* Log performance summary to console
|
|
105
|
+
*/
|
|
106
|
+
logSummary(): void;
|
|
107
|
+
/**
|
|
108
|
+
* Clear all metrics
|
|
109
|
+
*/
|
|
110
|
+
clear(): void;
|
|
111
|
+
/**
|
|
112
|
+
* Check if monitoring is enabled
|
|
113
|
+
*/
|
|
114
|
+
isEnabled(): boolean;
|
|
115
|
+
/**
|
|
116
|
+
* Get active (uncompleted) metrics
|
|
117
|
+
* Useful for debugging leaked measurements
|
|
118
|
+
*/
|
|
119
|
+
getActiveMetrics(): string[];
|
|
120
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const SMALL_IMAGE = "data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7";
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Input Validator
|
|
3
|
+
*
|
|
4
|
+
* Provides validation and sanitization for user inputs to prevent security vulnerabilities
|
|
5
|
+
* including SSRF, XSS, and injection attacks.
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* Validation result
|
|
9
|
+
*/
|
|
10
|
+
export interface ValidationResult {
|
|
11
|
+
valid: boolean;
|
|
12
|
+
error?: string;
|
|
13
|
+
sanitized?: unknown;
|
|
14
|
+
/** Indicates if runtime validation is recommended (e.g. for proxy URLs against DNS rebinding) */
|
|
15
|
+
requiresRuntimeCheck?: boolean;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Validator configuration
|
|
19
|
+
*/
|
|
20
|
+
export interface ValidatorConfig {
|
|
21
|
+
/**
|
|
22
|
+
* Allowed proxy domains for SSRF prevention
|
|
23
|
+
* If empty, no domain restrictions
|
|
24
|
+
*/
|
|
25
|
+
allowedProxyDomains?: string[];
|
|
26
|
+
/**
|
|
27
|
+
* Allow localhost/127.0.0.1 as proxy URL. Only set for development or test (e.g. Karma reftests).
|
|
28
|
+
* @default false
|
|
29
|
+
*/
|
|
30
|
+
allowLocalhostProxy?: boolean;
|
|
31
|
+
/**
|
|
32
|
+
* Maximum allowed image timeout in milliseconds
|
|
33
|
+
*/
|
|
34
|
+
maxImageTimeout?: number;
|
|
35
|
+
/**
|
|
36
|
+
* Whether to allow data URLs
|
|
37
|
+
*/
|
|
38
|
+
allowDataUrls?: boolean;
|
|
39
|
+
/**
|
|
40
|
+
* Custom validation function
|
|
41
|
+
*/
|
|
42
|
+
/** Custom validation function. Receives the raw value and its semantic type. */
|
|
43
|
+
customValidator?: (value: unknown, type: string) => ValidationResult;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Input Validator
|
|
47
|
+
*
|
|
48
|
+
* Validates and sanitizes user inputs for security and correctness.
|
|
49
|
+
*/
|
|
50
|
+
export declare class Validator {
|
|
51
|
+
private readonly config;
|
|
52
|
+
constructor(config?: ValidatorConfig);
|
|
53
|
+
/**
|
|
54
|
+
* Validate a URL
|
|
55
|
+
*
|
|
56
|
+
* @param url - URL to validate
|
|
57
|
+
* @param context - Context for validation (e.g., 'proxy', 'image')
|
|
58
|
+
* @returns Validation result
|
|
59
|
+
*/
|
|
60
|
+
validateUrl(url: string, context?: 'proxy' | 'image' | 'general'): ValidationResult;
|
|
61
|
+
/**
|
|
62
|
+
* Check if a hostname is a private IP address
|
|
63
|
+
*/
|
|
64
|
+
private isPrivateIP;
|
|
65
|
+
/**
|
|
66
|
+
* Check if an IPv6 address is private or special
|
|
67
|
+
* Handles compressed IPv6 addresses (e.g., ::1, fc00::1)
|
|
68
|
+
*/
|
|
69
|
+
private isPrivateIPv6;
|
|
70
|
+
/**
|
|
71
|
+
* Expand compressed IPv6 address to full form
|
|
72
|
+
* e.g., "::1" -> "0000:0000:0000:0000:0000:0000:0000:0001"
|
|
73
|
+
*/
|
|
74
|
+
private expandIPv6;
|
|
75
|
+
/**
|
|
76
|
+
* Fallback prefix matching for IPv6 when expansion fails
|
|
77
|
+
*/
|
|
78
|
+
private isPrivateIPv6Prefix;
|
|
79
|
+
/**
|
|
80
|
+
* Validate CSP nonce
|
|
81
|
+
*
|
|
82
|
+
* @param nonce - CSP nonce to validate
|
|
83
|
+
* @returns Validation result
|
|
84
|
+
*/
|
|
85
|
+
validateCspNonce(nonce: string): ValidationResult;
|
|
86
|
+
/**
|
|
87
|
+
* Validate image timeout
|
|
88
|
+
*
|
|
89
|
+
* @param timeout - Timeout in milliseconds
|
|
90
|
+
* @returns Validation result
|
|
91
|
+
*/
|
|
92
|
+
validateImageTimeout(timeout: number): ValidationResult;
|
|
93
|
+
/**
|
|
94
|
+
* Validate window dimensions
|
|
95
|
+
*
|
|
96
|
+
* @param width - Window width
|
|
97
|
+
* @param height - Window height
|
|
98
|
+
* @returns Validation result
|
|
99
|
+
*/
|
|
100
|
+
validateDimensions(width: number, height: number): ValidationResult;
|
|
101
|
+
/**
|
|
102
|
+
* Validate scale factor
|
|
103
|
+
*
|
|
104
|
+
* @param scale - Scale factor
|
|
105
|
+
* @returns Validation result
|
|
106
|
+
*/
|
|
107
|
+
validateScale(scale: number): ValidationResult;
|
|
108
|
+
/**
|
|
109
|
+
* Validate HTML element
|
|
110
|
+
*
|
|
111
|
+
* @param element - Element to validate
|
|
112
|
+
* @returns Validation result
|
|
113
|
+
*/
|
|
114
|
+
validateElement(element: unknown): ValidationResult;
|
|
115
|
+
/**
|
|
116
|
+
* Validate entire options object
|
|
117
|
+
*
|
|
118
|
+
* @param options - Options to validate
|
|
119
|
+
* @returns Validation result with all errors
|
|
120
|
+
*/
|
|
121
|
+
validateOptions(options: Record<string, unknown>): ValidationResult;
|
|
122
|
+
}
|
|
123
|
+
/**
|
|
124
|
+
* Create a default validator instance
|
|
125
|
+
*/
|
|
126
|
+
export declare function createDefaultValidator(config?: ValidatorConfig): Validator;
|
|
127
|
+
/**
|
|
128
|
+
* Create a strict validator with security-focused settings
|
|
129
|
+
*/
|
|
130
|
+
export declare function createStrictValidator(allowedProxyDomains: string[]): Validator;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { CSSParsedDeclaration } from '../index';
|
|
2
|
+
/**
|
|
3
|
+
* Read-only grouped accessor for background-related CSS properties.
|
|
4
|
+
*/
|
|
5
|
+
export declare class BackgroundStyles {
|
|
6
|
+
private readonly styles;
|
|
7
|
+
constructor(styles: CSSParsedDeclaration);
|
|
8
|
+
get color(): number;
|
|
9
|
+
get image(): import("../types/image").ICSSImage[];
|
|
10
|
+
get clip(): import("../property-descriptors/background-clip").BackgroundClip;
|
|
11
|
+
get origin(): import("../property-descriptors/background-origin").BackgroundOrigin;
|
|
12
|
+
get position(): import("../property-descriptors/background-position").BackgroundPosition;
|
|
13
|
+
get repeat(): import("../property-descriptors/background-repeat").BackgroundRepeat;
|
|
14
|
+
get size(): import("../property-descriptors/background-size").BackgroundSize;
|
|
15
|
+
get blendMode(): import("../property-descriptors/background-blend-mode").BackgroundBlendMode;
|
|
16
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type { CSSParsedDeclaration } from '../index';
|
|
2
|
+
/**
|
|
3
|
+
* Read-only grouped accessor for border-related CSS properties.
|
|
4
|
+
*
|
|
5
|
+
* Provides structured access: `styles.border.topColor` as an alternative
|
|
6
|
+
* to the flat `styles.borderTopColor`. Both forms remain valid.
|
|
7
|
+
*/
|
|
8
|
+
export declare class BorderStyles {
|
|
9
|
+
private readonly styles;
|
|
10
|
+
constructor(styles: CSSParsedDeclaration);
|
|
11
|
+
get topColor(): number;
|
|
12
|
+
get rightColor(): number;
|
|
13
|
+
get bottomColor(): number;
|
|
14
|
+
get leftColor(): number;
|
|
15
|
+
get topStyle(): import("../property-descriptors/border-style").BORDER_STYLE;
|
|
16
|
+
get rightStyle(): import("../property-descriptors/border-style").BORDER_STYLE;
|
|
17
|
+
get bottomStyle(): import("../property-descriptors/border-style").BORDER_STYLE;
|
|
18
|
+
get leftStyle(): import("../property-descriptors/border-style").BORDER_STYLE;
|
|
19
|
+
get topWidth(): number;
|
|
20
|
+
get rightWidth(): number;
|
|
21
|
+
get bottomWidth(): number;
|
|
22
|
+
get leftWidth(): number;
|
|
23
|
+
get topLeftRadius(): import("../types/length-percentage").LengthPercentageTuple;
|
|
24
|
+
get topRightRadius(): import("../types/length-percentage").LengthPercentageTuple;
|
|
25
|
+
get bottomRightRadius(): import("../types/length-percentage").LengthPercentageTuple;
|
|
26
|
+
get bottomLeftRadius(): import("../types/length-percentage").LengthPercentageTuple;
|
|
27
|
+
get imageSource(): import("../property-descriptors/border-image-source").BorderImageSource;
|
|
28
|
+
get imageSlice(): import("../property-descriptors/border-image-slice").BorderImageSlice;
|
|
29
|
+
get imageRepeat(): import("../property-descriptors/border-image-repeat").BorderImageRepeat;
|
|
30
|
+
get boxShadow(): import("../property-descriptors/box-shadow").BoxShadow;
|
|
31
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type { CSSParsedDeclaration } from '../index';
|
|
2
|
+
/**
|
|
3
|
+
* Read-only grouped accessor for font/text-related CSS properties.
|
|
4
|
+
*/
|
|
5
|
+
export declare class FontStyles {
|
|
6
|
+
private readonly styles;
|
|
7
|
+
constructor(styles: CSSParsedDeclaration);
|
|
8
|
+
get family(): import("../property-descriptors/font-family").FontFamily;
|
|
9
|
+
get size(): import("../types/length-percentage").LengthPercentage;
|
|
10
|
+
get style(): import("../property-descriptors/font-style").FONT_STYLE;
|
|
11
|
+
get variant(): string[];
|
|
12
|
+
get weight(): number;
|
|
13
|
+
get ligatures(): import("../property-descriptors/font-variant-ligatures").FONT_VARIANT_LIGATURES;
|
|
14
|
+
get color(): number;
|
|
15
|
+
get letterSpacing(): number;
|
|
16
|
+
get lineHeight(): import("../syntax/parser").CSSValue;
|
|
17
|
+
get textAlign(): import("../property-descriptors/text-align").TEXT_ALIGN;
|
|
18
|
+
get textTransform(): import("../property-descriptors/text-transform").TEXT_TRANSFORM;
|
|
19
|
+
get textOverflow(): import("../property-descriptors/text-overflow").TEXT_OVERFLOW;
|
|
20
|
+
get textShadow(): import("../property-descriptors/text-shadow").TextShadow;
|
|
21
|
+
get textDecorationColor(): number;
|
|
22
|
+
get textDecorationLine(): import("../property-descriptors/text-decoration-line").TextDecorationLine;
|
|
23
|
+
get textDecorationStyle(): import("../property-descriptors/text-decoration-style").TEXT_DECORATION_STYLE;
|
|
24
|
+
get textDecorationThickness(): import("../property-descriptors/text-decoration-thickness").TextDecorationThickness;
|
|
25
|
+
get textUnderlineOffset(): import("../property-descriptors/text-underline-offset").TextUnderlineOffset;
|
|
26
|
+
get wordBreak(): import("../property-descriptors/word-break").WORD_BREAK;
|
|
27
|
+
get lineBreak(): import("../property-descriptors/line-break").LINE_BREAK;
|
|
28
|
+
get overflowWrap(): import("../property-descriptors/overflow-wrap").OVERFLOW_WRAP;
|
|
29
|
+
get writingMode(): import("../property-descriptors/writing-mode").WRITING_MODE;
|
|
30
|
+
get direction(): import("../property-descriptors/direction").DIRECTION;
|
|
31
|
+
get webkitTextStrokeColor(): number;
|
|
32
|
+
get webkitTextStrokeWidth(): number;
|
|
33
|
+
get webkitLineClamp(): number;
|
|
34
|
+
get paintOrder(): import("../property-descriptors/paint-order").PaintOrder;
|
|
35
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import type { CSSParsedDeclaration } from '../index';
|
|
2
|
+
/**
|
|
3
|
+
* Read-only grouped accessor for layout/display/positioning CSS properties.
|
|
4
|
+
*/
|
|
5
|
+
export declare class LayoutStyles {
|
|
6
|
+
private readonly styles;
|
|
7
|
+
constructor(styles: CSSParsedDeclaration);
|
|
8
|
+
get display(): number;
|
|
9
|
+
get position(): import("../property-descriptors/position").POSITION;
|
|
10
|
+
get float(): import("../property-descriptors/float").FLOAT;
|
|
11
|
+
get zIndex(): CSSParsedDeclaration['zIndex'];
|
|
12
|
+
get marginTop(): import("../syntax/parser").CSSValue;
|
|
13
|
+
get marginRight(): import("../syntax/parser").CSSValue;
|
|
14
|
+
get marginBottom(): import("../syntax/parser").CSSValue;
|
|
15
|
+
get marginLeft(): import("../syntax/parser").CSSValue;
|
|
16
|
+
get paddingTop(): import("../types/length-percentage").LengthPercentage;
|
|
17
|
+
get paddingRight(): import("../types/length-percentage").LengthPercentage;
|
|
18
|
+
get paddingBottom(): import("../types/length-percentage").LengthPercentage;
|
|
19
|
+
get paddingLeft(): import("../types/length-percentage").LengthPercentage;
|
|
20
|
+
get overflowX(): import("../property-descriptors/overflow").OVERFLOW;
|
|
21
|
+
get overflowY(): import("../property-descriptors/overflow").OVERFLOW;
|
|
22
|
+
get opacity(): number;
|
|
23
|
+
get visibility(): import("../property-descriptors/visibility").VISIBILITY;
|
|
24
|
+
get transform(): import("../property-descriptors/transform").Transform;
|
|
25
|
+
get transformOrigin(): import("../property-descriptors/transform-origin").TransformOrigin;
|
|
26
|
+
get rotate(): import("../property-descriptors/rotate").Rotate;
|
|
27
|
+
get zoom(): number;
|
|
28
|
+
get clipPath(): import("../property-descriptors/clip-path").ClipPathValue;
|
|
29
|
+
get mixBlendMode(): import("../property-descriptors/mix-blend-mode").MixBlendMode;
|
|
30
|
+
get filter(): import("../property-descriptors/filter").FilterValue;
|
|
31
|
+
get imageRendering(): import("../property-descriptors/image-rendering").IMAGE_RENDERING;
|
|
32
|
+
get objectFit(): number;
|
|
33
|
+
get objectPosition(): import("../property-descriptors/object-position").ObjectPosition;
|
|
34
|
+
get boxDecorationBreak(): import("../property-descriptors/box-decoration-break").BOX_DECORATION_BREAK;
|
|
35
|
+
get listStyleImage(): import("../types/image").ICSSImage | null;
|
|
36
|
+
get listStylePosition(): import("../property-descriptors/list-style-position").LIST_STYLE_POSITION;
|
|
37
|
+
get listStyleType(): import("../property-descriptors/list-style-type").LIST_STYLE_TYPE;
|
|
38
|
+
get animationDuration(): number[];
|
|
39
|
+
isVisible(): boolean;
|
|
40
|
+
isTransparent(): boolean;
|
|
41
|
+
isTransformed(): boolean;
|
|
42
|
+
isPositioned(): boolean;
|
|
43
|
+
isPositionedWithZIndex(): boolean;
|
|
44
|
+
isFloating(): boolean;
|
|
45
|
+
isInlineLevel(): boolean;
|
|
46
|
+
}
|
|
@@ -0,0 +1,185 @@
|
|
|
1
|
+
import { backgroundClip } from './property-descriptors/background-clip';
|
|
2
|
+
import { backgroundImage } from './property-descriptors/background-image';
|
|
3
|
+
import { backgroundOrigin } from './property-descriptors/background-origin';
|
|
4
|
+
import { backgroundPosition } from './property-descriptors/background-position';
|
|
5
|
+
import { backgroundRepeat } from './property-descriptors/background-repeat';
|
|
6
|
+
import { backgroundSize } from './property-descriptors/background-size';
|
|
7
|
+
import { borderBottomLeftRadius, borderBottomRightRadius, borderTopLeftRadius, borderTopRightRadius } from './property-descriptors/border-radius';
|
|
8
|
+
import { borderBottomStyle, borderLeftStyle, borderRightStyle, borderTopStyle } from './property-descriptors/border-style';
|
|
9
|
+
import { borderBottomWidth, borderLeftWidth, borderRightWidth, borderTopWidth } from './property-descriptors/border-width';
|
|
10
|
+
import { ClipPathValue } from './property-descriptors/clip-path';
|
|
11
|
+
import { direction } from './property-descriptors/direction';
|
|
12
|
+
import { display } from './property-descriptors/display';
|
|
13
|
+
import { float } from './property-descriptors/float';
|
|
14
|
+
import { letterSpacing } from './property-descriptors/letter-spacing';
|
|
15
|
+
import { lineBreak } from './property-descriptors/line-break';
|
|
16
|
+
import { listStyleImage } from './property-descriptors/list-style-image';
|
|
17
|
+
import { listStylePosition } from './property-descriptors/list-style-position';
|
|
18
|
+
import { listStyleType } from './property-descriptors/list-style-type';
|
|
19
|
+
import { OVERFLOW } from './property-descriptors/overflow';
|
|
20
|
+
import { overflowWrap } from './property-descriptors/overflow-wrap';
|
|
21
|
+
import { textAlign } from './property-descriptors/text-align';
|
|
22
|
+
import { position } from './property-descriptors/position';
|
|
23
|
+
import { textShadow } from './property-descriptors/text-shadow';
|
|
24
|
+
import { textTransform } from './property-descriptors/text-transform';
|
|
25
|
+
import { transform } from './property-descriptors/transform';
|
|
26
|
+
import { transformOrigin } from './property-descriptors/transform-origin';
|
|
27
|
+
import { rotate } from './property-descriptors/rotate';
|
|
28
|
+
import { visibility } from './property-descriptors/visibility';
|
|
29
|
+
import { wordBreak } from './property-descriptors/word-break';
|
|
30
|
+
import { writingMode } from './property-descriptors/writing-mode';
|
|
31
|
+
import { zIndex } from './property-descriptors/z-index';
|
|
32
|
+
import { CSSValue } from './syntax/parser';
|
|
33
|
+
import { Color } from './types/color';
|
|
34
|
+
import { opacity } from './property-descriptors/opacity';
|
|
35
|
+
import { textDecorationLine } from './property-descriptors/text-decoration-line';
|
|
36
|
+
import { textDecorationStyle } from './property-descriptors/text-decoration-style';
|
|
37
|
+
import { textDecorationThickness } from './property-descriptors/text-decoration-thickness';
|
|
38
|
+
import { textUnderlineOffset } from './property-descriptors/text-underline-offset';
|
|
39
|
+
import { LengthPercentage } from './types/length-percentage';
|
|
40
|
+
import { fontFamily } from './property-descriptors/font-family';
|
|
41
|
+
import { fontWeight } from './property-descriptors/font-weight';
|
|
42
|
+
import { fontVariant } from './property-descriptors/font-variant';
|
|
43
|
+
import { fontStyle } from './property-descriptors/font-style';
|
|
44
|
+
import { content } from './property-descriptors/content';
|
|
45
|
+
import { counterIncrement } from './property-descriptors/counter-increment';
|
|
46
|
+
import { counterReset } from './property-descriptors/counter-reset';
|
|
47
|
+
import { duration } from './property-descriptors/duration';
|
|
48
|
+
import { quotes } from './property-descriptors/quotes';
|
|
49
|
+
import { boxShadow } from './property-descriptors/box-shadow';
|
|
50
|
+
import { paintOrder } from './property-descriptors/paint-order';
|
|
51
|
+
import { webkitTextStrokeWidth } from './property-descriptors/webkit-text-stroke-width';
|
|
52
|
+
import { webkitLineClamp } from './property-descriptors/webkit-line-clamp';
|
|
53
|
+
import { Context } from '../core/context';
|
|
54
|
+
import { objectFit } from './property-descriptors/object-fit';
|
|
55
|
+
import { textOverflow } from './property-descriptors/text-overflow';
|
|
56
|
+
import { imageRendering } from './property-descriptors/image-rendering';
|
|
57
|
+
import { MixBlendMode } from './property-descriptors/mix-blend-mode';
|
|
58
|
+
import { filter } from './property-descriptors/filter';
|
|
59
|
+
import { fontVariantLigatures } from './property-descriptors/font-variant-ligatures';
|
|
60
|
+
import { zoom } from './property-descriptors/zoom';
|
|
61
|
+
import { objectPosition } from './property-descriptors/object-position';
|
|
62
|
+
import { backgroundBlendMode } from './property-descriptors/background-blend-mode';
|
|
63
|
+
import { borderImageSource } from './property-descriptors/border-image-source';
|
|
64
|
+
import { borderImageSlice } from './property-descriptors/border-image-slice';
|
|
65
|
+
import { borderImageRepeat } from './property-descriptors/border-image-repeat';
|
|
66
|
+
import { boxDecorationBreak } from './property-descriptors/box-decoration-break';
|
|
67
|
+
import { BorderStyles } from './grouped/border-styles';
|
|
68
|
+
import { BackgroundStyles } from './grouped/background-styles';
|
|
69
|
+
import { FontStyles } from './grouped/font-styles';
|
|
70
|
+
import { LayoutStyles } from './grouped/layout-styles';
|
|
71
|
+
export declare class CSSParsedDeclaration {
|
|
72
|
+
animationDuration: ReturnType<typeof duration.parse>;
|
|
73
|
+
backgroundClip: ReturnType<typeof backgroundClip.parse>;
|
|
74
|
+
backgroundColor: Color;
|
|
75
|
+
backgroundImage: ReturnType<typeof backgroundImage.parse>;
|
|
76
|
+
backgroundOrigin: ReturnType<typeof backgroundOrigin.parse>;
|
|
77
|
+
backgroundPosition: ReturnType<typeof backgroundPosition.parse>;
|
|
78
|
+
backgroundRepeat: ReturnType<typeof backgroundRepeat.parse>;
|
|
79
|
+
backgroundSize: ReturnType<typeof backgroundSize.parse>;
|
|
80
|
+
borderTopColor: Color;
|
|
81
|
+
borderRightColor: Color;
|
|
82
|
+
borderBottomColor: Color;
|
|
83
|
+
borderLeftColor: Color;
|
|
84
|
+
borderTopLeftRadius: ReturnType<typeof borderTopLeftRadius.parse>;
|
|
85
|
+
borderTopRightRadius: ReturnType<typeof borderTopRightRadius.parse>;
|
|
86
|
+
borderBottomRightRadius: ReturnType<typeof borderBottomRightRadius.parse>;
|
|
87
|
+
borderBottomLeftRadius: ReturnType<typeof borderBottomLeftRadius.parse>;
|
|
88
|
+
borderTopStyle: ReturnType<typeof borderTopStyle.parse>;
|
|
89
|
+
borderRightStyle: ReturnType<typeof borderRightStyle.parse>;
|
|
90
|
+
borderBottomStyle: ReturnType<typeof borderBottomStyle.parse>;
|
|
91
|
+
borderLeftStyle: ReturnType<typeof borderLeftStyle.parse>;
|
|
92
|
+
borderTopWidth: ReturnType<typeof borderTopWidth.parse>;
|
|
93
|
+
borderRightWidth: ReturnType<typeof borderRightWidth.parse>;
|
|
94
|
+
borderBottomWidth: ReturnType<typeof borderBottomWidth.parse>;
|
|
95
|
+
borderLeftWidth: ReturnType<typeof borderLeftWidth.parse>;
|
|
96
|
+
boxShadow: ReturnType<typeof boxShadow.parse>;
|
|
97
|
+
clipPath: ClipPathValue;
|
|
98
|
+
color: Color;
|
|
99
|
+
direction: ReturnType<typeof direction.parse>;
|
|
100
|
+
display: ReturnType<typeof display.parse>;
|
|
101
|
+
float: ReturnType<typeof float.parse>;
|
|
102
|
+
fontFamily: ReturnType<typeof fontFamily.parse>;
|
|
103
|
+
fontSize: LengthPercentage;
|
|
104
|
+
fontStyle: ReturnType<typeof fontStyle.parse>;
|
|
105
|
+
fontVariant: ReturnType<typeof fontVariant.parse>;
|
|
106
|
+
fontWeight: ReturnType<typeof fontWeight.parse>;
|
|
107
|
+
letterSpacing: ReturnType<typeof letterSpacing.parse>;
|
|
108
|
+
lineBreak: ReturnType<typeof lineBreak.parse>;
|
|
109
|
+
lineHeight: CSSValue;
|
|
110
|
+
listStyleImage: ReturnType<typeof listStyleImage.parse>;
|
|
111
|
+
listStylePosition: ReturnType<typeof listStylePosition.parse>;
|
|
112
|
+
listStyleType: ReturnType<typeof listStyleType.parse>;
|
|
113
|
+
marginTop: CSSValue;
|
|
114
|
+
marginRight: CSSValue;
|
|
115
|
+
marginBottom: CSSValue;
|
|
116
|
+
marginLeft: CSSValue;
|
|
117
|
+
opacity: ReturnType<typeof opacity.parse>;
|
|
118
|
+
overflowX: OVERFLOW;
|
|
119
|
+
overflowY: OVERFLOW;
|
|
120
|
+
overflowWrap: ReturnType<typeof overflowWrap.parse>;
|
|
121
|
+
paddingTop: LengthPercentage;
|
|
122
|
+
paddingRight: LengthPercentage;
|
|
123
|
+
paddingBottom: LengthPercentage;
|
|
124
|
+
paddingLeft: LengthPercentage;
|
|
125
|
+
paintOrder: ReturnType<typeof paintOrder.parse>;
|
|
126
|
+
position: ReturnType<typeof position.parse>;
|
|
127
|
+
textAlign: ReturnType<typeof textAlign.parse>;
|
|
128
|
+
textDecorationColor: Color;
|
|
129
|
+
textDecorationLine: ReturnType<typeof textDecorationLine.parse>;
|
|
130
|
+
textDecorationStyle: ReturnType<typeof textDecorationStyle.parse>;
|
|
131
|
+
textDecorationThickness: ReturnType<typeof textDecorationThickness.parse>;
|
|
132
|
+
textUnderlineOffset: ReturnType<typeof textUnderlineOffset.parse>;
|
|
133
|
+
textShadow: ReturnType<typeof textShadow.parse>;
|
|
134
|
+
textTransform: ReturnType<typeof textTransform.parse>;
|
|
135
|
+
textOverflow: ReturnType<typeof textOverflow.parse>;
|
|
136
|
+
transform: ReturnType<typeof transform.parse>;
|
|
137
|
+
transformOrigin: ReturnType<typeof transformOrigin.parse>;
|
|
138
|
+
rotate: ReturnType<typeof rotate.parse>;
|
|
139
|
+
visibility: ReturnType<typeof visibility.parse>;
|
|
140
|
+
webkitTextStrokeColor: Color;
|
|
141
|
+
webkitTextStrokeWidth: ReturnType<typeof webkitTextStrokeWidth.parse>;
|
|
142
|
+
webkitLineClamp: ReturnType<typeof webkitLineClamp.parse>;
|
|
143
|
+
wordBreak: ReturnType<typeof wordBreak.parse>;
|
|
144
|
+
writingMode: ReturnType<typeof writingMode.parse>;
|
|
145
|
+
zIndex: ReturnType<typeof zIndex.parse>;
|
|
146
|
+
objectFit: ReturnType<typeof objectFit.parse>;
|
|
147
|
+
imageRendering: ReturnType<typeof imageRendering.parse>;
|
|
148
|
+
mixBlendMode: MixBlendMode;
|
|
149
|
+
filter: ReturnType<typeof filter.parse>;
|
|
150
|
+
fontVariantLigatures: ReturnType<typeof fontVariantLigatures.parse>;
|
|
151
|
+
zoom: ReturnType<typeof zoom.parse>;
|
|
152
|
+
objectPosition: ReturnType<typeof objectPosition.parse>;
|
|
153
|
+
backgroundBlendMode: ReturnType<typeof backgroundBlendMode.parse>;
|
|
154
|
+
borderImageSource: ReturnType<typeof borderImageSource.parse>;
|
|
155
|
+
borderImageSlice: ReturnType<typeof borderImageSlice.parse>;
|
|
156
|
+
borderImageRepeat: ReturnType<typeof borderImageRepeat.parse>;
|
|
157
|
+
boxDecorationBreak: ReturnType<typeof boxDecorationBreak.parse>;
|
|
158
|
+
private _border?;
|
|
159
|
+
private _background?;
|
|
160
|
+
private _font?;
|
|
161
|
+
private _layout?;
|
|
162
|
+
get border(): BorderStyles;
|
|
163
|
+
get background(): BackgroundStyles;
|
|
164
|
+
get font(): FontStyles;
|
|
165
|
+
get layout(): LayoutStyles;
|
|
166
|
+
private static readonly standardProps;
|
|
167
|
+
constructor(context: Context, declaration: CSSStyleDeclaration);
|
|
168
|
+
isVisible(): boolean;
|
|
169
|
+
isTransparent(): boolean;
|
|
170
|
+
isTransformed(): boolean;
|
|
171
|
+
isPositioned(): boolean;
|
|
172
|
+
isPositionedWithZIndex(): boolean;
|
|
173
|
+
isFloating(): boolean;
|
|
174
|
+
isInlineLevel(): boolean;
|
|
175
|
+
}
|
|
176
|
+
export declare class CSSParsedPseudoDeclaration {
|
|
177
|
+
content: ReturnType<typeof content.parse>;
|
|
178
|
+
quotes: ReturnType<typeof quotes.parse>;
|
|
179
|
+
constructor(context: Context, declaration: CSSStyleDeclaration);
|
|
180
|
+
}
|
|
181
|
+
export declare class CSSParsedCounterDeclaration {
|
|
182
|
+
counterIncrement: ReturnType<typeof counterIncrement.parse>;
|
|
183
|
+
counterReset: ReturnType<typeof counterReset.parse>;
|
|
184
|
+
constructor(context: Context, declaration: CSSStyleDeclaration);
|
|
185
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Context } from '../../core/context';
|
|
2
|
+
export declare class Bounds {
|
|
3
|
+
readonly left: number;
|
|
4
|
+
readonly top: number;
|
|
5
|
+
readonly width: number;
|
|
6
|
+
readonly height: number;
|
|
7
|
+
constructor(left: number, top: number, width: number, height: number);
|
|
8
|
+
add(x: number, y: number, w: number, h: number): Bounds;
|
|
9
|
+
static fromClientRect(context: Context, clientRect: ClientRect): Bounds;
|
|
10
|
+
static fromDOMRectList(context: Context, domRectList: DOMRectList): Bounds;
|
|
11
|
+
static EMPTY: Bounds;
|
|
12
|
+
}
|
|
13
|
+
export declare const parseBounds: (context: Context, node: Element) => Bounds;
|
|
14
|
+
export declare const parseDocumentSize: (document: Document) => Bounds;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { CSSParsedDeclaration } from '../index';
|
|
2
|
+
import { Bounds } from './bounds';
|
|
3
|
+
import { Context } from '../../core/context';
|
|
4
|
+
export declare class TextBounds {
|
|
5
|
+
readonly text: string;
|
|
6
|
+
readonly bounds: Bounds;
|
|
7
|
+
constructor(text: string, bounds: Bounds);
|
|
8
|
+
}
|
|
9
|
+
export declare const parseTextBounds: (context: Context, value: string, styles: CSSParsedDeclaration, node: Text) => TextBounds[];
|
|
10
|
+
export declare const segmentGraphemes: (value: string) => string[];
|