@stats-organization/github-readme-stats-core 2.1.4 → 2.2.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/build/api/gist.d.ts +2 -7
- package/build/api/gist.d.ts.map +1 -1
- package/build/api/gist.js +28 -26
- package/build/api/index.d.ts +3 -8
- package/build/api/index.d.ts.map +1 -1
- package/build/api/index.js +32 -36
- package/build/api/pin.d.ts +2 -7
- package/build/api/pin.d.ts.map +1 -1
- package/build/api/pin.js +18 -33
- package/build/api/top-langs.d.ts +2 -7
- package/build/api/top-langs.d.ts.map +1 -1
- package/build/api/top-langs.js +32 -44
- package/build/api/wakatime.d.ts +2 -7
- package/build/api/wakatime.d.ts.map +1 -1
- package/build/api/wakatime.js +28 -26
- package/build/calculateRank.d.ts +12 -11
- package/build/calculateRank.d.ts.map +1 -1
- package/build/calculateRank.js +18 -18
- package/build/cards/common-options.d.ts +13 -0
- package/build/cards/common-options.d.ts.map +1 -0
- package/build/cards/common-options.js +1 -0
- package/build/cards/gist.d.ts +11 -16
- package/build/cards/gist.d.ts.map +1 -1
- package/build/cards/gist.js +26 -31
- package/build/cards/repo.d.ts +19 -16
- package/build/cards/repo.d.ts.map +1 -1
- package/build/cards/repo.js +79 -72
- package/build/cards/stats.d.ts +29 -44
- package/build/cards/stats.d.ts.map +1 -1
- package/build/cards/stats.js +118 -173
- package/build/cards/top-languages.d.ts +81 -77
- package/build/cards/top-languages.d.ts.map +1 -1
- package/build/cards/top-languages.js +186 -184
- package/build/cards/wakatime.d.ts +21 -11
- package/build/cards/wakatime.d.ts.map +1 -1
- package/build/cards/wakatime.js +92 -109
- package/build/common/Card.d.ts +41 -14
- package/build/common/Card.d.ts.map +1 -1
- package/build/common/Card.js +92 -31
- package/build/common/I18n.d.ts +4 -2
- package/build/common/I18n.d.ts.map +1 -1
- package/build/common/color.d.ts +91 -15
- package/build/common/color.d.ts.map +1 -1
- package/build/common/color.js +163 -17
- package/build/common/config.d.ts +2 -1
- package/build/common/config.d.ts.map +1 -1
- package/build/common/config.js +16 -26
- package/build/common/constants.d.ts +2 -1
- package/build/common/constants.d.ts.map +1 -1
- package/build/common/date.d.ts +37 -0
- package/build/common/date.d.ts.map +1 -0
- package/build/common/date.js +31 -0
- package/build/common/html.js +1 -1
- package/build/common/http.d.ts +37 -5
- package/build/common/http.d.ts.map +1 -1
- package/build/common/http.js +29 -6
- package/build/common/icons.d.ts +1 -0
- package/build/common/icons.d.ts.map +1 -1
- package/build/common/icons.js +1 -0
- package/build/common/languageColors.d.ts +11 -0
- package/build/common/languageColors.d.ts.map +1 -0
- package/build/common/languageColors.js +15 -0
- package/build/common/languageColors.json +10 -1
- package/build/common/ops.d.ts +27 -33
- package/build/common/ops.d.ts.map +1 -1
- package/build/common/ops.js +31 -48
- package/build/common/render.d.ts +154 -113
- package/build/common/render.d.ts.map +1 -1
- package/build/common/render.js +209 -92
- package/build/common/retryer.d.ts +15 -6
- package/build/common/retryer.d.ts.map +1 -1
- package/build/common/retryer.js +2 -0
- package/build/fetchers/gist.d.ts +6 -21
- package/build/fetchers/gist.d.ts.map +1 -1
- package/build/fetchers/gist.js +28 -64
- package/build/fetchers/repo.d.ts +12 -11
- package/build/fetchers/repo.d.ts.map +1 -1
- package/build/fetchers/repo.js +27 -68
- package/build/fetchers/stats.d.ts +24 -17
- package/build/fetchers/stats.d.ts.map +1 -1
- package/build/fetchers/stats.js +302 -184
- package/build/fetchers/top-languages.d.ts +10 -15
- package/build/fetchers/top-languages.d.ts.map +1 -1
- package/build/fetchers/top-languages.js +52 -103
- package/build/fetchers/types.d.ts +130 -0
- package/build/fetchers/types.d.ts.map +1 -0
- package/build/fetchers/types.js +1 -0
- package/build/fetchers/wakatime.d.ts +9 -5
- package/build/fetchers/wakatime.d.ts.map +1 -1
- package/build/fetchers/wakatime.js +8 -4
- package/build/graphql/contributionsDocument.d.ts +18 -0
- package/build/graphql/contributionsDocument.d.ts.map +1 -0
- package/build/graphql/contributionsDocument.js +30 -0
- package/build/graphql/generated/common.d.ts +42 -0
- package/build/graphql/generated/common.d.ts.map +1 -0
- package/build/graphql/generated/common.js +2 -0
- package/build/graphql/generated/gist.d.ts +44 -0
- package/build/graphql/generated/gist.d.ts.map +1 -0
- package/build/graphql/generated/gist.js +27 -0
- package/build/graphql/generated/repo.d.ts +67 -0
- package/build/graphql/generated/repo.d.ts.map +1 -0
- package/build/graphql/generated/repo.js +30 -0
- package/build/graphql/generated/stats.d.ts +150 -0
- package/build/graphql/generated/stats.d.ts.map +1 -0
- package/build/graphql/generated/stats.js +95 -0
- package/build/graphql/generated/top-languages.d.ts +54 -0
- package/build/graphql/generated/top-languages.d.ts.map +1 -0
- package/build/graphql/generated/top-languages.js +27 -0
- package/build/graphql/graphqlDocument.d.ts +22 -0
- package/build/graphql/graphqlDocument.d.ts.map +1 -0
- package/build/graphql/graphqlDocument.js +8 -0
- package/build/graphql/reposContributedToDocument.d.ts +27 -0
- package/build/graphql/reposContributedToDocument.d.ts.map +1 -0
- package/build/graphql/reposContributedToDocument.js +59 -0
- package/build/index.d.ts +3 -1
- package/build/index.d.ts.map +1 -1
- package/build/index.js +2 -1
- package/build/themes/index.d.ts +32 -0
- package/build/themes/index.d.ts.map +1 -1
- package/build/themes/index.js +28 -0
- package/build/translations.d.ts +17 -0
- package/build/translations.d.ts.map +1 -1
- package/build/translations.js +17 -0
- package/package.json +14 -8
- package/src/_emoji-name-map.d.ts +10 -0
- package/src/_github-username-regex.d.ts +4 -0
- package/src/api/gist.js +31 -31
- package/src/api/index.js +40 -42
- package/src/api/pin.js +20 -38
- package/src/api/top-langs.js +36 -49
- package/src/api/wakatime.js +31 -31
- package/src/{calculateRank.js → calculateRank.ts} +29 -19
- package/src/cards/common-options.ts +13 -0
- package/src/cards/{gist.js → gist.ts} +37 -37
- package/src/cards/{repo.js → repo.ts} +107 -79
- package/src/cards/{stats.js → stats.ts} +173 -210
- package/src/cards/{top-languages.js → top-languages.ts} +325 -243
- package/src/cards/{wakatime.js → wakatime.ts} +158 -127
- package/src/common/Card.ts +123 -43
- package/src/common/I18n.ts +6 -2
- package/src/common/color.ts +240 -28
- package/src/common/config.ts +22 -29
- package/src/common/constants.ts +3 -1
- package/src/common/date.ts +45 -0
- package/src/common/html.ts +1 -1
- package/src/common/http.ts +71 -0
- package/src/common/icons.ts +1 -0
- package/src/common/languageColors.json +10 -1
- package/src/common/languageColors.ts +19 -0
- package/src/common/ops.ts +158 -0
- package/src/common/render.ts +652 -0
- package/src/common/retryer.ts +21 -12
- package/src/fetchers/gist.ts +79 -0
- package/src/fetchers/repo.ts +114 -0
- package/src/fetchers/stats.ts +743 -0
- package/src/fetchers/top-languages.ts +135 -0
- package/src/fetchers/{types.d.ts → types.ts} +28 -20
- package/src/fetchers/{wakatime.js → wakatime.ts} +19 -5
- package/src/graphql/contributionsDocument.ts +44 -0
- package/src/graphql/generated/common.ts +26 -0
- package/src/graphql/generated/gist.ts +59 -0
- package/src/graphql/generated/repo.ts +90 -0
- package/src/graphql/generated/stats.ts +194 -0
- package/src/graphql/generated/top-languages.ts +75 -0
- package/src/graphql/graphqlDocument.ts +25 -0
- package/src/graphql/queries/gist.graphql +25 -0
- package/src/graphql/queries/repo.graphql +28 -0
- package/src/graphql/queries/stats.graphql +120 -0
- package/src/graphql/queries/top-languages.graphql +34 -0
- package/src/graphql/reposContributedToDocument.ts +86 -0
- package/src/index.ts +3 -1
- package/src/themes/index.ts +33 -0
- package/src/translations.ts +17 -0
- package/src/cards/types.d.ts +0 -78
- package/src/common/http.js +0 -19
- package/src/common/ops.js +0 -170
- package/src/common/render.js +0 -440
- package/src/fetchers/gist.js +0 -112
- package/src/fetchers/repo.js +0 -161
- package/src/fetchers/stats.js +0 -474
- package/src/fetchers/top-languages.js +0 -175
- package/src/themes/README.md +0 -229
package/build/common/render.d.ts
CHANGED
|
@@ -1,96 +1,173 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* Auto layout utility, allows us to layout things vertically or horizontally with
|
|
3
|
+
* proper gaping.
|
|
4
|
+
*
|
|
5
|
+
* The caller must ensure that the passed `items` are properly sanitized!
|
|
3
6
|
*
|
|
4
|
-
* @param
|
|
5
|
-
* @param
|
|
6
|
-
* @param
|
|
7
|
-
* @param
|
|
8
|
-
* @param
|
|
9
|
-
* @
|
|
10
|
-
* @param {string=} args.renderOptions.bg_color Card background color.
|
|
11
|
-
* @param {string=} args.renderOptions.border_color Card border color.
|
|
12
|
-
* @param {Parameters<typeof getCardColors>[0]["theme"]=} args.renderOptions.theme Card theme.
|
|
13
|
-
* @param {boolean=} args.renderOptions.show_repo_link Whether to show repo link or not.
|
|
14
|
-
* @returns {string} The SVG markup.
|
|
7
|
+
* @param props Function properties.
|
|
8
|
+
* @param props.items Array of sanitized items to layout.
|
|
9
|
+
* @param props.gap Gap between items.
|
|
10
|
+
* @param props.direction Direction to layout items.
|
|
11
|
+
* @param props.sizes Array of sizes for each item.
|
|
12
|
+
* @returns Array of items with proper layout.
|
|
15
13
|
*/
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
bg_color?: string | undefined;
|
|
23
|
-
border_color?: string | undefined;
|
|
24
|
-
theme?: Parameters<typeof getCardColors>[0]["theme"] | undefined;
|
|
25
|
-
show_repo_link?: boolean | undefined;
|
|
26
|
-
} | undefined;
|
|
27
|
-
}): string;
|
|
14
|
+
declare const flexLayout: ({ items, gap, direction, sizes, }: {
|
|
15
|
+
items: Array<string>;
|
|
16
|
+
gap: number;
|
|
17
|
+
direction?: "column" | "row";
|
|
18
|
+
sizes?: Array<number>;
|
|
19
|
+
}) => Array<string>;
|
|
28
20
|
/**
|
|
29
21
|
* Creates a node to display the primary programming language of the repository/gist.
|
|
30
22
|
*
|
|
31
|
-
* @param
|
|
32
|
-
* @param
|
|
33
|
-
* @returns
|
|
23
|
+
* @param langName Language name.
|
|
24
|
+
* @param langColor Language color.
|
|
25
|
+
* @returns Language display SVG object.
|
|
34
26
|
*/
|
|
35
|
-
|
|
27
|
+
declare const createLanguageNode: (langName: string, langColor: string) => string;
|
|
36
28
|
/**
|
|
37
29
|
* Create a node to indicate progress in percentage along a horizontal line.
|
|
38
30
|
*
|
|
39
|
-
* @param
|
|
40
|
-
* @param
|
|
41
|
-
* @param
|
|
42
|
-
* @param
|
|
43
|
-
* @param
|
|
44
|
-
*
|
|
45
|
-
* @param
|
|
46
|
-
* @param
|
|
47
|
-
* @returns
|
|
31
|
+
* @param params Object that contains the createProgressNode parameters.
|
|
32
|
+
* @param params.x X-axis position.
|
|
33
|
+
* @param params.y Y-axis position.
|
|
34
|
+
* @param params.width Width of progress bar.
|
|
35
|
+
* @param params.color Optional foreground color as an inline fill fallback.
|
|
36
|
+
* When omitted, the color must be set via a `.lang-progress` CSS rule.
|
|
37
|
+
* @param params.progress Progress value.
|
|
38
|
+
* @param params.delay Delay before animation starts.
|
|
39
|
+
* @returns Progress node.
|
|
48
40
|
*/
|
|
49
|
-
|
|
41
|
+
declare const createProgressNode: ({ x, y, width, color, progress, delay, }: {
|
|
50
42
|
x: number;
|
|
51
43
|
y: number;
|
|
52
44
|
width: number;
|
|
53
|
-
color
|
|
45
|
+
color?: string;
|
|
54
46
|
progress: number;
|
|
55
|
-
progressBarBackgroundColor: string;
|
|
56
47
|
delay: number;
|
|
57
|
-
})
|
|
48
|
+
}) => string;
|
|
49
|
+
/**
|
|
50
|
+
* Renders multi-line text via a `foreignObject` so the browser performs
|
|
51
|
+
* native, font-aware wrapping. Content overflowing `lineCount` lines is
|
|
52
|
+
* clipped (with an ellipsis on the last visible line) by CSS line-clamp.
|
|
53
|
+
*
|
|
54
|
+
* @param props Function properties.
|
|
55
|
+
* @param props.text Text to render (will be HTML-encoded).
|
|
56
|
+
* @param props.x X position of the foreignObject.
|
|
57
|
+
* @param props.y Y position of the foreignObject.
|
|
58
|
+
* @param props.width Width of the wrap box.
|
|
59
|
+
* @param props.height Height of the wrap box.
|
|
60
|
+
* @param props.lineCount Maximum number of lines to display.
|
|
61
|
+
* @param props.className CSS class applied to the inner element.
|
|
62
|
+
* @param props.testId Optional test id for the inner element.
|
|
63
|
+
* @returns foreignObject SVG node.
|
|
64
|
+
*/
|
|
65
|
+
declare const wrappedTextNode: ({ text, x, y, width, height, lineCount, className, testId, }: {
|
|
66
|
+
text: string;
|
|
67
|
+
x: number;
|
|
68
|
+
y: number;
|
|
69
|
+
width: number;
|
|
70
|
+
height: number;
|
|
71
|
+
lineCount: number;
|
|
72
|
+
className: string;
|
|
73
|
+
testId?: string;
|
|
74
|
+
}) => string;
|
|
75
|
+
/**
|
|
76
|
+
* CSS rules used to render multi-line text inside a `foreignObject`. Apply this
|
|
77
|
+
* to a CSS class (e.g. `.description`) shared with `wrappedTextNode` so the
|
|
78
|
+
* browser handles wrapping and the line count is taken from the `--lines`
|
|
79
|
+
* custom property set on the element.
|
|
80
|
+
*
|
|
81
|
+
* @param color Text color (CSS `color` property).
|
|
82
|
+
* @returns CSS rules block (without the surrounding selector).
|
|
83
|
+
*/
|
|
84
|
+
declare const wrappedTextStyles: (color: string) => string;
|
|
58
85
|
/**
|
|
59
86
|
* Creates an icon with label to display repository/gist stats like forks, stars, etc.
|
|
60
87
|
*
|
|
61
|
-
*
|
|
62
|
-
*
|
|
63
|
-
* @param
|
|
64
|
-
* @param
|
|
65
|
-
* @
|
|
88
|
+
* The caller must ensure that the passed `icon` is properly sanitized!
|
|
89
|
+
*
|
|
90
|
+
* @param icon The sanitized icon to display.
|
|
91
|
+
* @param label The label to display.
|
|
92
|
+
* @param testid The testid to assign to the label.
|
|
93
|
+
* @param iconSize The size of the icon.
|
|
94
|
+
* @returns Icon with label SVG object.
|
|
66
95
|
*/
|
|
67
|
-
|
|
96
|
+
declare const iconWithLabel: (icon: string, label: number | string, testid: string, iconSize: number) => string;
|
|
68
97
|
/**
|
|
69
|
-
*
|
|
70
|
-
*
|
|
98
|
+
* Create a labelled stat text item
|
|
99
|
+
* (a label and its value, optionally with an icon and link).
|
|
100
|
+
* Shared by the stats and repo cards.
|
|
101
|
+
*
|
|
102
|
+
* The caller must ensure that the passed `icon` and `link` are properly sanitized!
|
|
71
103
|
*
|
|
72
|
-
* @param
|
|
73
|
-
* @param
|
|
74
|
-
* @param
|
|
75
|
-
* @param
|
|
76
|
-
* @param
|
|
77
|
-
* @
|
|
104
|
+
* @param params Object that contains the createTextNode parameters.
|
|
105
|
+
* @param params.icon The sanitized icon to display.
|
|
106
|
+
* @param params.label The label to display.
|
|
107
|
+
* @param params.value The value to display.
|
|
108
|
+
* @param params.id The id of the stat.
|
|
109
|
+
* @param params.unitSymbol The unit symbol of the stat.
|
|
110
|
+
* @param params.index The index of the stat.
|
|
111
|
+
* @param params.showIcons Whether to show icons.
|
|
112
|
+
* @param params.shiftValuePos Number of pixels the value has to be shifted to the right.
|
|
113
|
+
* @param params.bold Whether to bold the label.
|
|
114
|
+
* @param params.numberFormat The format of numbers on card.
|
|
115
|
+
* @param params.numberPrecision The precision of numbers on card.
|
|
116
|
+
* @param params.link Sanitized url to link to.
|
|
117
|
+
* @param params.labelXOffset horizontal offset for label.
|
|
118
|
+
* @returns The stats card text item SVG object.
|
|
78
119
|
*/
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
120
|
+
declare const createTextNode: ({ icon, label, value, id, unitSymbol, index, showIcons, shiftValuePos, bold, numberFormat, numberPrecision, link, labelXOffset, }: {
|
|
121
|
+
icon: string;
|
|
122
|
+
label: string;
|
|
123
|
+
value: number | string;
|
|
124
|
+
id: string;
|
|
125
|
+
unitSymbol?: string | undefined;
|
|
126
|
+
index: number;
|
|
127
|
+
showIcons: boolean;
|
|
128
|
+
shiftValuePos: number;
|
|
129
|
+
bold: boolean;
|
|
130
|
+
numberFormat: string;
|
|
131
|
+
numberPrecision?: number | undefined;
|
|
132
|
+
link?: string | undefined;
|
|
133
|
+
labelXOffset?: number;
|
|
134
|
+
}) => string;
|
|
135
|
+
/**
|
|
136
|
+
* Renders error message on the card.
|
|
137
|
+
*
|
|
138
|
+
* @param args Function arguments.
|
|
139
|
+
* @param args.message Main error message.
|
|
140
|
+
* @param args.secondaryMessage The secondary error message.
|
|
141
|
+
* @param args.renderOptions Render options.
|
|
142
|
+
* @param args.renderOptions.title_color Card title color.
|
|
143
|
+
* @param args.renderOptions.text_color Card text color.
|
|
144
|
+
* @param args.renderOptions.bg_color Card background color.
|
|
145
|
+
* @param args.renderOptions.border_color Card border color.
|
|
146
|
+
* @param args.renderOptions.theme Card theme.
|
|
147
|
+
* @param args.renderOptions.show_repo_link Whether to show repo link or not.
|
|
148
|
+
* @returns The SVG markup.
|
|
149
|
+
*/
|
|
150
|
+
declare const renderError: ({ message, secondaryMessage, renderOptions, }: {
|
|
151
|
+
message: string;
|
|
152
|
+
secondaryMessage?: string;
|
|
153
|
+
renderOptions?: {
|
|
154
|
+
title_color?: string;
|
|
155
|
+
text_color?: string;
|
|
156
|
+
bg_color?: string;
|
|
157
|
+
border_color?: string;
|
|
158
|
+
theme?: string;
|
|
159
|
+
show_repo_link?: boolean;
|
|
160
|
+
};
|
|
161
|
+
}) => string;
|
|
85
162
|
/**
|
|
86
163
|
* Retrieve text length based on Segoe UI font.
|
|
87
164
|
*
|
|
88
165
|
* @see https://stackoverflow.com/a/48172630/10629172
|
|
89
|
-
* @param
|
|
90
|
-
* @param
|
|
91
|
-
* @returns
|
|
166
|
+
* @param str String to measure.
|
|
167
|
+
* @param fontSize Font size.
|
|
168
|
+
* @returns Text length.
|
|
92
169
|
*/
|
|
93
|
-
|
|
170
|
+
declare const measureText: (str: string, fontSize?: number) => number;
|
|
94
171
|
/**
|
|
95
172
|
* Split text into the lines it would wrap to when laid out greedily at the
|
|
96
173
|
* given font size inside a box of width `maxWidth`. Uses `measureText` so the
|
|
@@ -98,58 +175,22 @@ export function measureText(str: string, fontSize?: number): number;
|
|
|
98
175
|
* The browser still does the real wrap inside the foreignObject; this is only
|
|
99
176
|
* used to size the SVG.
|
|
100
177
|
*
|
|
101
|
-
* @param
|
|
102
|
-
* @param
|
|
103
|
-
* @param
|
|
104
|
-
* @returns
|
|
178
|
+
* @param text Text to split.
|
|
179
|
+
* @param fontSize Font size in px (matches `measureText`).
|
|
180
|
+
* @param maxWidth Available wrap width in px.
|
|
181
|
+
* @returns Estimated wrapped lines.
|
|
105
182
|
*/
|
|
106
|
-
|
|
183
|
+
declare const splitWrappedText: (text: string, fontSize: number, maxWidth: number) => Array<string>;
|
|
107
184
|
/**
|
|
108
185
|
* Estimate how many lines a string will wrap to when laid out greedily at the
|
|
109
186
|
* given font size inside a box of width `maxWidth`, capped at `maxLines`.
|
|
110
187
|
*
|
|
111
|
-
* @param
|
|
112
|
-
* @param
|
|
113
|
-
* @param
|
|
114
|
-
* @param
|
|
115
|
-
* @returns
|
|
116
|
-
*/
|
|
117
|
-
export function countWrappedLines(text: string, fontSize: number, maxWidth: number, maxLines: number): number;
|
|
118
|
-
/**
|
|
119
|
-
* Renders multi-line text via a `foreignObject` so the browser performs
|
|
120
|
-
* native, font-aware wrapping. Content overflowing `lineCount` lines is
|
|
121
|
-
* clipped (with an ellipsis on the last visible line) by CSS line-clamp.
|
|
122
|
-
*
|
|
123
|
-
* @param {object} props Function properties.
|
|
124
|
-
* @param {string} props.text Text to render (will be HTML-encoded).
|
|
125
|
-
* @param {number} props.x X position of the foreignObject.
|
|
126
|
-
* @param {number} props.y Y position of the foreignObject.
|
|
127
|
-
* @param {number} props.width Width of the wrap box.
|
|
128
|
-
* @param {number} props.height Height of the wrap box.
|
|
129
|
-
* @param {number} props.lineCount Maximum number of lines to display.
|
|
130
|
-
* @param {string} props.className CSS class applied to the inner element.
|
|
131
|
-
* @param {string=} props.testId Optional test id for the inner element.
|
|
132
|
-
* @returns {string} foreignObject SVG node.
|
|
133
|
-
*/
|
|
134
|
-
export function wrappedTextNode({ text, x, y, width, height, lineCount, className, testId, }: {
|
|
135
|
-
text: string;
|
|
136
|
-
x: number;
|
|
137
|
-
y: number;
|
|
138
|
-
width: number;
|
|
139
|
-
height: number;
|
|
140
|
-
lineCount: number;
|
|
141
|
-
className: string;
|
|
142
|
-
testId?: string | undefined;
|
|
143
|
-
}): string;
|
|
144
|
-
/**
|
|
145
|
-
* CSS rules used to render multi-line text inside a `foreignObject`. Apply this
|
|
146
|
-
* to a CSS class (e.g. `.description`) shared with `wrappedTextNode` so the
|
|
147
|
-
* browser handles wrapping and the line count is taken from the `--lines`
|
|
148
|
-
* custom property set on the element.
|
|
149
|
-
*
|
|
150
|
-
* @param {string} color Text color (CSS `color` property).
|
|
151
|
-
* @returns {string} CSS rules block (without the surrounding selector).
|
|
188
|
+
* @param text Text to estimate.
|
|
189
|
+
* @param fontSize Font size in px (matches `measureText`).
|
|
190
|
+
* @param maxWidth Available wrap width in px.
|
|
191
|
+
* @param maxLines Cap on the returned line count.
|
|
192
|
+
* @returns Estimated line count, at least 1, at most `maxLines`.
|
|
152
193
|
*/
|
|
153
|
-
|
|
154
|
-
|
|
194
|
+
declare const countWrappedLines: (text: string, fontSize: number, maxWidth: number, maxLines: number) => number;
|
|
195
|
+
export { renderError, createLanguageNode, createProgressNode, createTextNode, iconWithLabel, flexLayout, measureText, splitWrappedText, countWrappedLines, wrappedTextNode, wrappedTextStyles, };
|
|
155
196
|
//# sourceMappingURL=render.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"render.d.ts","sourceRoot":"","sources":["../../src/common/render.
|
|
1
|
+
{"version":3,"file":"render.d.ts","sourceRoot":"","sources":["../../src/common/render.ts"],"names":[],"mappings":"AAMA;;;;;;;;;;;;GAYG;AACH,QAAA,MAAM,UAAU,GAAI,mCAKjB;IACD,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;IACrB,GAAG,EAAE,MAAM,CAAC;IACZ,SAAS,CAAC,EAAE,QAAQ,GAAG,KAAK,CAAC;IAC7B,KAAK,CAAC,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;CACvB,K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