resvg-napi 0.1.2 → 0.3.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/README.md +168 -35
- package/fit.d.mts +62 -0
- package/index.d.ts +234 -191
- package/index.js +61 -54
- package/package.json +37 -25
- package/resvg-napi.wasi-browser.js +7 -0
- package/resvg-napi.wasi.cjs +8 -1
- package/resvg-napi.wasi.d.cts +234 -191
package/index.d.ts
CHANGED
|
@@ -44,6 +44,11 @@ export declare class Font {
|
|
|
44
44
|
get stretch(): FontStretch
|
|
45
45
|
get weight(): number
|
|
46
46
|
get variations(): Array<FontVariation>
|
|
47
|
+
/**
|
|
48
|
+
* Families this span asked for, in order. Never empty: usvg appends
|
|
49
|
+
* `RenderOptions.fontFamily` as the last resort.
|
|
50
|
+
*/
|
|
51
|
+
get families(): Array<string>
|
|
47
52
|
}
|
|
48
53
|
|
|
49
54
|
/** Opaque wrapper over `fontdb::Database` (memory-mapped faces, no JSON form). */
|
|
@@ -158,7 +163,7 @@ export declare class FontDatabase {
|
|
|
158
163
|
/** Read-only view of a `FaceInfo`. */
|
|
159
164
|
export declare class FontFace {
|
|
160
165
|
get index(): number
|
|
161
|
-
get postScriptName():
|
|
166
|
+
get postScriptName(): String
|
|
162
167
|
get style(): FontFaceStyle
|
|
163
168
|
get weight(): number
|
|
164
169
|
get monospaced(): boolean
|
|
@@ -166,6 +171,49 @@ export declare class FontFace {
|
|
|
166
171
|
get families(): Array<string>
|
|
167
172
|
}
|
|
168
173
|
|
|
174
|
+
/** Read-only view of an `Image`. */
|
|
175
|
+
export declare class Image {
|
|
176
|
+
get id(): String
|
|
177
|
+
get isVisible(): boolean
|
|
178
|
+
get renderingMode(): ImageRendering
|
|
179
|
+
get kind(): ImageKindJpeg | ImageKindPng | ImageKindGif | ImageKindWebp | ImageKindSvg
|
|
180
|
+
get absTransform(): Matrix
|
|
181
|
+
get boundingBox(): BBox
|
|
182
|
+
get absBoundingBox(): BBox
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
/** `ImageKind::GIF`. The bytes are the document's own. */
|
|
186
|
+
export declare class ImageKindGif {
|
|
187
|
+
/** Discriminant. Narrow on this. */
|
|
188
|
+
get type(): 'gif'
|
|
189
|
+
/** The encoded bytes, exactly as the document supplied them: usvg does not decode them, and neither does this. */
|
|
190
|
+
get bytes(): Buffer
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
/** `ImageKind::JPEG`. The bytes are the document's own. */
|
|
194
|
+
export declare class ImageKindJpeg {
|
|
195
|
+
/** Discriminant. Narrow on this. */
|
|
196
|
+
get type(): 'jpeg'
|
|
197
|
+
/** The encoded bytes, exactly as the document supplied them: usvg does not decode them, and neither does this. */
|
|
198
|
+
get bytes(): Buffer
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
/** `ImageKind::PNG`. The bytes are the document's own. */
|
|
202
|
+
export declare class ImageKindPng {
|
|
203
|
+
/** Discriminant. Narrow on this. */
|
|
204
|
+
get type(): 'png'
|
|
205
|
+
/** The encoded bytes, exactly as the document supplied them: usvg does not decode them, and neither does this. */
|
|
206
|
+
get bytes(): Buffer
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
/** `ImageKind::WEBP`. The bytes are the document's own. */
|
|
210
|
+
export declare class ImageKindWebp {
|
|
211
|
+
/** Discriminant. Narrow on this. */
|
|
212
|
+
get type(): 'webp'
|
|
213
|
+
/** The encoded bytes, exactly as the document supplied them: usvg does not decode them, and neither does this. */
|
|
214
|
+
get bytes(): Buffer
|
|
215
|
+
}
|
|
216
|
+
|
|
169
217
|
/** Read-only handle on a `usvg::LinearGradient`. */
|
|
170
218
|
export declare class LinearGradient {
|
|
171
219
|
/** `x1` coordinate. */
|
|
@@ -249,6 +297,17 @@ export declare class Pattern {
|
|
|
249
297
|
children(): Array<SvgNode>
|
|
250
298
|
}
|
|
251
299
|
|
|
300
|
+
/** Read-only view of a `PositionedGlyph`. */
|
|
301
|
+
export declare class PositionedGlyph {
|
|
302
|
+
get fontSize(): number
|
|
303
|
+
get transform(): Matrix
|
|
304
|
+
get outlineTransform(): Matrix
|
|
305
|
+
get svgTransform(): Matrix
|
|
306
|
+
get colrTransform(): Matrix
|
|
307
|
+
get id(): number
|
|
308
|
+
get text(): String
|
|
309
|
+
}
|
|
310
|
+
|
|
252
311
|
/** Read-only handle on a `usvg::RadialGradient`. */
|
|
253
312
|
export declare class RadialGradient {
|
|
254
313
|
/** `cx` coordinate. */
|
|
@@ -306,6 +365,23 @@ export declare class Resvg {
|
|
|
306
365
|
* `FontDatabase` and re-parse to fix the output.
|
|
307
366
|
*/
|
|
308
367
|
pendingFonts(): Array<string>
|
|
368
|
+
/**
|
|
369
|
+
* The face that actually drew a glyph, from the database this
|
|
370
|
+
* document was parsed with.
|
|
371
|
+
*
|
|
372
|
+
* `pendingFonts()` names the families that were missing; this names
|
|
373
|
+
* what was used instead, glyph by glyph, which is the half a
|
|
374
|
+
* document-wide list cannot answer. A fallback that renders is the
|
|
375
|
+
* failure nobody sees.
|
|
376
|
+
*
|
|
377
|
+
* The lookup lives here rather than on `FontDatabase` because
|
|
378
|
+
* `PositionedGlyph.font` is a `fontdb::ID` -- a slotmap key with no
|
|
379
|
+
* public numeric form, and meaningless against any other database.
|
|
380
|
+
* The glyph carries it the way `FontFace` carries one for
|
|
381
|
+
* `FontDatabase.face`, and `null` means exactly that: a glyph from
|
|
382
|
+
* another document.
|
|
383
|
+
*/
|
|
384
|
+
faceOf(glyph: PositionedGlyph): FontFace | null
|
|
309
385
|
/**
|
|
310
386
|
* Supplies one image and re-parses the document.
|
|
311
387
|
*
|
|
@@ -478,6 +554,21 @@ export declare class Resvg {
|
|
|
478
554
|
renderRawAsync(params?: RenderParams | undefined | null, signal?: AbortSignal | undefined | null): Promise<RawImage>
|
|
479
555
|
}
|
|
480
556
|
|
|
557
|
+
/** Read-only view of a `Span`. */
|
|
558
|
+
export declare class Span {
|
|
559
|
+
get fill(): Fill | null
|
|
560
|
+
get stroke(): Stroke | null
|
|
561
|
+
get paintOrder(): PaintOrder
|
|
562
|
+
get fontSize(): number
|
|
563
|
+
get variations(): Array<FontVariation>
|
|
564
|
+
get fontOpticalSizing(): FontOpticalSizing
|
|
565
|
+
get visible(): boolean
|
|
566
|
+
get positionedGlyphs(): Array<PositionedGlyph>
|
|
567
|
+
get underline(): Path | null
|
|
568
|
+
get overline(): Path | null
|
|
569
|
+
get lineThrough(): Path | null
|
|
570
|
+
}
|
|
571
|
+
|
|
481
572
|
/**
|
|
482
573
|
* A read-only handle on one element of the parsed tree.
|
|
483
574
|
*
|
|
@@ -504,6 +595,17 @@ export declare class SvgNode {
|
|
|
504
595
|
* mapper prunes any generated type no exposed method hands out.
|
|
505
596
|
*/
|
|
506
597
|
path(): Path | null
|
|
598
|
+
/**
|
|
599
|
+
* The content of an image node: where it sits, how it is to
|
|
600
|
+
* be scaled, and the bytes themselves. Null for anything else.
|
|
601
|
+
*
|
|
602
|
+
* `kind` is a discriminated union. The four raster variants
|
|
603
|
+
* carry the encoded bytes exactly as the document supplied
|
|
604
|
+
* them -- usvg says they should be decoded by the caller, and
|
|
605
|
+
* this is the caller -- while `svg` carries none, an embedded
|
|
606
|
+
* SVG being a tree rather than a payload.
|
|
607
|
+
*/
|
|
608
|
+
image(): Image | null
|
|
507
609
|
/** Direct children. Empty for anything that is not a group. */
|
|
508
610
|
children(): Array<SvgNode>
|
|
509
611
|
/**
|
|
@@ -561,7 +663,7 @@ export declare class SvgNode {
|
|
|
561
663
|
|
|
562
664
|
/** Read-only view of a `Text`. */
|
|
563
665
|
export declare class Text {
|
|
564
|
-
get id():
|
|
666
|
+
get id(): String
|
|
565
667
|
get renderingMode(): TextRendering
|
|
566
668
|
get dx(): Array<number>
|
|
567
669
|
get dy(): Array<number>
|
|
@@ -583,7 +685,7 @@ export declare class TextChunk {
|
|
|
583
685
|
get anchor(): TextAnchor
|
|
584
686
|
get spans(): Array<TextSpan>
|
|
585
687
|
get textFlow(): TextFlowPlain | TextFlowPath
|
|
586
|
-
get text():
|
|
688
|
+
get text(): String
|
|
587
689
|
}
|
|
588
690
|
|
|
589
691
|
/** Read-only view of a `TextSpan`. */
|
|
@@ -610,20 +712,18 @@ export declare class TextSpan {
|
|
|
610
712
|
}
|
|
611
713
|
|
|
612
714
|
/** An alignment baseline property. */
|
|
613
|
-
export
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
Mathematical = 'mathematical'
|
|
626
|
-
}
|
|
715
|
+
export type AlignmentBaseline = 'auto'|
|
|
716
|
+
'baseline'|
|
|
717
|
+
'beforeEdge'|
|
|
718
|
+
'textBeforeEdge'|
|
|
719
|
+
'middle'|
|
|
720
|
+
'central'|
|
|
721
|
+
'afterEdge'|
|
|
722
|
+
'textAfterEdge'|
|
|
723
|
+
'ideographic'|
|
|
724
|
+
'alphabetic'|
|
|
725
|
+
'hanging'|
|
|
726
|
+
'mathematical';
|
|
627
727
|
|
|
628
728
|
/** `BaselineShift::Number`. */
|
|
629
729
|
export interface BaselineShiftNumber {
|
|
@@ -658,24 +758,22 @@ export interface Blend {
|
|
|
658
758
|
*
|
|
659
759
|
* `mix-blend-mode` attribute in the SVG.
|
|
660
760
|
*/
|
|
661
|
-
export
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
Luminosity = 'luminosity'
|
|
678
|
-
}
|
|
761
|
+
export type BlendMode = 'normal'|
|
|
762
|
+
'multiply'|
|
|
763
|
+
'screen'|
|
|
764
|
+
'overlay'|
|
|
765
|
+
'darken'|
|
|
766
|
+
'lighten'|
|
|
767
|
+
'colorDodge'|
|
|
768
|
+
'colorBurn'|
|
|
769
|
+
'hardLight'|
|
|
770
|
+
'softLight'|
|
|
771
|
+
'difference'|
|
|
772
|
+
'exclusion'|
|
|
773
|
+
'hue'|
|
|
774
|
+
'saturation'|
|
|
775
|
+
'color'|
|
|
776
|
+
'luminosity';
|
|
679
777
|
|
|
680
778
|
/** Plain view of a `Color`. */
|
|
681
779
|
export interface Color {
|
|
@@ -685,22 +783,18 @@ export interface Color {
|
|
|
685
783
|
}
|
|
686
784
|
|
|
687
785
|
/** A color channel. */
|
|
688
|
-
export
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
A = 'a'
|
|
693
|
-
}
|
|
786
|
+
export type ColorChannel = 'r'|
|
|
787
|
+
'g'|
|
|
788
|
+
'b'|
|
|
789
|
+
'a';
|
|
694
790
|
|
|
695
791
|
/**
|
|
696
792
|
* A color interpolation mode.
|
|
697
793
|
*
|
|
698
794
|
* The default is `ColorInterpolation::LinearRGB`.
|
|
699
795
|
*/
|
|
700
|
-
export
|
|
701
|
-
|
|
702
|
-
LinearRGB = 'linearRgb'
|
|
703
|
-
}
|
|
796
|
+
export type ColorInterpolation = 'srgb'|
|
|
797
|
+
'linearRgb';
|
|
704
798
|
|
|
705
799
|
/** Plain view of a `ColorMatrix`. */
|
|
706
800
|
export interface ColorMatrix {
|
|
@@ -817,20 +911,18 @@ export interface DistantLight {
|
|
|
817
911
|
}
|
|
818
912
|
|
|
819
913
|
/** A dominant baseline property. */
|
|
820
|
-
export
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
TextBeforeEdge = 'textBeforeEdge'
|
|
833
|
-
}
|
|
914
|
+
export type DominantBaseline = 'auto'|
|
|
915
|
+
'useScript'|
|
|
916
|
+
'noChange'|
|
|
917
|
+
'resetSize'|
|
|
918
|
+
'ideographic'|
|
|
919
|
+
'alphabetic'|
|
|
920
|
+
'hanging'|
|
|
921
|
+
'mathematical'|
|
|
922
|
+
'central'|
|
|
923
|
+
'middle'|
|
|
924
|
+
'textAfterEdge'|
|
|
925
|
+
'textBeforeEdge';
|
|
834
926
|
|
|
835
927
|
/** Plain view of a `DropShadow`. */
|
|
836
928
|
export interface DropShadow {
|
|
@@ -844,11 +936,9 @@ export interface DropShadow {
|
|
|
844
936
|
}
|
|
845
937
|
|
|
846
938
|
/** An edges processing mode. */
|
|
847
|
-
export
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
Wrap = 'wrap'
|
|
851
|
-
}
|
|
939
|
+
export type EdgeMode = 'none'|
|
|
940
|
+
'duplicate'|
|
|
941
|
+
'wrap';
|
|
852
942
|
|
|
853
943
|
/** Plain view of a `Fill`. */
|
|
854
944
|
export interface Fill {
|
|
@@ -862,10 +952,8 @@ export interface Fill {
|
|
|
862
952
|
*
|
|
863
953
|
* `fill-rule` attribute in the SVG.
|
|
864
954
|
*/
|
|
865
|
-
export
|
|
866
|
-
|
|
867
|
-
EvenOdd = 'evenOdd'
|
|
868
|
-
}
|
|
955
|
+
export type FillRule = 'nonZero'|
|
|
956
|
+
'evenOdd';
|
|
869
957
|
|
|
870
958
|
/** Plain view of a `Flood`. */
|
|
871
959
|
export interface Flood {
|
|
@@ -874,11 +962,9 @@ export interface Flood {
|
|
|
874
962
|
}
|
|
875
963
|
|
|
876
964
|
/** Allows italic or oblique faces to be selected. */
|
|
877
|
-
export
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
Oblique = 'oblique'
|
|
881
|
-
}
|
|
965
|
+
export type FontFaceStyle = 'normal'|
|
|
966
|
+
'italic'|
|
|
967
|
+
'oblique';
|
|
882
968
|
|
|
883
969
|
/**
|
|
884
970
|
* A font optical sizing property.
|
|
@@ -886,34 +972,28 @@ export declare const enum FontFaceStyle {
|
|
|
886
972
|
* Controls automatic adjustment of the `opsz` axis in variable fonts
|
|
887
973
|
* based on font size. Matches CSS `font-optical-sizing`.
|
|
888
974
|
*/
|
|
889
|
-
export
|
|
890
|
-
|
|
891
|
-
None = 'none'
|
|
892
|
-
}
|
|
975
|
+
export type FontOpticalSizing = 'auto'|
|
|
976
|
+
'none';
|
|
893
977
|
|
|
894
978
|
/** A font stretch property. */
|
|
895
|
-
export
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
UltraExpanded = 'ultraExpanded'
|
|
905
|
-
}
|
|
979
|
+
export type FontStretch = 'ultraCondensed'|
|
|
980
|
+
'extraCondensed'|
|
|
981
|
+
'condensed'|
|
|
982
|
+
'semiCondensed'|
|
|
983
|
+
'normal'|
|
|
984
|
+
'semiExpanded'|
|
|
985
|
+
'expanded'|
|
|
986
|
+
'extraExpanded'|
|
|
987
|
+
'ultraExpanded';
|
|
906
988
|
|
|
907
989
|
/** A font style property. */
|
|
908
|
-
export
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
Oblique = 'oblique'
|
|
912
|
-
}
|
|
990
|
+
export type FontStyle = 'normal'|
|
|
991
|
+
'italic'|
|
|
992
|
+
'oblique';
|
|
913
993
|
|
|
914
994
|
/** Plain view of a `FontVariation`. */
|
|
915
995
|
export interface FontVariation {
|
|
916
|
-
tag:
|
|
996
|
+
tag: String
|
|
917
997
|
value: number
|
|
918
998
|
}
|
|
919
999
|
|
|
@@ -924,19 +1004,23 @@ export interface GaussianBlur {
|
|
|
924
1004
|
stdDevY: number
|
|
925
1005
|
}
|
|
926
1006
|
|
|
1007
|
+
/** `ImageKind::SVG`. */
|
|
1008
|
+
export interface ImageKindSvg {
|
|
1009
|
+
/** Discriminant. Narrow on this. */
|
|
1010
|
+
type: 'svg'
|
|
1011
|
+
}
|
|
1012
|
+
|
|
927
1013
|
/**
|
|
928
1014
|
* An image rendering method.
|
|
929
1015
|
*
|
|
930
1016
|
* `image-rendering` attribute in the SVG.
|
|
931
1017
|
*/
|
|
932
|
-
export
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
Pixelated = 'pixelated'
|
|
939
|
-
}
|
|
1018
|
+
export type ImageRendering = 'optimizeQuality'|
|
|
1019
|
+
'optimizeSpeed'|
|
|
1020
|
+
'smooth'|
|
|
1021
|
+
'highQuality'|
|
|
1022
|
+
'crispEdges'|
|
|
1023
|
+
'pixelated';
|
|
940
1024
|
|
|
941
1025
|
/** The payload-free variants of `Input`. */
|
|
942
1026
|
export interface InputPlain {
|
|
@@ -1070,10 +1154,8 @@ export interface KindTurbulence {
|
|
|
1070
1154
|
}
|
|
1071
1155
|
|
|
1072
1156
|
/** A length adjust property. */
|
|
1073
|
-
export
|
|
1074
|
-
|
|
1075
|
-
SpacingAndGlyphs = 'spacingAndGlyphs'
|
|
1076
|
-
}
|
|
1157
|
+
export type LengthAdjust = 'spacing'|
|
|
1158
|
+
'spacingAndGlyphs';
|
|
1077
1159
|
|
|
1078
1160
|
/** `LightSource::DistantLight`. */
|
|
1079
1161
|
export interface LightSourceDistantLight {
|
|
@@ -1101,31 +1183,34 @@ export interface LightSourceSpotLight {
|
|
|
1101
1183
|
*
|
|
1102
1184
|
* `stroke-linecap` attribute in the SVG.
|
|
1103
1185
|
*/
|
|
1104
|
-
export
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
Square = 'square'
|
|
1108
|
-
}
|
|
1186
|
+
export type LineCap = 'butt'|
|
|
1187
|
+
'round'|
|
|
1188
|
+
'square';
|
|
1109
1189
|
|
|
1110
1190
|
/**
|
|
1111
1191
|
* A line join.
|
|
1112
1192
|
*
|
|
1113
1193
|
* `stroke-linejoin` attribute in the SVG.
|
|
1114
1194
|
*/
|
|
1115
|
-
export
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
Bevel = 'bevel'
|
|
1120
|
-
}
|
|
1195
|
+
export type LineJoin = 'miter'|
|
|
1196
|
+
'miterClip'|
|
|
1197
|
+
'round'|
|
|
1198
|
+
'bevel';
|
|
1121
1199
|
|
|
1122
1200
|
/** A mask type. */
|
|
1123
|
-
export
|
|
1124
|
-
|
|
1125
|
-
Alpha = 'alpha'
|
|
1126
|
-
}
|
|
1201
|
+
export type MaskType = 'luminance'|
|
|
1202
|
+
'alpha';
|
|
1127
1203
|
|
|
1128
|
-
/**
|
|
1204
|
+
/**
|
|
1205
|
+
* An affine transform. Field names and order are tiny-skia's.
|
|
1206
|
+
*
|
|
1207
|
+
* They are *not* the order of SVG's `matrix(a b c d e f)`, which
|
|
1208
|
+
* takes `sx ky kx sy tx ty` -- upstream says so itself: "we are
|
|
1209
|
+
* using column-major-column-vector matrix notation, therefore it's
|
|
1210
|
+
* ky-kx, not kx-ky". Reading these positionally into a `matrix()`
|
|
1211
|
+
* string mirrors the transform, silently. Name the fields:
|
|
1212
|
+
* `matrix(${m.sx} ${m.ky} ${m.kx} ${m.sy} ${m.tx} ${m.ty})`.
|
|
1213
|
+
*/
|
|
1129
1214
|
export interface Matrix {
|
|
1130
1215
|
sx: number
|
|
1131
1216
|
kx: number
|
|
@@ -1149,18 +1234,14 @@ export interface Morphology {
|
|
|
1149
1234
|
}
|
|
1150
1235
|
|
|
1151
1236
|
/** A morphology operation. */
|
|
1152
|
-
export
|
|
1153
|
-
|
|
1154
|
-
Dilate = 'dilate'
|
|
1155
|
-
}
|
|
1237
|
+
export type MorphologyOperator = 'erode'|
|
|
1238
|
+
'dilate';
|
|
1156
1239
|
|
|
1157
1240
|
/** Which flavour of node this is. */
|
|
1158
|
-
export
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
Text = 'text'
|
|
1163
|
-
}
|
|
1241
|
+
export type NodeKind = 'group'|
|
|
1242
|
+
'path'|
|
|
1243
|
+
'image'|
|
|
1244
|
+
'text';
|
|
1164
1245
|
|
|
1165
1246
|
/** Plain view of a `Offset`. */
|
|
1166
1247
|
export interface Offset {
|
|
@@ -1191,10 +1272,8 @@ export interface PaintLinearGradient {
|
|
|
1191
1272
|
*
|
|
1192
1273
|
* [`paint-order`]: https://www.w3.org/TR/SVG2/painting.html#PaintOrder
|
|
1193
1274
|
*/
|
|
1194
|
-
export
|
|
1195
|
-
|
|
1196
|
-
StrokeAndFill = 'strokeAndFill'
|
|
1197
|
-
}
|
|
1275
|
+
export type PaintOrder = 'fillAndStroke'|
|
|
1276
|
+
'strokeAndFill';
|
|
1198
1277
|
|
|
1199
1278
|
/** `Paint::Pattern`. */
|
|
1200
1279
|
export interface PaintPattern {
|
|
@@ -1212,7 +1291,7 @@ export interface PaintRadialGradient {
|
|
|
1212
1291
|
|
|
1213
1292
|
/** Plain view of a `Path`. */
|
|
1214
1293
|
export interface Path {
|
|
1215
|
-
id:
|
|
1294
|
+
id: String
|
|
1216
1295
|
isVisible: boolean
|
|
1217
1296
|
fill?: Fill
|
|
1218
1297
|
stroke?: Stroke
|
|
@@ -1249,20 +1328,11 @@ export interface PointLight {
|
|
|
1249
1328
|
z: number
|
|
1250
1329
|
}
|
|
1251
1330
|
|
|
1252
|
-
/** Plain view of a `PositionedGlyph`. */
|
|
1253
|
-
export interface PositionedGlyph {
|
|
1254
|
-
fontSize: number
|
|
1255
|
-
transform: Matrix
|
|
1256
|
-
outlineTransform: Matrix
|
|
1257
|
-
svgTransform: Matrix
|
|
1258
|
-
colrTransform: Matrix
|
|
1259
|
-
}
|
|
1260
|
-
|
|
1261
1331
|
/** Plain view of a `Primitive`. */
|
|
1262
1332
|
export interface Primitive {
|
|
1263
1333
|
rect: BBox
|
|
1264
1334
|
colorInterpolation: ColorInterpolation
|
|
1265
|
-
result:
|
|
1335
|
+
result: String
|
|
1266
1336
|
kind: KindBlend | KindColorMatrix | KindComponentTransfer | KindComposite | KindConvolveMatrix | KindDiffuseLighting | KindDisplacementMap | KindDropShadow | KindFlood | KindGaussianBlur | KindImage | KindMerge | KindMorphology | KindOffset | KindSpecularLighting | KindTile | KindTurbulence
|
|
1267
1337
|
}
|
|
1268
1338
|
|
|
@@ -1402,33 +1472,16 @@ export interface RenderParams {
|
|
|
1402
1472
|
* `level` is `off`, `error`, `warn`, `info`, `debug` or `trace`. Safe to
|
|
1403
1473
|
* call repeatedly: the logger is installed once, the level always applies.
|
|
1404
1474
|
*/
|
|
1405
|
-
export declare function setLogLevel(level:
|
|
1475
|
+
export declare function setLogLevel(level: 'off' | 'error' | 'warn' | 'info' | 'debug' | 'trace'): void
|
|
1406
1476
|
|
|
1407
1477
|
/**
|
|
1408
1478
|
* A shape rendering method.
|
|
1409
1479
|
*
|
|
1410
1480
|
* `shape-rendering` attribute in the SVG.
|
|
1411
1481
|
*/
|
|
1412
|
-
export
|
|
1413
|
-
|
|
1414
|
-
|
|
1415
|
-
GeometricPrecision = 'geometricPrecision'
|
|
1416
|
-
}
|
|
1417
|
-
|
|
1418
|
-
/** Plain view of a `Span`. */
|
|
1419
|
-
export interface Span {
|
|
1420
|
-
fill?: Fill
|
|
1421
|
-
stroke?: Stroke
|
|
1422
|
-
paintOrder: PaintOrder
|
|
1423
|
-
fontSize: number
|
|
1424
|
-
variations: Array<FontVariation>
|
|
1425
|
-
fontOpticalSizing: FontOpticalSizing
|
|
1426
|
-
visible: boolean
|
|
1427
|
-
positionedGlyphs: Array<PositionedGlyph>
|
|
1428
|
-
underline?: string
|
|
1429
|
-
overline?: string
|
|
1430
|
-
lineThrough?: string
|
|
1431
|
-
}
|
|
1482
|
+
export type ShapeRendering = 'optimizeSpeed'|
|
|
1483
|
+
'crispEdges'|
|
|
1484
|
+
'geometricPrecision';
|
|
1432
1485
|
|
|
1433
1486
|
/** Plain view of a `SpecularLighting`. */
|
|
1434
1487
|
export interface SpecularLighting {
|
|
@@ -1457,11 +1510,9 @@ export interface SpotLight {
|
|
|
1457
1510
|
*
|
|
1458
1511
|
* `spreadMethod` attribute in the SVG.
|
|
1459
1512
|
*/
|
|
1460
|
-
export
|
|
1461
|
-
|
|
1462
|
-
|
|
1463
|
-
Repeat = 'repeat'
|
|
1464
|
-
}
|
|
1513
|
+
export type SpreadMethod = 'pad'|
|
|
1514
|
+
'reflect'|
|
|
1515
|
+
'repeat';
|
|
1465
1516
|
|
|
1466
1517
|
/** Plain view of a `Stop`. */
|
|
1467
1518
|
export interface Stop {
|
|
@@ -1486,11 +1537,9 @@ export interface Stroke {
|
|
|
1486
1537
|
export declare function takeLogs(): Array<string>
|
|
1487
1538
|
|
|
1488
1539
|
/** A text chunk anchor property. */
|
|
1489
|
-
export
|
|
1490
|
-
|
|
1491
|
-
|
|
1492
|
-
End = 'end'
|
|
1493
|
-
}
|
|
1540
|
+
export type TextAnchor = 'start'|
|
|
1541
|
+
'middle'|
|
|
1542
|
+
'end';
|
|
1494
1543
|
|
|
1495
1544
|
/** Plain view of a `TextDecoration`. */
|
|
1496
1545
|
export interface TextDecoration {
|
|
@@ -1523,11 +1572,9 @@ export interface TextFlowPlain {
|
|
|
1523
1572
|
*
|
|
1524
1573
|
* `text-rendering` attribute in the SVG.
|
|
1525
1574
|
*/
|
|
1526
|
-
export
|
|
1527
|
-
|
|
1528
|
-
|
|
1529
|
-
GeometricPrecision = 'geometricPrecision'
|
|
1530
|
-
}
|
|
1575
|
+
export type TextRendering = 'optimizeSpeed'|
|
|
1576
|
+
'optimizeLegibility'|
|
|
1577
|
+
'geometricPrecision';
|
|
1531
1578
|
|
|
1532
1579
|
/** Plain view of a `Tile`. */
|
|
1533
1580
|
export interface Tile {
|
|
@@ -1582,10 +1629,8 @@ export interface Turbulence {
|
|
|
1582
1629
|
}
|
|
1583
1630
|
|
|
1584
1631
|
/** A turbulence kind for the `feTurbulence` filter. */
|
|
1585
|
-
export
|
|
1586
|
-
|
|
1587
|
-
Turbulence = 'turbulence'
|
|
1588
|
-
}
|
|
1632
|
+
export type TurbulenceKind = 'fractalNoise'|
|
|
1633
|
+
'turbulence';
|
|
1589
1634
|
|
|
1590
1635
|
/**
|
|
1591
1636
|
* Mirror of `usvg::WriteOptions`, for `Resvg.toString()`. Every field is
|
|
@@ -1639,7 +1684,5 @@ export interface WriteOptions {
|
|
|
1639
1684
|
}
|
|
1640
1685
|
|
|
1641
1686
|
/** A writing mode. */
|
|
1642
|
-
export
|
|
1643
|
-
|
|
1644
|
-
TopToBottom = 'topToBottom'
|
|
1645
|
-
}
|
|
1687
|
+
export type WritingMode = 'leftToRight'|
|
|
1688
|
+
'topToBottom';
|