Skip to main content
Version: 3.5

nasl.util

declare namespace nasl.util {
export function Convert(value: null): <T extends never>() => T;
export function Convert(value: nasl.core.Integer): <T extends nasl.core.Boolean | nasl.core.Double | nasl.core.Long | nasl.core.String>() => T;
export function Convert(value: nasl.core.Long): <T extends nasl.core.Integer | nasl.core.String | nasl.core.Boolean | nasl.core.DateTime>() => T;
export function Convert(value: nasl.core.Double): <T extends nasl.core.Boolean | nasl.core.Integer | nasl.core.Long | nasl.core.String>() => T;
export function Convert(value: nasl.core.Email): <T extends nasl.core.String>() => T;
export function Convert(value: nasl.core.Binary): <T extends nasl.core.String>() => T;
export function Convert(value: nasl.core.String): <T extends nasl.core.Date | nasl.core.Time | nasl.core.DateTime | nasl.core.Double | nasl.core.Integer | nasl.core.Long | nasl.core.Boolean>() => T;
export function Convert(value: nasl.core.Date): <T extends nasl.core.DateTime | nasl.core.String>() => T;
export function Convert(value: nasl.core.Time): <T extends nasl.core.String>() => T;
export function Convert(value: nasl.core.DateTime): <T extends nasl.core.Date | nasl.core.Time | nasl.core.String | nasl.core.Long>() => T;
export function Convert(value: nasl.core.Boolean): <T extends nasl.core.String | nasl.core.Integer>() => T;
export function Convert(value: nasl.core.Any): <T extends nasl.core.String>() => T;

export function Enum(enumName: nasl.core.String, value: nasl.core.Enums): nasl.core.String;
export function Split(str: nasl.core.String, seperator: nasl.core.String): nasl.collection.List<nasl.core.String>;
export function Join(list: nasl.collection.List<nasl.core.Any>, seperator: nasl.core.String): nasl.core.String;
export function Concat(str1: nasl.core.String, str2: nasl.core.String): nasl.core.String;
export function Length(str1: nasl.core.String): nasl.core.Integer;
export function IndexOf(str: nasl.core.String, search: nasl.core.String, formIndex: nasl.core.Integer, ignoreCase: nasl.core.Boolean): nasl.core.Integer;
export function LastIndexOf(str: nasl.core.String, search: nasl.core.String, ignoreCase: nasl.core.Boolean): nasl.core.Integer;
export function Replace(str: nasl.core.String, search: nasl.core.String, replace: nasl.core.String): nasl.core.String;
export function SubString(str: nasl.core.String, start: nasl.core.Integer, length?: nasl.core.Integer): nasl.core.String;
export function ToLower(str1: nasl.core.String): nasl.core.String;
export function ToUpper(str1: nasl.core.String): nasl.core.String;
export function Trim(str1: nasl.core.String): nasl.core.String;
export function Get<T>(list: nasl.collection.List<T>, index: nasl.core.Integer): T;
export function Set<T, K extends T>(list: nasl.collection.List<T>, index: nasl.core.Integer, item: K): T;
export function Contains<T, K extends T>(list: nasl.collection.List<T>, item: K): nasl.core.Boolean;
export function Add<T, K extends T>(list: nasl.collection.List<T>, item: K): void;
export function Insert<T, K extends T>(list: nasl.collection.List<T>, index: nasl.core.Integer, item: K): void;
export function Remove<T, K extends T>(list: nasl.collection.List<T>, item: K): void;
export function RemoveAt<T>(list: nasl.collection.List<T>, index: nasl.core.Integer): T;
export function CurrDate(): nasl.core.Date;
export function CurrTime(): nasl.core.Time;
export function CurrDateTime(): nasl.core.DateTime;
export function FormatDate(date: nasl.core.Date, formatter: nasl.core.String): nasl.core.String;
export function FormatDateTime(dateTime: nasl.core.DateTime, formatter: nasl.core.String): nasl.core.String;
export function FormatNumber(doubleValue: nasl.core.Double, digits: nasl.core.Integer, showGroups: nasl.core.Boolean): nasl.core.String;
export function AddDays(dateTime: nasl.core.Date, amount: nasl.core.Integer): nasl.core.Date;
export function AddDays(dateTime: nasl.core.DateTime, amount: nasl.core.Integer): nasl.core.DateTime;
export function AddMonths(dateTime: nasl.core.Date, amount: nasl.core.Integer): nasl.core.Date;
export function AddMonths(dateTime: nasl.core.DateTime, amount: nasl.core.Integer): nasl.core.DateTime;
export function SubDays(dateTime: nasl.core.Date, amount: nasl.core.Integer): nasl.core.Date;
export function SubDays(dateTime: nasl.core.DateTime, amount: nasl.core.Integer): nasl.core.DateTime;
export function DateDiff(dateTime1: nasl.core.DateTime, dateTime2: nasl.core.DateTime, calcType: nasl.core.String): nasl.core.Integer;
export function Clone<T>(struct: T): T;
export function Clear<T>(struct: T): T;
export function RandomInt(start: nasl.core.Integer, end: nasl.core.Integer): nasl.core.Integer;

export function consoleLog(arg: nasl.core.Any): void;
export function jsonSerialize(arg: nasl.core.Any): nasl.core.String;
export function jsonDeserialize<T>(arg: nasl.core.String): T;
export function GetProperties(name: nasl.core.String): nasl.core.String;
}