view-ignored 0.2.2 → 0.3.1

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.
Files changed (58) hide show
  1. package/README.md +23 -27
  2. package/bin/viewig +4 -2
  3. package/out/src/browser/binds/index.d.ts +40 -21
  4. package/out/src/browser/binds/index.js +62 -48
  5. package/out/src/browser/binds/plugins/git.d.ts +22 -3
  6. package/out/src/browser/binds/plugins/git.js +57 -21
  7. package/out/src/browser/binds/plugins/npm.d.ts +36 -9
  8. package/out/src/browser/binds/plugins/npm.js +125 -59
  9. package/out/src/browser/binds/plugins/vsce.d.ts +24 -8
  10. package/out/src/browser/binds/plugins/vsce.js +56 -16
  11. package/out/src/browser/binds/plugins/yarn.d.ts +5 -10
  12. package/out/src/browser/binds/plugins/yarn.js +18 -68
  13. package/out/src/browser/binds/scanner.d.ts +56 -0
  14. package/out/src/browser/binds/scanner.js +134 -0
  15. package/out/src/browser/binds/targets.d.ts +35 -11
  16. package/out/src/browser/binds/targets.js +10 -17
  17. package/out/src/browser/errors.d.ts +58 -7
  18. package/out/src/browser/errors.js +40 -12
  19. package/out/src/browser/filtering.d.ts +15 -0
  20. package/out/src/browser/filtering.js +12 -0
  21. package/out/src/browser/fs/directory.d.ts +181 -0
  22. package/out/src/browser/fs/directory.js +235 -0
  23. package/out/src/browser/{fileinfo.d.ts → fs/file-info.d.ts} +38 -27
  24. package/out/src/browser/fs/file-info.js +86 -0
  25. package/out/src/browser/fs/file.d.ts +41 -0
  26. package/out/src/browser/fs/file.js +43 -0
  27. package/out/src/browser/fs/index.d.ts +4 -0
  28. package/out/src/browser/fs/index.js +4 -0
  29. package/out/src/browser/fs/source-info.d.ts +29 -0
  30. package/out/src/browser/fs/source-info.js +31 -0
  31. package/out/src/browser/index.d.ts +2 -2
  32. package/out/src/browser/index.js +2 -2
  33. package/out/src/browser/lib.d.ts +102 -101
  34. package/out/src/browser/lib.js +86 -120
  35. package/out/src/browser/sorting.d.ts +22 -2
  36. package/out/src/browser/sorting.js +37 -32
  37. package/out/src/browser/styling.d.ts +41 -15
  38. package/out/src/browser/styling.js +28 -97
  39. package/out/src/cli.d.ts +73 -34
  40. package/out/src/cli.js +308 -155
  41. package/out/src/config.d.ts +163 -65
  42. package/out/src/config.js +285 -171
  43. package/out/src/errors.d.ts +7 -0
  44. package/out/src/errors.js +1 -0
  45. package/out/src/index.d.ts +2 -2
  46. package/out/src/index.js +2 -2
  47. package/out/src/lib.d.ts +4 -4
  48. package/out/src/lib.js +4 -4
  49. package/out/src/styling.d.ts +10 -4
  50. package/out/src/styling.js +46 -33
  51. package/package.json +121 -107
  52. package/out/src/bin.d.ts +0 -2
  53. package/out/src/bin.js +0 -3
  54. package/out/src/browser/fileinfo.js +0 -78
  55. package/out/src/browser/scanner.d.ts +0 -103
  56. package/out/src/browser/scanner.js +0 -161
  57. package/out/src/browser/sourceinfo.d.ts +0 -62
  58. package/out/src/browser/sourceinfo.js +0 -107
package/out/src/config.js CHANGED
@@ -1,257 +1,371 @@
1
- import { filterNameList, isFilterName, Plugins, Sorting, Styling } from "./browser/index.js";
2
- import * as os from "os";
3
- import * as yaml from "yaml";
4
- import path from "path";
5
- import { existsSync, readFileSync, rmSync, writeFileSync } from "fs";
6
- /**
7
- * Contains all color level names.
8
- */
9
- export const colorTypeList = [0, 1, 2, 3];
10
- /**
11
- * Checks if the value is the {@link ColorType}.
12
- */
13
- export function isColorType(value) {
14
- const num = Number(value);
15
- return Number.isFinite(num) && colorTypeList.includes(num);
16
- }
1
+ import * as os from 'node:os';
2
+ import path from 'node:path';
3
+ import { existsSync, readFileSync, rmSync, writeFileSync, } from 'node:fs';
4
+ import { format } from 'node:util';
5
+ import * as yaml from 'yaml';
6
+ import { decorNameList, highlight, styleNameList, } from './styling.js';
7
+ import { sortNameList } from './browser/sorting.js';
8
+ import { filterNameList } from './browser/filtering.js';
17
9
  /**
18
10
  * The full config file name - `".view-ignored"`.
11
+ * @public
19
12
  */
