Skip to content

Commit

Permalink
chore: wip
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisbbreuer committed Nov 5, 2024
1 parent a4ac02d commit 8655dca
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 0 deletions.
File renamed without changes.
48 changes: 48 additions & 0 deletions fixtures/output/type.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
import type { DtsGenerationOption } from '@stacksjs/dtsx';

export type { DtsGenerationOption };
export declare type AuthStatus = 'authenticated' | 'unauthenticated'

export type ComplexUnionIntersection =
| (User & { role: 'admin' })
| (Product & { category: string })
& {
metadata: Record<string, unknown>
}
export declare type ReadonlyDeep<T> = {
readonly [P in keyof T]: T[P] extends object ? ReadonlyDeep<T[P]> : T[P]
}
export declare type ConditionalResponse<T> = T extends Array<infer U>
? ApiResponse<U[]>
: T extends object
? ApiResponse<T>
: ApiResponse<string>
export declare type EventType = 'click' | 'focus' | 'blur'
export type ElementType = 'button' | 'input' | 'form'
export declare type EventHandler = `on${Capitalize<EventType>}${Capitalize<ElementType>}`

export type RecursiveObject = {
id: string
children?: RecursiveObject[]
parent?: RecursiveObject
metadata: Record<string, unknown>
}
export declare type UserId = string & { readonly __brand: unique symbol }
export declare type DeepPartial<T> = T extends object ? {
[P in keyof T]?: DeepPartial<T[P]>
} : T
export declare type DeepRequired<T> = T extends object ? {
[P in keyof T]-?: DeepRequired<T[P]>
} : T
export declare type PolymorphicComponent<P = {}> = {
<C extends React.ElementType>(
props: { as?: C } & Omit<React.ComponentPropsWithRef<C>, keyof P> & P
): React.ReactElement | null
}
export declare type DynamicRecord<K extends PropertyKey> = {
[P in K]: P extends number
? Array<unknown>
: P extends string
? Record<string, unknown>
: never
}

0 comments on commit 8655dca

Please sign in to comment.