DefinitelyTyped/types/react-native-view-pdf/index.d.ts
Sérgio Miguel 518f614f92 Add types for react-native-view-pdf (#34291)
* Add types/test for react-native-view-pdf

* Specify ts version

* Specify strictFunctionTypes
2019-03-29 00:25:22 -07:00

34 lines
1.1 KiB
TypeScript

// Type definitions for react-native-view-pdf 0.8
// Project: https://github.com/rumax/react-native-PDFView#readme
// Definitions by: Sérgio Miguel <https://github.com/thesergiomiguel>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 3.1
import * as React from 'react';
type HTTPMethod = 'GET' | 'HEAD' | 'POST' | 'PUT' | 'DELETE' | 'CONNECT' | 'OPTIONS' | 'TRACE' | 'PATCH';
interface URLProps {
method?: HTTPMethod;
headers?: { [key: string]: string };
body?: string;
}
export interface PDFViewProps {
onError?: (error: Error) => void;
onLoad?: () => void;
onPageChanged?: (page: number, pageCount: number) => void;
onScrolled?: (offset: number) => void;
resource: string;
resourceType?: 'url' | 'base64' | 'file';
fileFrom?: 'bundle' | 'documentsDirectory';
urlProps?: URLProps;
textEncoding?: 'utf-8' | 'utf-16';
fadeInDuration?: number;
[key: string]: any;
}
declare class PDFView extends React.Component<PDFViewProps> {}
export default PDFView;