mirror of
https://github.com/Start9Labs/start-sdk.git
synced 2026-03-30 20:24:47 +00:00
add wrapper type for optional description for unions
This commit is contained in:
14
types.ts
14
types.ts
@@ -190,6 +190,14 @@ export type WithDescription<T> = T & {
|
|||||||
warning?: string;
|
warning?: string;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export type WithOptionalDescription<T> = T & {
|
||||||
|
/** @deprecated - optional only for backwards compatibility */
|
||||||
|
description?: string;
|
||||||
|
/** @deprecated - optional only for backwards compatibility */
|
||||||
|
name?: string;
|
||||||
|
warning?: string;
|
||||||
|
};
|
||||||
|
|
||||||
export type ListSpec<T> = {
|
export type ListSpec<T> = {
|
||||||
spec: T;
|
spec: T;
|
||||||
range: string;
|
range: string;
|
||||||
@@ -275,7 +283,7 @@ export type ValueSpecAny =
|
|||||||
>
|
>
|
||||||
| Tag<"list", ValueSpecList>
|
| Tag<"list", ValueSpecList>
|
||||||
| Tag<"object", WithDescription<WithNullableDefault<ValueSpecObject, Config>>>
|
| Tag<"object", WithDescription<WithNullableDefault<ValueSpecObject, Config>>>
|
||||||
| Tag<"union", WithDescription<WithDefault<ValueSpecUnion, string>>>
|
| Tag<"union", WithOptionalDescription<WithDefault<ValueSpecUnion, string>>>
|
||||||
| Tag<
|
| Tag<
|
||||||
"pointer",
|
"pointer",
|
||||||
WithDescription<
|
WithDescription<
|
||||||
@@ -318,9 +326,7 @@ export type ValueSpecUnion = {
|
|||||||
/** What tag for the specification, for tag unions */
|
/** What tag for the specification, for tag unions */
|
||||||
tag: {
|
tag: {
|
||||||
id: string;
|
id: string;
|
||||||
/** @deprecated - optional only for backwards compatibility */
|
name: string;
|
||||||
name?: string;
|
|
||||||
/** @deprecated - optional only for backwards compatibility */
|
|
||||||
description?: string;
|
description?: string;
|
||||||
"variant-names": {
|
"variant-names": {
|
||||||
[key: string]: string;
|
[key: string]: string;
|
||||||
|
|||||||
Reference in New Issue
Block a user