import * as React from "react"; import { EasingFunction } from "react-native"; import { INodeImmutable } from "@ef-carbon/dom"; import { Url } from "@ef-carbon/primitive"; import { Component } from "@ef-carbon/react-render-component"; import IBaseProps from "../IProps"; import IResource, { IOptions as IResourceOptions } from "../IResource"; export declare type LoadingComponent = Component; export declare type ErrorComponent = Component; export declare type DefaultAction = () => void; export interface IIdleComponentProps { load(): Promise; } export declare type IdleComponent = Component; export interface IProps extends IResourceOptions, IBaseProps { LoadingComponent: LoadingComponent; ErrorComponent: ErrorComponent; IdleComponent?: IdleComponent; node: INodeImmutable; onUnload(): Promise; reloads: number; onReload(attempts: number): void; onError(error: Error): void; progress: number; error: Error | undefined; showLoading: boolean; onDefaultAction?: DefaultAction; animate?: boolean; fadeDelay?: number; fadeDuration?: number; fadeEasing?: EasingFunction; onFadeBegin?(): void; onFadeEnd?(): void; reloadParameter?: string; reloadAttempts?: number; } export interface IState { opacity: number; } declare class Resource extends React.PureComponent, IState> implements IResource { private mounted; constructor(props: IProps); componentDidMount(): void; componentWillUnmount(): void; componentWillReceiveProps({ progress: next, showLoading }: IProps): void; render(): React.ReactNode; readonly url: Url; private readonly cover; readonly progress: number; readonly loading: boolean; readonly loaded: boolean; readonly unloaded: boolean; readonly error: Error | undefined; unload(): Promise; reload(): Promise; private readonly reloads; private readonly reloadParameter; private readonly reloadAttempts; private readonly implementationStyle; private readonly coverStyle; private loadingComponent; private errorComponent; private idleComponent; private defaultAction; private readonly handleAnimationBegin; private readonly handleAnimationEnd; private readonly handlePress; private readonly handleLongPress; private readonly catcher; } export interface IStatic extends React.ComponentClass> { } declare const component: IStatic; export { component as Component }; export default Resource;