From 4a1bdcc68e44c7b96105ca9448ef6e4f7c808a11 Mon Sep 17 00:00:00 2001 From: Islam Kamel Date: Sun, 1 Dec 2024 01:23:37 +0200 Subject: [PATCH] chore: remove @ts-ignore --- packages/renderer/index.d.ts | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/packages/renderer/index.d.ts b/packages/renderer/index.d.ts index a6864f42e..9f24f51ce 100644 --- a/packages/renderer/index.d.ts +++ b/packages/renderer/index.d.ts @@ -3,17 +3,17 @@ /* eslint-disable max-classes-per-file */ import * as React from 'react'; import { - Style, - PageSize, + Bookmark, FontStore, - PDFVersion, - Orientation, - SourceObject, HyphenationCallback, - SVGPresentationAttributes, - Bookmark, + Orientation, PageLayout, PageMode, + PageSize, + PDFVersion, + SourceObject, + Style, + SVGPresentationAttributes, } from '@react-pdf/types'; declare class ReactPDF { @@ -28,6 +28,7 @@ declare namespace ReactPDF { interface Styles { [key: string]: Style; } + interface OnRenderProps { blob?: Blob; } @@ -466,6 +467,7 @@ declare namespace ReactPDF { loading: boolean; error: Error | null; } + interface BlobProviderProps { document: React.ReactElement; children: (params: BlobProviderParams) => React.ReactNode; @@ -495,15 +497,18 @@ declare namespace ReactPDF { */ export class PDFViewer extends React.Component {} - // @ts-ignore interface PDFDownloadLinkProps - extends Omit, 'href'> { + extends Omit< + React.AnchorHTMLAttributes, + 'href' | 'children' + > { /** PDF filename. Alias for anchor tag `download` attribute. */ fileName?: string; document: React.ReactElement; children?: | React.ReactNode - | ((props: BlobProviderParams) => React.ReactNode); + | React.ReactElement + | ((params: BlobProviderParams) => React.ReactNode); onClick?: React.AnchorHTMLAttributes['onClick'] & (( event: React.MouseEvent,