import type { MaybeConsumable, ReadableStream } from "@yume-chan/stream-extra"; import type { Adb, AdbSocket } from "../../adb.js"; import type { AdbSyncEntry } from "./list.js"; import type { AdbSyncSocketLocked } from "./socket.js"; import { AdbSyncSocket } from "./socket.js"; import type { AdbSyncStat, LinuxFileType } from "./stat.js"; /** * A simplified `dirname` function that only handles absolute unix paths. * @param path an absolute unix path * @returns the directory name of the input path */ export declare function dirname(path: string): string; export interface AdbSyncWriteOptions { filename: string; file: ReadableStream>; type?: LinuxFileType; permission?: number; mtime?: number; dryRun?: boolean; } export declare class AdbSync { #private; protected _adb: Adb; protected _socket: AdbSyncSocket; get supportsStat(): boolean; get supportsListV2(): boolean; get fixedPushMkdir(): boolean; get supportsSendReceiveV2(): boolean; get needPushMkdirWorkaround(): boolean; constructor(adb: Adb, socket: AdbSocket); /** * Gets information of a file or folder. * * If `path` points to a symbolic link, the returned information is about the link itself (with `type` being `LinuxFileType.Link`). */ lstat(path: string): Promise; /** * Gets the information of a file or folder. * * If `path` points to a symbolic link, it will be resolved and the returned information is about the target (with `type` being `LinuxFileType.File` or `LinuxFileType.Directory`). */ stat(path: string): Promise; dev: import("@yume-chan/struct").NumberField; ino: import("@yume-chan/struct").NumberField; mode: import("@yume-chan/struct").NumberField; nlink: import("@yume-chan/struct").NumberField; uid: import("@yume-chan/struct").NumberField; gid: import("@yume-chan/struct").NumberField; size: import("@yume-chan/struct").NumberField; atime: import("@yume-chan/struct").NumberField; mtime: import("@yume-chan/struct").NumberField; ctime: import("@yume-chan/struct").NumberField; }> & { readonly type: LinuxFileType; readonly permission: number; }>; /** * Checks if `path` is a directory, or a symbolic link to a directory. * * This uses `lstat` internally, thus works on all Android versions. */ isDirectory(path: string): Promise; opendir(path: string): AsyncGenerator; readdir(path: string): Promise; /** * Reads the content of a file on device. * * @param filename The full path of the file on device to read. * @returns A `ReadableStream` that contains the file content. */ read(filename: string): ReadableStream; /** * Writes a file on device. If the file name already exists, it will be overwritten. * * @param options The content and options of the file to write. */ write(options: AdbSyncWriteOptions): Promise; lockSocket(): Promise; dispose(): Promise; } //# sourceMappingURL=sync.d.ts.map