From 74ec19b5fabb31445b36d85611c30af6e8730e38 Mon Sep 17 00:00:00 2001 From: Jaakko Hannikainen Date: Sat, 24 Feb 2024 13:59:46 +0200 Subject: [PATCH] Break typedoc with complex types --- src/index.ts | 33 +++++++++++++++++++++++++++++---- 1 file changed, 29 insertions(+), 4 deletions(-) diff --git a/src/index.ts b/src/index.ts index c0a8215..1a6f58b 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,4 +1,29 @@ -/** - * Some code reproducing a bug. - */ -export const bug = 123; +export interface Struct { + fields: { [key: string]: Value }; +} + +export interface Struct_FieldsEntry { + value: Value | undefined; +} + +export interface Value { + structValue?: Struct | undefined; + listValue?: ListValue | undefined; +} + +export interface ListValue { + values: Value[]; +} + +export function fromPartial, I>>(object: I): Struct_FieldsEntry { + return undefined as any; +}; + +type Builtin = undefined; + +export type DeepPartial = T extends Builtin ? T : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & { [K in Exclude>]: never };