import { expectTypeOf } from 'expect-type'; import { FlagsDeclarationOption as FlagsDec, LogLevel, MapDeclarationOption as MapDec, ParameterType as PType, StringDeclarationOption as StrDec, } from 'typedoc'; import { ExtractEnum, ParameterValueType } from './utils'; describe( 'Typings', () => { const maybe = true as boolean; it( 'should infer correct types', () => { if( maybe ) return; expectTypeOf>().toEqualTypeOf(); expectTypeOf>>().toEqualTypeOf<'foo' | 'bar'>(); expectTypeOf>>>().toEqualTypeOf>(); expectTypeOf>().toEqualTypeOf(); expectTypeOf>().toEqualTypeOf<'foo' | 'qux'>(); expectTypeOf>().toEqualTypeOf>(); expectTypeOf>().toEqualTypeOf(); expectTypeOf>().toEqualTypeOf(); const mapKv = { help: '', type: PType.Map, map: { hello: 'foo', world: 'qux' }, defaultValue: 'foo' } as const; expectTypeOf>().toEqualTypeOf<'foo' | 'qux'>(); const mapLogLevel = { help: '', type: PType.Map, map: LogLevel, defaultValue: LogLevel.Error } as const; expectTypeOf>().toEqualTypeOf(); expectTypeOf>().toEqualTypeOf(); } ); } );