Skip to content

IQAlias Reference ​

QuickModel supports a wide range of string aliases (IQAlias) to specify types in a concise way. These aliases are used within @Quick and @QType decorators.

Using aliases provides excellent IntelliSense support and keeps your code clean by avoiding unnecessary imports of global constructors.

Primitives ​

These aliases ensure that values are coerced into their respective primitive types.

AliasResultDescription
'string'StringCasts value to a string.
'number'NumberCasts value to a number.
'boolean'BooleanCasts value to a boolean (true/false).
'bigint'BigIntCrucial: Converts string/number integers to native BigInt.
'symbol'SymbolCreates a unique symbol or uses Symbol.for.
'null'nullEnsures value is null.
'undefined'undefinedEnsures value is undefined.

Native Objects ​

Standard JavaScript objects that require transformation from serialized (JSON) formats.

AliasResultDescription
'date'DateTransforms ISO strings ("2024...") or timestamps to Date objects.
'regexp'RegExpTransforms string patterns ("/abc/i") to RegExp objects.
'error'ErrorReconstructs Error objects from plain objects (preserving message/stack).
'url'URLTransforms URL strings to URL objects.
'urlsearchparams'URLSearchParamsTransforms query strings or objects to URLSearchParams.
'promise'PromiseWraps value in a Promise.resolve().

Collections ​

Efficient ES6 Collection types.

AliasResultDescription
'map'MapTransforms array of tuples [[k,v]] to Map.
'set'SetTransforms array [v1, v2] to Set (removing duplicates).
'weakmap'WeakMapTransforms array of tuples to WeakMap.
'weakset'WeakSetTransforms array to WeakSet.
'array'ArrayEnsures value is an array (Array.from).
'object'ObjectEnsures value is an object.

Binary Data & Buffers ​

Directly handle binary data types.

AliasResultDescription
'arraybuffer'ArrayBufferHandles raw binary data buffer.
'sharedarraybuffer'SharedArrayBufferHandles shared binary data buffer.
'dataview'DataViewHandles DataView view on a buffer.

Typed Arrays ​

Specific binary array views.

AliasResult
'int8array'Int8Array
'uint8array'Uint8Array
'uint8clampedarray'Uint8ClampedArray
'int16array'Int16Array
'uint16array'Uint16Array
'int32array'Int32Array
'uint32array'Uint32Array
'float32array'Float32Array
'float64array'Float64Array
'bigint64array'BigInt64Array
'biguint64array'BigUint64Array

Web APIs ​

Support for modern Web API standards.

AliasResultDescription
'blob'BlobBinary Large Object.
'file'FileFile API object.
'formdata'FormDataForm data structure.
'headers'HeadersHTTP Headers object.
'textencoder'TextEncoderText encoding utility.
'textdecoder'TextDecoderText decoding utility.

Example Usage ​

typescript
import { Quick, QModel } from 'quickmodel';

@Quick({
	// Primitives
	id: 'string',
	count: 'number',
	isActive: 'boolean',

	// Complex
	created: 'date',
	meta: 'map',
	tags: 'set',

	// Binary
	image: 'uint8array',
	raw: 'arraybuffer',
})
class Resource extends QModel<IResource> {
	// ...
}