UNPKG

@iobroker/adapter-react-v5

Version:

React components to develop ioBroker interfaces with react.

50 lines (49 loc) 1.62 kB
import React, { Component, type JSX } from 'react'; import type { Connection } from '@iobroker/socket-client'; import type { ThemeType, Translate } from '../types'; export declare const EXTENSIONS: { images: string[]; code: string[]; txt: string[]; audio: string[]; video: string[]; }; export interface FileViewerProps { /** Translation function */ t: Translate; /** Callback when the viewer is closed. */ onClose: () => void; /** The URL (file path) to the file to be displayed. */ href: string; formatEditFile?: string; socket: Connection; setStateBackgroundImage: () => void; themeType: ThemeType; getStyleBackgroundImage: () => React.CSSProperties | null; /** Flag is the js-controller support subscribe on file */ supportSubscribes?: boolean; } export interface FileViewerState { text: string | null; code: string | null; ext: string | null; editing: boolean; editingValue: string | null; copyPossible: boolean; forceUpdate: number; changed: boolean; imgError: boolean; } export declare class FileViewerClass extends Component<FileViewerProps, FileViewerState> { private timeout; constructor(props: FileViewerProps); readFile(): void; componentDidMount(): void; componentWillUnmount(): void; onFileChanged: (_id: string, _fileName: string, size: number | null) => void; getEditorOrViewer(): JSX.Element; getContent(): React.JSX.Element | null; onSave(): void; render(): JSX.Element; } export declare const FileViewer: (props: Record<string, any>) => JSX.Element;