@clockworkdog/cogs-client 2.0.0-beta.3 → 2.0.0-beta.4
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.
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { CogsValueType, CogsValueTypeBoolean, CogsValueTypeNumber, CogsValueTypeOption, CogsValueTypeString, CogsPluginManifest, PluginManifestStateJson } from './CogsPluginManifestJson';
|
|
2
2
|
import { DeepMutable, DistributeObject } from './utils';
|
|
3
|
-
export type TypeFromCogsValueType<ValueType extends Pick<CogsValueType, 'type'> | undefined> = ValueType extends CogsValueTypeOption<
|
|
3
|
+
export type TypeFromCogsValueType<ValueType extends Pick<CogsValueType, 'type'> | undefined> = ValueType extends CogsValueTypeOption<any> ? ValueType['options'][number] : ValueType extends CogsValueTypeString ? Readonly<string> : ValueType extends CogsValueTypeNumber ? number : ValueType extends CogsValueTypeBoolean ? boolean : undefined;
|
|
4
4
|
export type ConfigName<Manifest extends Pick<CogsPluginManifest, 'config'>> = NonNullable<Manifest['config']>[number]['name'];
|
|
5
5
|
export type ConfigAsObject<Manifest extends Pick<CogsPluginManifest, 'config'>> = DistributeObject<{
|
|
6
6
|
[Name in ConfigName<Manifest>]: TypeFromCogsValueType<Extract<DeepMutable<NonNullable<Manifest['config']>[number]>, {
|