From 294ee81acc4e6e1b190037d573bce63fff7e86f4 Mon Sep 17 00:00:00 2001 From: Chris Date: Fri, 1 Nov 2024 22:56:15 +0100 Subject: [PATCH] chore: wip --- fixtures/input/variable.ts | 38 +++++++++++++++++------------------ fixtures/output/variable.d.ts | 24 ++++++++++++++++++++++ 2 files changed, 43 insertions(+), 19 deletions(-) diff --git a/fixtures/input/variable.ts b/fixtures/input/variable.ts index 189293e..907377a 100644 --- a/fixtures/input/variable.ts +++ b/fixtures/input/variable.ts @@ -180,22 +180,22 @@ export const methodDecoratorWithExplicitType = ( } } -// TODO: Complex Constants with Type Inference -// export const CONFIG_MAP = { -// development: { -// features: { -// auth: { -// providers: ['google', 'github'] as const, -// settings: { timeout: 5000, retries: 3 } -// } -// } -// }, -// production: { -// features: { -// auth: { -// providers: ['google', 'github', 'microsoft'] as const, -// settings: { timeout: 3000, retries: 5 } -// } -// } -// } -// } as const +// Complex Constants with Type Inference +export const CONFIG_MAP = { + development: { + features: { + auth: { + providers: ['google', 'github'] as const, + settings: { timeout: 5000, retries: 3 } + } + } + }, + production: { + features: { + auth: { + providers: ['google', 'github', 'microsoft'] as const, + settings: { timeout: 3000, retries: 5 } + } + } + } +} as const diff --git a/fixtures/output/variable.d.ts b/fixtures/output/variable.d.ts index 25fa961..bebf67a 100644 --- a/fixtures/output/variable.d.ts +++ b/fixtures/output/variable.d.ts @@ -101,3 +101,27 @@ export declare const complexObject: { }; export declare const methodDecorator: (...args: any[]) => unknown; export declare const methodDecoratorWithExplicitType: SomeType; +export declare const CONFIG_MAP: { + development: { + features: { + auth: { + providers: Array<'google' | 'github'] as cons>; + settings: { + timeout: 5000; + retries: 3 + } + } + } + }; + production: { + features: { + auth: { + providers: Array<'google' | 'github' | 'microsoft'] as cons>; + settings: { + timeout: 3000; + retries: 5 + } + } + } + } +};