import Command from '../common/classes/command'; import { GlobalOptionsWithRequiredFilePath, GlobalOptions, Empty } from '../common/interfaces/common'; import { AddressAddOptions } from './address/add.interfaces'; import { AddressDeleteOptions } from './address/delete.interfaces'; import { AddressFlushOptions } from './address/flush.interfaces'; import { LinkWithAddressInfo, AddressShowOptions, OnlyAddressInfo } from './address/show.interfaces'; /** * Add new protocol address. * * @param options - Parameters options to be passed down to `ip`. * @param globalOptions - Global parameters options that affects the command execution. * * @throws {@link ParametersError} - Throws when passed parameters are invalid. * @throws {@link CommandError} - Throws when the executed command fails. * * @example * * Import module * ``` * import { address } from 'iproute'; * ``` * * Add a new address * ``` * await address.add({ * local: '10.3.15.3/24', * scope: AddressScopes.Host, * dev: 'eth0' * }); * ``` */ export declare function add(options: AddressAddOptions, globalOptions?: GlobalOptions): Promise>; /** * Change protocol address. * * @param options - Parameters options to be passed down to `ip`. * @param globalOptions - Global parameters options that affects the command execution. * * @throws {@link ParametersError} - Throws when passed parameters are invalid. * @throws {@link CommandError} - Throws when the executed command fails. */ export declare function change(options: AddressAddOptions, globalOptions?: GlobalOptions): Promise>; /** * Replace protocol address. * * @param options - Parameters options to be passed down to `ip`. * @param globalOptions - Global parameters options that affects the command execution. * * @throws {@link ParametersError} - Throws when passed parameters are invalid. * @throws {@link CommandError} - Throws when the executed command fails. */ export declare function replace(options: AddressAddOptions, globalOptions?: GlobalOptions): Promise>; /** * Delete an address. * * @param options - Parameters options to be passed down to `ip`. * @param globalOptions - Global parameters options that affects the command execution. * * @throws {@link ParametersError} - Throws when passed parameters are invalid. * @throws {@link CommandError} - Throws when the executed command fails. * * @example * * Import module * ``` * import { address } from 'iproute'; * ``` * * Delete an address * ``` * await address.del({ * local: '10.3.15.3/24' * dev: 'eth0' * }); * ``` */ export declare function del(options: AddressDeleteOptions, globalOptions?: GlobalOptions): Promise>; /** * Flush protocol addresses. * * This command flushes the protocol addresses selected by some criteria. * * This command has the same arguments as show except that type and master selectors are not supported. * Another difference is that it does not run when no arguments are given. * * Warning: This command and other flush commands are unforgiving. * They will cruelly purge all the addresses. * * @param options - Parameters options to be passed down to `ip`. * @param globalOptions - Global parameters options that affects the command execution. * * @throws {@link ParametersError} - Throws when passed parameters are invalid. * @throws {@link CommandError} - Throws when the executed command fails. * * @example * * Import module * ``` * import { address } from 'iproute'; * ``` * * Flush `eth0` addresses * ``` * await address.flush({ * dev: 'eth0' * }); * ``` */ export declare function flush(options: AddressFlushOptions, globalOptions?: GlobalOptions): Promise>; /** * Save address configuration into a file. * * @param options - Parameters options to be passed down to `ip`. * @param globalOptions - Global parameters options that affects the command execution. * * @throws {@link ParametersError} - Throws when passed parameters are invalid. * @throws {@link CommandError} - Throws when the executed command fails. */ export declare function save(options: AddressFlushOptions, globalOptions: GlobalOptionsWithRequiredFilePath): Promise>; /** * Restore address configuration from a file previously generated by {@link save}. * * @param globalOptions - Global parameters options that affects the command execution. * * @throws {@link ParametersError} - Throws when passed parameters are invalid. * @throws {@link CommandError} - Throws when the executed command fails. */ export declare function restore(globalOptions: GlobalOptionsWithRequiredFilePath): Promise>; /** * Show address configuration from a file previously generated by {@link save}. * * @param globalOptions - Global parameters options that affects the command execution. * * @throws {@link ParametersError} - Throws when passed parameters are invalid. * @throws {@link CommandError} - Throws when the executed command fails. */ export declare function showdump(globalOptions: GlobalOptionsWithRequiredFilePath): Promise | OnlyAddressInfo[]>; /** * Look at protocol addresses. * * @param options - Parameters options to be passed down to `ip`. * @param globalOptions - Global parameters options that affects the command execution. * * @throws {@link ParametersError} - Throws when passed parameters are invalid. * @throws {@link CommandError} - Throws when the executed command fails. * * @example * * Import module * ``` * import { address } from 'iproute'; * ``` * * Show only `eth0` device addresses * ``` * const addresses = await address.show({ * dev: 'eth0' * }); * ``` * * Show all addresses * ``` * const addresses = await address.show(); * const addresses = await address.show({}); * ``` */ export declare function show(options?: AddressShowOptions, globalOptions?: GlobalOptions): Promise | LinkWithAddressInfo[]>; declare const _default: { add: typeof add; change: typeof change; replace: typeof replace; del: typeof del; flush: typeof flush; save: typeof save; restore: typeof restore; showdump: typeof showdump; show: typeof show; }; export default _default;