mirror of
https://github.com/misskey-dev/misskey.git
synced 2026-07-27 08:24:35 +02:00
22 lines
1.1 KiB
TypeScript
22 lines
1.1 KiB
TypeScript
/*
|
|
* SPDX-FileCopyrightText: syuilo and misskey-project
|
|
* SPDX-License-Identifier: AGPL-3.0-only
|
|
*/
|
|
|
|
import type { BooleanOptionSchema, ColorOptionSchema, EnumOptionSchema, ImageOptionSchema, LightOptionSchema, MaterialOptionSchema, NumberOptionSchema, OptionsSchema, RangeOptionSchema, SeedOptionSchema, StringOptionSchema } from 'misskey-world/src/mono.js';
|
|
|
|
export type GetOptionsSchemaUiDef<T extends OptionsSchema> = {
|
|
[K in keyof T]:
|
|
T[K] extends NumberOptionSchema ? { label: string; } :
|
|
T[K] extends BooleanOptionSchema ? { label: string; } :
|
|
T[K] extends StringOptionSchema ? { label: string; } :
|
|
T[K] extends ColorOptionSchema ? { label: string; } :
|
|
T[K] extends MaterialOptionSchema ? { label: string; } :
|
|
T[K] extends LightOptionSchema ? { label: string; } :
|
|
T[K] extends EnumOptionSchema ? { label: string; enum: Record<T[K]['enum'][number]['value'], { label: string; }>; } :
|
|
T[K] extends RangeOptionSchema ? { label: string; } :
|
|
T[K] extends ImageOptionSchema ? { label: string; presets: Record<T[K]['presets'][number]['value'], { label: string; }>; } :
|
|
T[K] extends SeedOptionSchema ? { label: string; } :
|
|
never;
|
|
};
|