@unraven/env 1.0.2 → 1.0.3
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/dist/index.d.ts +13 -4
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -53,15 +53,23 @@ declare class YamlFormatter extends BaseFormatter implements FormatterContract {
|
|
|
53
53
|
}
|
|
54
54
|
//#endregion
|
|
55
55
|
//#region src/formatter.d.ts
|
|
56
|
-
declare class Formatter<T extends Record<string, new (type: string) => FormatterContract>, Format extends Extract<keyof T, string> = Extract<keyof T, string>> {
|
|
56
|
+
declare class Formatter<T extends Record<string, new (type: string) => FormatterContract>, Format$1 extends Extract<keyof T, string> = Extract<keyof T, string>> {
|
|
57
57
|
private formatters;
|
|
58
58
|
constructor(formatters: T);
|
|
59
|
-
use<Type extends Format>(type: Type): InstanceType<T[Type]>;
|
|
59
|
+
use<Type extends Format$1>(type: Type): InstanceType<T[Type]>;
|
|
60
60
|
detect(file: string): "json" | "yaml" | "dotenv";
|
|
61
|
-
format<Type extends Format>(type: Type, items: Formattable[], options?: Parameters<InstanceType<T[Type]>['format']>[1]): string;
|
|
61
|
+
format<Type extends Format$1>(type: Type, items: Formattable[], options?: Parameters<InstanceType<T[Type]>['format']>[1]): string;
|
|
62
62
|
sort<T extends Groupable>(items: T[]): T[];
|
|
63
63
|
}
|
|
64
64
|
//#endregion
|
|
65
|
+
//#region src/formatters/index.d.ts
|
|
66
|
+
declare const formatters: {
|
|
67
|
+
dotenv: typeof DotenvFormatter;
|
|
68
|
+
json: typeof JsonFormatter;
|
|
69
|
+
json_array: typeof JsonFormatter;
|
|
70
|
+
yaml: typeof YamlFormatter;
|
|
71
|
+
};
|
|
72
|
+
//#endregion
|
|
65
73
|
//#region src/index.d.ts
|
|
66
74
|
declare const formatter: Formatter<{
|
|
67
75
|
dotenv: typeof DotenvFormatter;
|
|
@@ -69,5 +77,6 @@ declare const formatter: Formatter<{
|
|
|
69
77
|
json_array: typeof JsonFormatter;
|
|
70
78
|
yaml: typeof YamlFormatter;
|
|
71
79
|
}, "dotenv" | "json" | "json_array" | "yaml">;
|
|
80
|
+
type Format = keyof typeof formatters;
|
|
72
81
|
//#endregion
|
|
73
|
-
export { formatter };
|
|
82
|
+
export { Format, formatter };
|