UNPKG

@monkeyscanjump/cloudflare-dyndns

Version:

A robust TypeScript application that automatically updates Cloudflare DNS records when your public IP address changes. Perfect for maintaining consistent domain names for home servers, WireGuard VPN, self-hosted services, or any system with a dynamic IP a

32 lines (31 loc) 1.07 kB
import { Logger } from './Logger'; /** * Manages the storage and retrieval of the last detected IP address * Handles file operations for persisting IP information between runs */ export declare class IpFileManager { private ipFilePath; private logger; /** * Creates a new IP file manager * @param ipFilePath Path to the file where IP address will be stored * @param logger Logger instance for recording file operations */ constructor(ipFilePath: string, logger: Logger); /** * Ensures the directory for the IP file exists, creating it if necessary * @throws Error if the directory cannot be created */ private ensureIpFileDirectoryExists; /** * Retrieves the last saved IP address from storage * @returns The last saved IP address or null if none exists */ getLastIp(): string | null; /** * Saves the current IP address to storage * @param ip Current IP address to save * @returns True if the save operation was successful */ saveIp(ip: string): boolean; }