Support JSDoc IntelliSense on Object Properties (#324)

This commit is contained in:
Steve Zhu
2023-02-16 05:15:35 -05:00
committed by GitHub
parent 14b4d4a50b
commit 13682f66c3
+4 -4
View File
@@ -316,10 +316,10 @@ export type RequiredPropertyKeys<T extends TProperties> = keyof Omit<T, Readonly
// prettier-ignore
export type PropertiesReduce<T extends TProperties, P extends unknown[]> =
{ readonly [K in ReadonlyOptionalPropertyKeys<T>]?: Static<T[K], P> } &
{ readonly [K in ReadonlyPropertyKeys<T>]: Static<T[K], P> } &
{ [K in OptionalPropertyKeys<T>]?: Static<T[K], P> } &
{ [K in RequiredPropertyKeys<T>]: Static<T[K], P> } extends infer R ? { [K in keyof R]: R[K] } : never
Readonly<Partial<Pick<{ [K in keyof T]: Static<T[K], P> }, ReadonlyOptionalPropertyKeys<T>>>> &
Readonly<Pick<{ [K in keyof T]: Static<T[K], P> }, ReadonlyPropertyKeys<T>>> &
Partial<Pick<{ [K in keyof T]: Static<T[K], P> }, OptionalPropertyKeys<T>>> &
Required<Pick<{ [K in keyof T]: Static<T[K], P> }, RequiredPropertyKeys<T>>> extends infer R ? { [K in keyof R]: R[K] } : never
export type TRecordProperties<K extends TUnion<TLiteral[]>, T extends TSchema> = Static<K> extends string ? { [X in Static<K>]: T } : never