mirror of
https://github.com/Afilmory/afilmory
synced 2026-04-24 23:05:05 +00:00
Signed-off-by: Innei <tukon479@gmail.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
45 lines
1.2 KiB
TypeScript
45 lines
1.2 KiB
TypeScript
import type { FC, PropsWithChildren } from 'react'
|
|
|
|
declare global {
|
|
export type Nullable<T> = T | null | undefined
|
|
|
|
type IsLiteralString<T> = T extends string ? (string extends T ? never : T) : never
|
|
|
|
type OmitStringType<T> = T extends any[] ? OmitStringType<T[number]> : IsLiteralString<T>
|
|
type NonUndefined<T> = T extends undefined ? never : T extends object ? { [K in keyof T]: NonUndefined<T[K]> } : T
|
|
|
|
type NilValue = null | undefined | false | ''
|
|
type Prettify<T> = {
|
|
[K in keyof T]: T[K]
|
|
} & {}
|
|
|
|
const APP_NAME: string
|
|
/**
|
|
* This function is a macro, will replace in the build stage.
|
|
*/
|
|
export function tw(strings: TemplateStringsArray, ...values: any[]): string
|
|
}
|
|
|
|
declare global {
|
|
export type Component<P = object> = FC<Prettify<ComponentType & P>>
|
|
|
|
export type ComponentWithRef<P = object, Ref = object> = FC<ComponentWithRefType<P, Ref>>
|
|
export type ComponentWithRefType<P = object, Ref = object> = Prettify<
|
|
ComponentType<P> & {
|
|
ref?: React.Ref<Ref>
|
|
}
|
|
>
|
|
|
|
export type ComponentType<P = object> = {
|
|
className?: string
|
|
} & PropsWithChildren &
|
|
P
|
|
}
|
|
|
|
declare module 'react' {
|
|
export interface AriaAttributes {
|
|
'data-testid'?: string
|
|
'data-hide-in-print'?: boolean
|
|
}
|
|
}
|