import * as React from "react"; import { EasingFunction, TextStyle } from "react-native"; import { INodeAudioImmutable, INodeAudioOptions, INodeTextImmutable, ITrackImmutable, NodeType } from "@ef-carbon/dom"; import { Milliseconds, MillisecondsAccepted, Url } from "@ef-carbon/primitive"; import { Component } from "@ef-carbon/react-render-component"; import IFullscreen from "../IFullscreen"; import IBaseProps from "../IProps"; import { ErrorComponent, IdleComponent, IProps as IResourceProps, LoadingComponent } from "../Resource/index"; import IMediaAudio, { IOptions as IMediaAudioOptions } from "../media/IAudio"; import { FullscreenComponent, IProps as IControlsProps, SeekComponent, StateComponent, TimeComponent } from "../media/playable/Controls/index"; import State from "../media/playable/State"; import Action from "../event/Action"; import { IProps as IFullscreenProps } from "./Fullscreen/index"; export { LoadingComponent, ErrorComponent, FullscreenComponent, SeekComponent, StateComponent, TimeComponent }; export declare type OpenFullscreen = (node: React.ReactNode) => IFullscreen; export declare type Implementation = (options: IMediaAudioOptions) => IMediaAudio; export declare type ControlsComponent = Component; export declare type FullscreenImplementationComponent = Component; export interface IProps extends INodeAudioOptions, IBaseProps, Partial, "LoadingComponent" | "ErrorComponent" | "reloadParameter" | "reloadAttempts">> { implementation?: Implementation; FullscreenImplementationComponent?: FullscreenImplementationComponent | null; openFullscreen?: OpenFullscreen; StateComponent?: StateComponent | null; SeekComponent?: SeekComponent | null; seekComponentBreakpoint?: number | null; TimeComponent?: TimeComponent | null; FullscreenComponent?: FullscreenComponent | null; ControlsComponent?: ControlsComponent | null; IdleComponent?: IdleComponent | null; loop?: boolean; autoPlay?: boolean; positionInterval?: MillisecondsAccepted; onPosition?(position: Milliseconds): void; onStateChange?(state: State): void; onLoad?(): void; animate?: boolean; lazyLoad?: boolean; animationDelay?: number; animationDuration?: number; animationEasing?: EasingFunction; } export interface IState { progress: number; reloads: number; error?: Error; state: State; position: Milliseconds; duration: Milliseconds; } declare class Audio extends React.PureComponent implements IMediaAudio, INodeAudioImmutable { private mounted; private resourceRef; private instance; private array; static implementation?: Implementation; static FullscreenImplementationComponent?: FullscreenImplementationComponent; static LoadingComponent?: LoadingComponent; static ErrorComponent?: ErrorComponent; static openFullscreen?: OpenFullscreen; static IdleComponent?: IdleComponent; static StateComponent?: StateComponent | null; static SeekComponent?: SeekComponent | null; static TimeComponent?: TimeComponent | null; static FullscreenComponent?: FullscreenComponent | null; static ControlsComponent?: ControlsComponent; static style?: TextStyle; static seekComponentBreakpoint?: number | null; static animate: boolean; static lazyLoad: boolean; static autoPlay: boolean; static useDefaultLoadingIndicator: boolean; constructor(props: IProps); componentDidMount(): void; componentWillUnmount(): void; componentDidUpdate({ tracks: prev }: IProps): void; render(): React.ReactNode; readonly showLoading: boolean; readonly type: NodeType.Audio; readonly autoPlay: boolean; onPressHandler: (node: Audio) => void | Action | undefined; readonly tracks: ReadonlyArray; readonly transcript: INodeTextImmutable | undefined; readonly animate: boolean; readonly animationDuration: number; readonly animationEasing: EasingFunction | undefined; readonly animationDelay: number; private setupImplementation; private readonly stateComponent; private readonly transcriptComponent; private readonly seekComponent; readonly seekComponentBreakpoint: number | null | undefined; private readonly timeComponent; private readonly fullscreenComponent; private readonly fullscreenImplementationComponent; private readonly controlsComponent; readonly looping: boolean; readonly start: Milliseconds; readonly end: Milliseconds; readonly seek: (milliseconds: MillisecondsAccepted) => Promise; readonly position: Milliseconds | undefined; readonly duration: Milliseconds | undefined; readonly transitioning: boolean; readonly buffering: boolean; readonly playing: boolean; play(): Promise; readonly paused: boolean; pause(): Promise; readonly stopped: boolean; stop(): Promise; toggle(): Promise; readonly url: Url; readonly loading: boolean; readonly loaded: boolean; readonly unloaded: boolean; readonly error: Error | undefined; unload(): Promise; private readonly implementation; private createImplementation; private readonly renderControlsComponent; private playOrReload; private readonly handleControlsStateChange; private readonly handleSeekStart; private readonly handleSeek; private readonly handleSeekEnd; private readonly handleStateChange; private readonly handlePosition; private readonly handleDuration; private readonly loadingComponent; private readonly renderLoadingComponent; private readonly errorComponent; private readonly idleComponent; private readonly renderIdleComponent; private readonly lazyLoaded; private readonly renderErrorComponent; private readonly openFullscreen; private readonly handleOpenFullscreen; private readonly handleDefaultAction; private readonly handleLoad; private readonly handleError; private readonly handleProgress; private readonly handleUnload; private readonly handleReload; private readonly refResource; private updateState; readonly catcher: (error: Error) => void; } export interface IStatic extends React.ComponentClass { } declare const component: IStatic; export { component as Component }; export default Audio;