35 lines
1.7 KiB
TypeScript
35 lines
1.7 KiB
TypeScript
import * as React from 'react';
|
|
import { Primitive } from '@radix-ui/react-primitive';
|
|
|
|
type Scope<C = any> = {
|
|
[scopeName: string]: React.Context<C>[];
|
|
} | undefined;
|
|
type ScopeHook = (scope: Scope) => {
|
|
[__scopeProp: string]: Scope;
|
|
};
|
|
interface CreateScope {
|
|
scopeName: string;
|
|
(): ScopeHook;
|
|
}
|
|
|
|
declare const createAvatarScope: CreateScope;
|
|
type ImageLoadingStatus = 'idle' | 'loading' | 'loaded' | 'error';
|
|
type PrimitiveSpanProps = React.ComponentPropsWithoutRef<typeof Primitive.span>;
|
|
interface AvatarProps extends PrimitiveSpanProps {
|
|
}
|
|
declare const Avatar: React.ForwardRefExoticComponent<AvatarProps & React.RefAttributes<HTMLSpanElement>>;
|
|
type PrimitiveImageProps = React.ComponentPropsWithoutRef<typeof Primitive.img>;
|
|
interface AvatarImageProps extends PrimitiveImageProps {
|
|
onLoadingStatusChange?: (status: ImageLoadingStatus) => void;
|
|
}
|
|
declare const AvatarImage: React.ForwardRefExoticComponent<AvatarImageProps & React.RefAttributes<HTMLImageElement>>;
|
|
interface AvatarFallbackProps extends PrimitiveSpanProps {
|
|
delayMs?: number;
|
|
}
|
|
declare const AvatarFallback: React.ForwardRefExoticComponent<AvatarFallbackProps & React.RefAttributes<HTMLSpanElement>>;
|
|
declare const Root: React.ForwardRefExoticComponent<AvatarProps & React.RefAttributes<HTMLSpanElement>>;
|
|
declare const Image: React.ForwardRefExoticComponent<AvatarImageProps & React.RefAttributes<HTMLImageElement>>;
|
|
declare const Fallback: React.ForwardRefExoticComponent<AvatarFallbackProps & React.RefAttributes<HTMLSpanElement>>;
|
|
|
|
export { Avatar, AvatarFallback, type AvatarFallbackProps, AvatarImage, type AvatarImageProps, type AvatarProps, Fallback, Image, Root, createAvatarScope };
|