/** * @module node-opcua-file-transfer */ import type { UAFile, UAFile_Base, UAObjectType } from "node-opcua-address-space"; import { type NodeIdLike } from "node-opcua-nodeid"; import type { AbstractFs } from "../common/abstract_fs.js"; /** * */ export interface FileOptions { /** * the filaname of the physical file which is managed by the OPCUA filetpye */ filename: string; /** * the maximum allowed size of the physical file. */ maxSize?: number; /** * an optional mimeType */ mimeType?: string; fileSystem?: AbstractFs; nodeId?: NodeIdLike; /** * the maximum number of bytes that can be read from the file * in a single read call * - if not specified or 0, we assume Int32 limit */ maxChunkSize?: number; refreshFileContentFunc?: () => Promise; } export interface UAFileType extends UAObjectType, UAFile_Base { } /** * */ export declare class FileTypeData { _fs: AbstractFs; filename: string; maxSize: number; mimeType: string; maxChunkSizeBytes: number; private file; private _openCount; private _fileSize; static maxChunkSize: number; refreshFileContentFunc?: () => Promise; constructor(options: FileOptions, file: UAFile); set openCount(value: number); get openCount(): number; set fileSize(value: number); get fileSize(): number; /** * refresh position and size * this method should be call by the server if the file * is modified externally * */ refresh(): Promise; refreshFileContent(): Promise; } export declare function writeFile(fileSystem: AbstractFs, filename: string, content: Buffer): Promise; /** * @private */ export interface UAFileEx extends UAFile { $fileData: FileTypeData; } /** * @orivate */ export declare function getFileData(opcuaFile2: UAFile): FileTypeData; export declare const defaultMaxSize = 100000000; /** * bind all methods of a UAFile OPCUA node * @param file the OPCUA Node that has a typeDefinition of FileType * @param options the options */ export declare function installFileType(_file: UAFile, options: FileOptions): void; //# sourceMappingURL=file_type_helpers.d.ts.map