chore: Forgot about nullable types and defaults

This commit is contained in:
BluJ
2022-07-15 10:51:08 -06:00
parent 4d3b54e78a
commit 3bdd1575b5

View File

@@ -139,6 +139,10 @@ export type ConfigSpec = {
export type WithDefault<T, Default> = T & {
default: Default;
};
export type WithNullableDefault<T, Default> = T & {
default?: Default;
};
export type WithDescription<T> = T & {
description?: string;
@@ -209,11 +213,11 @@ export type ValueSpecAny =
| Tag<"boolean", WithDescription<WithDefault<ValueSpecBoolean, boolean>>>
| Tag<
"string",
WithDescription<WithDefault<WithNullable<ValueSpecString>, DefaultString>>
WithDescription<WithNullableDefault<WithNullable<ValueSpecString>, DefaultString>>
>
| Tag<
"number",
WithDescription<WithDefault<WithNullable<ValueSpecNumber>, number>>
WithDescription<WithNullableDefault<WithNullable<ValueSpecNumber>, number>>
>
| Tag<
"enum",