Skip to content

Latest commit

 

History

History
24 lines (20 loc) · 711 Bytes

File metadata and controls

24 lines (20 loc) · 711 Bytes

NASL 基础类型

基础类型

// 基础类型定义
type String = string; // 字符串类型
type Boolean = boolean; // 布尔类型
type Integer = number; // 整数类型。note: 整数类型的最大最小安全值与JS一致,即2^53-1和-2^53+1
type Decimal = number; // 小数类型
// 日期类型 Date
// 时间类型 Time
// 日期时间类型 DateTime

/**
 * NASL 基础类型
 * 字符串、布尔、整数、小数、日期、时间、日期时间
 */
type PrimitiveType = String | Boolean | Integer | Decimal | Date | Time | DateTime;
type Stringify<T extends PrimitiveType> = `${T}`;

type List<T> = Array<T>;
type Map<K extends PrimitiveType, V> = Record<Stringify<K>, V>;