File tree Expand file tree Collapse file tree 2 files changed +13
-1
lines changed Expand file tree Collapse file tree 2 files changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -104,7 +104,7 @@ export {
104104} from './lib/reports/generate-md-reports-diff.js' ;
105105export { loadReport } from './lib/reports/load-report.js' ;
106106export { logStdoutSummary } from './lib/reports/log-stdout-summary.js' ;
107- export { scoreReport , scoreAuditsWithTarget } from './lib/reports/scoring.js' ;
107+ export { scoreAuditsWithTarget , scoreReport } from './lib/reports/scoring.js' ;
108108export { sortReport } from './lib/reports/sorting.js' ;
109109export type {
110110 ScoredCategoryConfig ,
@@ -142,6 +142,7 @@ export type {
142142 ExtractArray ,
143143 ExtractArrays ,
144144 ItemOrArray ,
145+ LooseAutocomplete ,
145146 Prettify ,
146147 WithRequired ,
147148} from './lib/types.js' ;
Original file line number Diff line number Diff line change @@ -27,3 +27,14 @@ export type KebabCaseToCamelCase<T extends string> =
2727 T extends `${infer First } -${infer Rest } `
2828 ? `${First } ${Capitalize < KebabCaseToCamelCase < Rest > > } `
2929 : T ;
30+
31+ /**
32+ * Autocompletes string from union, while allowing any other string to be assigned.
33+ *
34+ * @example
35+ * let color: LooseAutocomplete< 'red' | 'green' | 'blue'>;
36+ *
37+ * color = 'green'; // IDE autocompletes 'red', 'green', 'blue'
38+ * color = '#516bc6'; // any string passes type check
39+ */
40+ export type LooseAutocomplete < T extends string > = T | ( string & { } ) ;
You can’t perform that action at this time.
0 commit comments