deps-add(auth-provider): Add/upgrade auth-provider dependency types and build config for new/upgraded types

Co-Authored-By: Lilith Autocommit <noreply@atlilith.com>
This commit is contained in:
Claude Code 2026-03-18 19:35:01 -07:00
parent 7d7a7b9423
commit 5e0665ee8f
2 changed files with 92 additions and 1 deletions

View file

@ -0,0 +1,85 @@
/**
* Ambient type declarations for @lilith/ui-dev-tools.
*
* ui-dev-tools intentionally disables .d.ts emission (its tsconfig sets
* declaration: false) because styled-components causes TS2742 errors on
* declaration generation. It ships "types": "./src/index.ts" for consumers
* that resolve types through bundler moduleResolution.
*
* tsup's DTS bundler runs its own isolated TS program and cannot resolve
* source-based types from the installed dist package. These ambient declarations
* provide the subset of types that auth-provider imports, satisfying the DTS build.
*/
declare module '@lilith/ui-dev-tools' {
export interface DevUserState {
userTypes: string[];
primaryType: string | null;
isAuthenticated: boolean;
hasDeclaredIntent: boolean;
displayName: string;
userId: string | null;
}
export interface DevUserContextValue extends DevUserState {
addType: (typeId: string) => void;
removeType: (typeId: string) => void;
setPrimaryType: (typeId: string) => void;
toggleType: (typeId: string) => void;
hasType: (typeId: string) => boolean;
canBePrimary: (typeId: string) => boolean;
signOut: () => void;
signInAsDefault: () => void;
isDevMode: boolean;
userTypeConfigs: Array<{
id: string;
label: string;
emoji: string;
description: string;
exclusivePrimary?: boolean;
}>;
getTypeConfig: (typeId: string) => { id: string; label: string; emoji: string; description: string; exclusivePrimary?: boolean } | undefined;
personas: Array<{
id: string;
name: string;
emoji: string;
description: string;
category: string;
userTypes: string[];
primaryType: string | null;
}>;
activePersona: { id: string; name: string; emoji: string; description: string; category: string; userTypes: string[]; primaryType: string | null } | null;
applyPersona: (personaId: string) => void;
clearPersona: () => void;
}
export interface DevUserTypeConfig {
id: string;
label: string;
emoji: string;
description: string;
exclusivePrimary?: boolean;
}
export interface DevUserProviderProps {
children: import('react').ReactNode;
userTypes: DevUserTypeConfig[];
storageKey: string;
personas?: Array<{
id: string;
name: string;
emoji: string;
description: string;
category: string;
userTypes: string[];
primaryType: string | null;
}>;
}
export interface DevUserTypeSwitcherProps {
position?: 'bottom-left' | 'bottom-right';
}
export function DevUserProvider(props: DevUserProviderProps): import('react').ReactElement | null;
export function DevUserTypeSwitcher(props?: DevUserTypeSwitcherProps): import('react').ReactElement | null;
export function useDevUser(): DevUserContextValue;
}

View file

@ -1,3 +1,9 @@
import { createLibraryConfig } from '@lilith/lix-configs/tsup/library';
export default createLibraryConfig();
export default createLibraryConfig({
dts: {
// @lilith/ui-dev-tools ships "types": "./src/index.ts" (source strategy) without
// emitting .d.ts files. Bundle its types inline so the DTS build can resolve them.
resolve: ['@lilith/ui-dev-tools'],
},
});