/* * Copyright (C) Contributors to the Suwayomi project * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ type ExtractByKeyValue = T extends | Record | Partial> ? T : never; type RecursivePartial = { [P in keyof T]?: T[P] extends (infer U)[] ? RecursivePartial[] : T[P] extends object | undefined ? RecursivePartial : T[P]; }; type OptionalProperty = Omit & Partial>; type PropertiesNever = { [key in keyof T]?: never }; type OmitFirst = T extends [any, ...infer R] ? R : never; type TupleUnion = { [S in U]: Exclude extends never ? [...R, S] : TupleUnion, [...R, S]>; }[U]; type TransformRecordToWithDefaultFlag> = { [K in keyof T]: { value: T[K]; isDefault: boolean }; };