UNPKG

1.03 kBTypeScriptView Raw
1import type { GenericDescriptor, PropertyDescriptor } from "../index";
2
3declare function CompletePropertyDescriptor<D extends PropertyDescriptor>(
4 Desc: D & ThisType<any>,
5): Required<
6 D extends { "[[Value]]": infer T } ? GenericDescriptor & {
7 "[[Value]]": T;
8 "[[Writable]]": boolean;
9 }
10 : D extends { "[[Value]]"?: infer T | undefined } | { "[[Writable]]"?: boolean | undefined }
11 ? GenericDescriptor & {
12 "[[Value]]": T | undefined;
13 "[[Writable]]": boolean;
14 }
15 : D extends { "[[Get]]"?: (() => infer T) | undefined } | { "[[Set]]"?: ((value: infer T) => void) | undefined }
16 ? GenericDescriptor & {
17 "[[Get]]": (() => T) | undefined;
18 "[[Set]]": ((value: T) => void) | undefined;
19 }
20 : D & PropertyDescriptor
21>;
22declare function CompletePropertyDescriptor(Desc: PropertyDescriptor & ThisType<any>): Required<PropertyDescriptor>;
23export = CompletePropertyDescriptor;
24
\No newline at end of file