20
- export const configFileName = ".view-ignored";
13
+ export const configFileName = '.view-ignored';
21
14
  /**
22
15
  * The user's home directory + the config file name.
23
16
  * @see {@link os.homedir}
17
+ * @private
24
18
  */
25
- export const configFilePath = path.join(os.homedir(), configFileName);
19
+ const configFilePath = path.join(os.homedir(), configFileName);
26
20
  /**
27
21
  * Command-line configuration property list.
22
+ * @public
28
23
  */
29
- export const configKeyList = ["color", "target", "filter", "sort", "style", "decor", "depth", "showSources", "plugins", "parsable"];
24
+ export const configKeyList = ['posix', 'noColor', 'target', 'filter', 'sort', 'style', 'decor', 'depth', 'showSources', 'plugins', 'parsable', 'concurrency'];
30
25
  /**
31
- * Checks if the value is the {@link ConfigKey}.
26
+ * @public
32
27
  */
33
- export function isConfigKey(value) {
34
- return typeof value === "string" && configKeyList.includes(value);
35
- }
36
28
  export function isShowSources(value) {
37
- return typeof value === "boolean";
38
- }
39
- /**
40
- * Checks if the value is the {@link Config} value for the specific {@link ConfigKey}.
41
- */
42
- export function isConfigValue(key, value) {
43
- const c = {
44
- parsable: v => typeof v === "boolean",
45
- plugins: v => Array.isArray(v) && v.every(p => typeof p === "string"),
46
- color: isColorType,
47
- target: t => Plugins.isTargetId(t) && Plugins.targetGet(t) !== undefined,
48
- filter: isFilterName,
49
- sort: Sorting.isSortName,
50
- style: Styling.isStyleName,
51
- decor: Styling.isDecorName,
52
- depth: Number.isInteger,
53
- showSources: isShowSources
54
- };
55
- const check = c[key];
56
- return check(value);
29
+ return typeof value === 'boolean';
57
30
  }
58
31
  /**
59
32
  * Command-line default config values.
33
+ * @public
60
34
  */
61
35
  export const configDefault = {
62
36
  parsable: false,
37
+ noColor: false,
38
+ posix: false,
63
39
  plugins: [],
64
- color: 3,
65
- target: "git",
66
- filter: "included",
67
- sort: "firstFolders",
68
- style: "tree",
69
- decor: "normal",
40
+ target: 'git',
41
+ filter: 'included',
42
+ sort: 'firstFolders',
43
+ style: 'tree',
44
+ decor: 'normal',
70
45
  depth: Infinity,
71
- showSources: false
46
+ showSources: false,
47
+ concurrency: 8,
72
48
  };
73
49
  /**
74
- * @returns `true`, if the value can be used as a configuration.
50
+ * @public
75
51
  */
76
- export function isConfigPartial(cfg) {
77
- if (cfg?.constructor !== Object) {
78
- return false;
79
- }
80
- const jsonobj = cfg;
81
- return Object.entries(jsonobj).every(([key, value]) => isConfigKey(key)
82
- ? isConfigValue(key, value)
83
- : true);
84
- }
85
- export const trueValues = ['true', 'on', 'yes', 'y', 'enable', 'enabled', '1'];
86
- export const falseValues = ['false', 'off', 'no', 'n', 'disable', 'disabled', '0'];
87
- export const boolValues = trueValues.concat(falseValues);
52
+ export const configValueArray = (type) => {
53
+ const validator = value => {
54
+ if (Array.isArray(value)) {
55
+ if (type === undefined) {
56
+ return;
57
+ }
58
+ const badElementList = value.map(element => type(element)).filter(element => element !== undefined);
59
+ if (badElementList.length > 0) {
60
+ const list = badElementList.map((element, index) => `${index}: ${element}`).join('\n');
61
+ return `The value should be a typed array. Found bad elements:\n${list}`;
62
+ }
63
+ return;
64
+ }
65
+ return 'The value should be an array.';
66
+ };
67
+ validator.typeName = `${type?.typeName ?? 'any'}[]`;
68
+ return validator;
69
+ };
88
70
  /**
89
- * @returns available values or requirement message for the specified property.
90
- * @param key The config property.
91
- * @param fallbackDefault If `true`, the default value will be used when the value is `undefined`. Default `true`.
71
+ * @public
92
72
  */
