Files
NapCatQQ/.pnpm-store/v3/files/2c/f897b931f0623fb954745daa957147ecd331bf5c5c3213becd36c678a53ada07a4f14c94b1e204a43628a3f4635b59a88265be4ad7ca1493d30d13e86c0e9b
TanTan e311ca3275
Build NapCat Artifacts / Windows Loader Test (push) Canceled after 0s
Build NapCat Artifacts / Type Check & Test (push) Canceled after 0s
Build NapCat Artifacts / Build NapCat.Framework (push) Canceled after 0s
Build NapCat Artifacts / Build NapCat.Shell (push) Canceled after 0s
docs: 仓库链接指向本镜像仓库
2026-11-13 09:25:58 +08:00

35 lines
1.2 KiB
Plaintext

import { ComponentType, ErrorInfo, PropsWithChildren, ReactNode } from "react";
export type FallbackProps = {
error: any;
resetErrorBoundary: (...args: any[]) => void;
};
type ErrorBoundarySharedProps = PropsWithChildren<{
onError?: (error: Error, info: ErrorInfo) => void;
onReset?: (details: {
reason: "imperative-api";
args: any[];
} | {
reason: "keys";
prev: any[] | undefined;
next: any[] | undefined;
}) => void;
resetKeys?: any[];
}>;
export type ErrorBoundaryPropsWithComponent = ErrorBoundarySharedProps & {
fallback?: never;
FallbackComponent: ComponentType<FallbackProps>;
fallbackRender?: never;
};
export type ErrorBoundaryPropsWithRender = ErrorBoundarySharedProps & {
fallback?: never;
FallbackComponent?: never;
fallbackRender: (props: FallbackProps) => ReactNode;
};
export type ErrorBoundaryPropsWithFallback = ErrorBoundarySharedProps & {
fallback: ReactNode;
FallbackComponent?: never;
fallbackRender?: never;
};
export type ErrorBoundaryProps = ErrorBoundaryPropsWithFallback | ErrorBoundaryPropsWithComponent | ErrorBoundaryPropsWithRender;
export {};