Skip to content

Class: Integer

Hierarchy

Number

Integer

Index

Constructors

Properties

Methods

Object literals

Constructors

constructor

+ new Integer(min: number, max: number, defaultVal: number, flags: number): Integer

Inherited from Number.constructor

Overrides Field.constructor

Defined in lib/fields/Number.ts:9

Parameters:

Name Type Default
min number undefined
max number undefined
defaultVal number undefined
flags number null

Returns: Integer

Properties

default

default: any

Inherited from Field.default

Defined in lib/Field.ts:13

The value to be returned from Field.prototype.parse when invoked with undefined or null. Note that providing a defualt value effectively renders the field optional.


flags

flags: number

Inherited from Field.flags

Defined in lib/Field.ts:16

A bit field representing a set of boolean flags.


lastError

lastError: string

Inherited from Field.lastError

Defined in lib/Field.ts:19

The error message produced by the last call to Field.prototype.parse, if it was unsuccessful.


max

max: number

Inherited from Number.max

Defined in lib/fields/Number.ts:9


min

min: number

Inherited from Number.min

Defined in lib/fields/Number.ts:7

Methods

clone

clone(): Field

Inherited from Field.clone

Defined in lib/Field.ts:39

Returns a copy of the Field instance.

Returns: Field


hasFlag

hasFlag(flag: number): boolean

Inherited from Field.hasFlag

Defined in lib/Field.ts:34

Checks if the specified flag is set on Field.prototype.flags.

Parameters:

Name Type Description
flag number A bit mask.

Returns: boolean

A boolean determining whether or not the flag is present.


parse

parse(value: any): Promise‹any›

Overrides Number.parse

Defined in lib/fields/Integer.ts:7

Parameters:

Name Type
value any

Returns: Promise‹any›

Object literals

Static Flags

Flags: object

Inherited from Field.Flags

Defined in lib/Field.ts:5

OPT

OPT: number = 1

Defined in lib/Field.ts:7

OPTIONAL denotes that a field should have a default value of null.

PRV

PRV: number = 2

Defined in lib/Field.ts:9

PRIVATE denotes that a field should not be exposed.