93
- export function configValueList(key) {
94
- const msg = {
95
- int: 'The value should be an integer.',
96
- bool: `The value should be a boolean. Available bool literals: ${boolValues.join(', ')}`,
97
- arrStr: `The value should be an array of a strings.`,
73
+ export const configValueLiteral = (choices) => {
74
+ const validator = value => {
75
+ if (choices.includes(value)) {
76
+ return;
77
+ }
78
+ return `The value is invalid. Choices: ${choices.map(String).join(', ')}.`;
98
79
  };
99
- /**
100
- * Represents allowed values for each config property.
101
- */
102
- const configAvailable = {
103
- color: colorTypeList,
104
- filter: filterNameList,
105
- target: Plugins.targetList,
106
- sort: Sorting.sortNameList,
107
- style: Styling.styleNameList,
108
- decor: Styling.decorNameList,
109
- depth: msg.int,
110
- parsable: msg.bool,
111
- plugins: msg.arrStr,
112
- showSources: msg.bool,
80
+ validator.typeName = choices.map(choice => format('%o', choice)).join('|');
81
+ return validator;
82
+ };
83
+ /**
84
+ * @public
85
+ */
86
+ export const switchTrueValues = ['true', 'on', 'yes', 'y', 'enable', 'enabled', '1'];
87
+ /**
88
+ * @public
89
+ */
90
+ export const switchFalseValues = ['false', 'off', 'no', 'n', 'disable', 'disabled', '0'];
91
+ /**
92
+ * @public
93
+ */
94
+ export const booleanValues = switchTrueValues.concat(switchFalseValues);
95
+ /**
96
+ * @public
97
+ */
98
+ export const configValueSwitch = () => {
99
+ const validator = value => {
100
+ if (booleanValues.includes(value)) {
101
+ return;
102
+ }
103
+ return `The value should be a boolean. Available boolean literals: ${booleanValues.join(', ')}.`;
113
104
  };
114
- const val = configAvailable[key];
115
- const choices = (typeof val === "function" ? val() : val);
116
- return choices;
117
- }
118
- const configCliOptMap = new Map;
119
- export function configValueLinkCliOption(key, command, option, parseArg) {
120
- const list = configValueList(key);
121
- if (Array.isArray(list)) {
122
- option.choices(list);
123
- }
124
- if (parseArg) {
125
- option.argParser(parseArg);
126
- }
127
- option.default(configManager.get(key));
128
- command.addOption(option);
129
- configCliOptMap.set(key, option);
130
- return option;
131
- }
132
- export function configValueGetCliOption(key) {
133
- return configCliOptMap.get(key);
134
- }
105
+ validator.typeName = 'switch';
106
+ return validator;
107
+ };
108
+ /**
109
+ * @public
110
+ */
111
+ export const configValueBoolean = () => {
112
+ const validator = value => {
113
+ if (typeof value === 'boolean') {
114
+ return;
115
+ }
116
+ return 'The value should be a boolean.';
117
+ };
118
+ validator.typeName = 'boolean';
119
+ return validator;
120
+ };
121
+ /**
122
+ * @public
123
+ */
124
+ export const configValueObject = () => {
125
+ const validator = value => {
126
+ if (value?.constructor === Object) {
127
+ return;
128
+ }
129
+ return 'The value should be an object.';
130
+ };
131
+ validator.typeName = 'object';
132
+ return validator;
133
+ };
134
+ /**
135
+ * @public
136
+ */
137
+ export const configValueString = () => {
138
+ const validator = value => {
139
+ if (typeof value === 'string') {
140
+ return;
141
+ }
142
+ return 'The value should be a string.';
143
+ };
144
+ validator.typeName = 'string';
145
+ return validator;
146
+ };
147
+ /**
148
+ * @public
149
+ */
150
+ export const configValueNumber = () => {
151
+ const validator = value => {
152
+ if (typeof value === 'number') {
153
+ return;
154
+ }
155
+ return 'The value should be a number.';
156
+ };
157
+ validator.typeName = 'number';
158
+ return validator;
159
+ };
160
+ /**
161
+ * @public
162
+ */
163
+ export const configValueInteger = () => {
164
+ const validator = value => {
165
+ if (typeof value === 'number' && (Number.isSafeInteger(value) || Math.abs(value) === Infinity)) {
166
+ return;
167
+ }
168
+ return 'The value should be an integer.';
169
+ };
170
+ validator.typeName = 'integer';
171
+ return validator;
172
+ };
135
173
  /**
136
174
  * File-specific actions container.
175
+ * @public
137
176
  */
138
177
  export class ConfigManager {
139
- filePath;
140
- constructor(filePath) {
141
- this.filePath = filePath;
142
- }
178
+ path;
143
179
  /**
144
180
  * Do not change this value directly.
145
181
  * @see {@link configManager}.
146
182
  */
147
183
  data = {};
148
- dataRaw() {
149
- return structuredClone(this.data);
184
+ configValidation = new Map();
185
+ cliOptionLinkMap = new Map();
186
+ dataDefault = {};
187
+ constructor(path) {
188
+ this.path = path;
189
+ this.keySetValidator('parsable', configDefault.parsable, configValueBoolean());
190
+ this.keySetValidator('noColor', configDefault.noColor, configValueBoolean());
191
+ this.keySetValidator('posix', configDefault.posix, configValueBoolean());
192
+ this.keySetValidator('filter', configDefault.filter, configValueLiteral(filterNameList));
193
+ this.keySetValidator('sort', configDefault.sort, configValueLiteral(sortNameList));
194
+ this.keySetValidator('style', configDefault.style, configValueLiteral(styleNameList));
195
+ this.keySetValidator('decor', configDefault.decor, configValueLiteral(decorNameList));
196
+ this.keySetValidator('depth', configDefault.depth, configValueInteger());
197
+ this.keySetValidator('showSources', configDefault.showSources, configValueBoolean());
198
+ this.keySetValidator('concurrency', configDefault.concurrency, configValueInteger());
199
+ }
200
+ dataCheck(data) {
201
+ const propertyStack = new Map();
202
+ const object = data;
203
+ if (object?.constructor !== Object) {
204
+ return configValueObject()(object);
205
+ }
206
+ for (const key in object) {
207
+ if (!Object.hasOwn(object, key)) {
208
+ continue;
209
+ }
210
+ const value = object[key];
211
+ const message = this.checkValue(key, value);
212
+ if (message === undefined) {
213
+ continue;
214
+ }
215
+ propertyStack.set(key, message);
216
+ }
217
+ return propertyStack;
218
+ }
219
+ getType(key) {
220
+ return this.configValidation.get(key)?.typeName ?? 'any';
150
221
  }
151
- entries() {
152
- const obj = this.dataRaw();
153
- if (obj?.constructor !== Object) {
222
+ keyGetValidator(key) {
223
+ return this.configValidation.get(key);
224
+ }
225
+ /**
226
+ * Define type checker for the key.
227
+ */
228
+ keySetValidator(key, defaultValue, type) {
229
+ this.configValidation.set(key, type);
230
+ const errorMessage = type(defaultValue);
231
+ if (errorMessage !== undefined) {
232
+ throw new TypeError(`Invalid default value preset for configuration key ${format(key)} - ${errorMessage}`);
233
+ }
234
+ this.dataDefault[key] = defaultValue;
235
+ return this;
236
+ }
237
+ /**
238
+ * Checks if the key is defined.
239
+ * @returns Error message if the key is not defined.
240
+ */
241
+ checkKey(key) {
242
+ if (this.configValidation.has(key)) {
154
243
  return;
155
244
  }
156
- return Object.entries(obj);
245
+ return `Unknown config key '${key}'. Choices: ${Array.from(this.configValidation.keys()).join(', ')}`;
246
+ }
247
+ checkValue(key, value) {
248
+ const validate = this.configValidation.get(key);
249
+ if (validate === undefined) {
250
+ return;
251
+ }
252
+ return validate(value);
253
+ }
254
+ setOption(key, command, option, parseArgument) {
255
+ if (parseArgument) {
256
+ option.argParser(parseArgument);
257
+ }
258
+ const deflt = configManager.get(key);
259
+ option.default(deflt);
260
+ command.addOption(option);
261
+ this.cliOptionLinkMap.set(key, option);
262
+ return this;
263
+ }
264
+ getOption(key) {
265
+ return this.cliOptionLinkMap.get(key);
157
266
  }
158
267
  /**
159
- * Loads the config from the file to {@link configManager.data}. If the data is not valid, throws an error without loading.
160
- * @returns `undefined` if the config file does not exist.
268
+ * Loads the config from the file to {@link configManager.data}.
269
+ * @returns The error message for each invalid property.
161
270
  */
162
271
  load() {
163
- const parsed = existsSync(this.filePath) ? yaml.parse(readFileSync(this.filePath).toString()) : undefined;
272
+ const parsed = existsSync(this.path) ? yaml.parse(readFileSync(this.path).toString()) : undefined;
164
273
  if (parsed === undefined) {
165
- return parsed;
274
+ return;
166
275
  }
167
- const obj = parsed;
168
- if (obj?.constructor !== Object) {
169
- return this;
276
+ const message = this.dataCheck(parsed);
277
+ if (typeof message === 'string') {
278
+ return message;
170
279
  }
171
- for (const key in obj) {
172
- const element = obj[key];
173
- if (typeof element !== "string") {
280
+ const object = parsed;
281
+ for (const key in object) {
282
+ if (!Object.hasOwn(object, key) || message.has(key)) {
174
283
  continue;
175
284
  }
176
- if (element.startsWith('|')) {
177
- const array = element.split(',');
178
- array.shift();
179
- parsed[key] = array;
180
- }
181
- }
182
- if (!isConfigPartial(parsed)) {
183
- throw new TypeError(`Invalid config.`, { cause: parsed });
285
+ const element = object[key];
286
+ this.data[key] = element;
184
287
  }
185
- Object.assign(this.data, parsed);
186
- return this;
288
+ return message;
187
289
  }
188
290
  /**
189
291
  * Saves the partial config to the file. If there are no settings, the file will be deleted, if exists.
190
292
  */
191
293
  save() {
192
294
  if (Object.keys(this.data).length === 0) {
193
- if (existsSync(this.filePath)) {
194
- rmSync(this.filePath);
295
+ if (existsSync(this.path)) {
296
+ rmSync(this.path);
195
297
  }
196
298
  return this;
197
299
  }
198
- writeFileSync(this.filePath, yaml.stringify(this.data));
300
+ writeFileSync(this.path, yaml.stringify(this.data));
199
301
  return this;
200
302
  }
201
- /**
202
- * Sets a new value for the specified config property.
203
- * Expects a valid value.
204
- * @param key The name of the config property.
205
- * @param value The new value for the config property.
206
- */
207
303
  set(key, value) {
304
+ const errorMessage = this.checkValue(key, value);
305
+ if (errorMessage !== undefined) {
306
+ return errorMessage;
307
+ }
208
308
  this.data[key] = value;
209
- return this;
210
309
  }
211
- /**
212
- * Deletes the specified property from the config.
213
- * If the property is not specified, then all properties will be deleted.
214
- * @param key The config property.
215
- */
216
310
  unset(key) {
217
311
  if (key === undefined) {
218
312
  for (const key of Object.keys(this.data)) {
219
- delete this.data[key];
313
+ delete this.data[key]; // eslint-disable-line @typescript-eslint/no-dynamic-delete
220
314
  }
221
315
  return this;
222
316
  }
223
- delete this.data[key];
317
+ delete this.data[key]; // eslint-disable-line @typescript-eslint/no-dynamic-delete
224
318
  return this;
225
319
  }
226
320
  /**
227
321
  * @returns An array of properties which defined in the configuration file.
228
322
  */
229
- definedKeys() {
230
- const keys = Object.keys(this.data);
231
- return keys.filter(k => this.data[k] !== undefined);
323
+ keyList(real = true) {
324
+ const keys = real ? Array.from(this.configValidation.keys()) : Object.keys(this.data);
325
+ return keys;
232
326
  }
233
- get(key, defs = true) {
234
- const value = this.data[key];
235
- if (defs && value === undefined) {
236
- return configDefault[key];
327
+ get(key, options) {
328
+ const { real = true } = options ?? {};
329
+ let value = this.data[key];
330
+ if (real && value === undefined) {
331
+ value = this.dataDefault[key];
332
+ if (value === undefined) {
333
+ throw new Error(`Excpected default value for config property '${key}'.`);
334
+ }
237
335
  }
238
336
  return value;
239
337
  }
240
- /**
241
- * @param key The config property.
242
- * @param defs If `true`, the default value will be used when the value is `undefined`. Default `true`.
243
- * @returns A string in the `"key=value"` format, if the property is specified.
244
- * Otherwise in format `"key=value\nkey=value\n..."` without the '\n' ending.
245
- */
246
- getPairString(key, defs = true) {
247
- if (key === undefined) {
248
- return configKeyList.map((key) => this.getPairString(key, defs)).filter(Boolean).join('\n');
338
+ getPairString(keys, options) {
339
+ const { real = true, types = true, chalk, parsable } = options ?? {};
340
+ if (keys === undefined) {
341
+ return this.getPairString(this.keyList(real), options);
342
+ }
343
+ if (typeof keys === 'string') {
344
+ return this.getPairString([keys], options);
345
+ }
346
+ if (parsable) {
347
+ return keys.map((key) => {
348
+ const value = format('%o', this.get(key, options));
349
+ if (types) {
350
+ const type = this.getType(key);
351
+ return `${key}\n${value}\n${type}`;
352
+ }
353
+ return `${key}\n${value}`;
354
+ }).join('\n');
249
355
  }
250
- const val = this.get(key, defs);
251
- return val === undefined ? '' : `${key}=${val}`;
356
+ // eslint-disable-next-line unicorn/no-array-reduce
357
+ const keyMaxLength = keys.reduce((maxLength, key) => Math.max(maxLength, key.length), 0);
358
+ return keys.map((key) => {
359
+ const value = format('%o', this.get(key, options));
360
+ const type = this.getType(key);
361
+ const pad = keyMaxLength - key.length;
362
+ const line = types ? format(`${' '.repeat(pad)}%s ${highlight('=', chalk)} %s${highlight(':', chalk)} %s`, (chalk ? chalk.hex('#FFBC42')(key) : key), chalk ? highlight(value, chalk) : value, (chalk ? chalk.dim(highlight(type, chalk)) : type)) : format(`${' '.repeat(pad)}%s ${highlight('=', chalk)} %s`, (chalk ? chalk.hex('#FFBC42')(key) : key), chalk ? highlight(value, chalk) : value);
363
+ return line;
364
+ }).join('\n');
252
365
  }
253
366
  }
254
367
  /**
255
368
  * File-specific actions container. Contains get, set, unset, save, load and other configuration actions.
369
+ * @public
256
370
  */
257
371
  export const configManager = new ConfigManager(configFilePath);
@@ -0,0 +1,7 @@
1
+ import { type ConfigKey } from './config.js';
2
+ export * from './browser/errors.js';
3
+ /**
4
+ * For each property of the configuration we have an error message.
5
+ * @public
6
+ */
7
+ export type ConfigCheckMap = Map<string | ConfigKey, string>;
@@ -0,0 +1 @@
1
+ export * from './browser/errors.js';
@@ -1,3 +1,3 @@
1
- import * as ViewIgnored from "./lib.js";
1
+ import * as ViewIgnored from './lib.js';
2
2
  export default ViewIgnored;
3
- export * from "./lib.js";
3
+ export * from './lib.js';
package/out/src/index.js CHANGED
@@ -1,3 +1,3 @@
1
- import * as ViewIgnored from "./lib.js";
1
+ import * as ViewIgnored from './lib.js';
2
2
  export default ViewIgnored;
3
- export * from "./lib.js";
3
+ export * from './lib.js';
package/out/src/lib.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- export * from "./browser/lib.js";
2
- export * as Styling from "./styling.js";
3
- export * as Cli from "./cli.js";
4
- export * as Config from "./config.js";
1
+ export * from './browser/lib.js';
2
+ export * as Styling from './styling.js';
3
+ export * as Cli from './cli.js';
4
+ export * as Config from './config.js';
package/out/src/lib.js CHANGED
@@ -1,4 +1,4 @@
1
- export * from "./browser/lib.js";
2
- export * as Styling from "./styling.js";
3
- export * as Cli from "./cli.js";
4
- export * as Config from "./config.js";
1
+ export * from './browser/lib.js';
2
+ export * as Styling from './styling.js';
3
+ export * as Cli from './cli.js';
4
+ export * as Config from './config.js';
@@ -1,4 +1,10 @@
1
- import { ChalkInstance } from "chalk";
2
- import { DecorName } from "./browser/styling.js";
3
- export * from "./browser/styling.js";
4
- export declare function formatConfigConflicts(chalk: ChalkInstance, decor: DecorName, error: unknown): void;
1
+ import { type ChalkInstance } from 'chalk';
2
+ export * from './browser/styling.js';
3
+ /**
4
+ * @public
5
+ */
6
+ export declare function highlight(text: string, chalk?: ChalkInstance): string;
7
+ /**
8
+ * @public
9
+ */
10
+ export declare function stringTime(time: number, chalk: ChalkInstance): string;