Skip to main content

Type Alias: UserSettingFromRecord<R, K>

UserSettingFromRecord<R, K> = K extends keyof R ? UserSetting<ToNonNullable<PropertyTypeOf<R, K>>> | undefined extends R[K] ? undefined : never : undefined

Defined in: src/sdk/settings/UserSetting.ts:59

Retrieves a user setting from a user setting record by its name. If the provided name does not exist in the record, then a type of undefined is returned. If the provided name is optional in the record, then a union type of UserSetting<T> | undefined is returned, where T is the value type mapped to the name in the record.

Type Parameters

Type ParameterDescription
R extends UserSettingRecordThe user setting record from which to retrieve the setting.
K extends stringThe name of the setting to retrieve.