Namespace: typedef

gpf. typedef

Root namespace for GPF type documentation.

Note that this symbol does not exist and is used only for documentation purposes.

Since:
  • 0.1.5

Classes

Tag

Type Definitions


contextResult

Result of gpf.context call, depends on the specified path

  • when not specified, it returns the current host main context object
  • when "gpf", it always returns the GPF object
  • when it leads to nothing, undefined is returned
Type:
  • *
Since:
  • 0.1.5

csvParserOptions

Properties:
Name Type Argument Default Description
header String <optional>

Header line: if not specified, the first write of the input stream becomes the header

separator String <optional>

Column separator, detected from the header line if not specified (allowed characters are ";" "," and "\t")

quote String <optional>
"\""

Quote sign: introduces an escaped value in which quotes, separator and carriage returns are allowed. Consequently, the value may stand on several lines

newLine String <optional>
"\n"

New line: each input stream write is considered as a separate line. If a quoted value stands on several lines, this character is used to represents every new line

Since:
  • 0.2.3

fileStorageInfo

Properties:
Name Type Description
type gpf.fs.types

See gpf.fs.types

fileName String

file name only

filePath String

full path to the file

size Number

Size of the object (if relevant)

createdDateTime Date
modifiedDateTime Date
Since:
  • 0.1.9

filterAnd

Filter AND specification

Properties:
Name Type Description
and Array.<gpf.typedef.filterItem>

List of items to and, returns the first falsy value or the last truthy value

Since:
  • 0.1.9
See:

filterEq

Filter equal specification

Properties:
Name Type Description
eq Array.<gpf.typedef.filterItem>

List of items to compare, returns true if all values are strictly equal

Since:
  • 0.1.9
See:

filterFunc(data)

Filtering function

Parameters:
Name Type Description
data *

Data to filter

Since:
  • 0.2.4
Returns:

truthy / falsy value indicating if the data matches the filter

Type
Boolean

filterGt

Filter greater than specification

Properties:
Name Type Description
gt Array.<gpf.typedef.filterItem>

List of items to compare

Since:
  • 0.1.9
See:

filterGte

Filter greater than or equal specification

Properties:
Name Type Description
gte Array.<gpf.typedef.filterItem>

List of items to compare

Since:
  • 0.1.9
See:

filterItem

Filter specification

Type:
Since:
  • 0.1.9
See:

filterLike

Filter like specification

Properties:
Name Type Argument Description
like gpf.typedef.filterItem

Item

regexp String

Regular expression specification

group Number <optional>

If the regular expression contains capturing group, this members can be used to return the group by index (1-based)

Since:
  • 0.1.9
See:

filterLt

Filter lower than specification

Properties:
Name Type Description
lt Array.<gpf.typedef.filterItem>

List of items to compare

Since:
  • 0.1.9
See:

filterLte

Filter lower than or equal specification

Properties:
Name Type Description
lte Array.<gpf.typedef.filterItem>

List of items to compare

Since:
  • 0.1.9
See:

filterNe

Filter not equal specification

Properties:
Name Type Description
eq Array.<gpf.typedef.filterItem>

List of items to compare, returns true if all values are strictly different

Since:
  • 0.1.9
See:

filterNot

Filter not specification

Properties:
Name Type Description
not gpf.typedef.filterItem

Item to negate, returns true if the item is falsy, false otherwise

Since:
  • 0.1.9
See:

filterOr

Filter OR specification

Properties:
Name Type Description
or Array.<gpf.typedef.filterItem>

List of items to or, returns the first truthy value or the last falsy value

Since:
  • 0.1.9
See:

filterProperty

Filter property read specification

Properties:
Name Type Description
property String

Property name to read

Since:
  • 0.1.9
See:

forEachCallback(value, index, container)

Callback function executed on each array / dictionary item

Parameters:
Name Type Description
value *

The current item

index String

The index of the current item

container Object

The container currently being enumerated (array or dictionary)

Since:
  • 0.1.5
Returns:

returned value

Type
*

httpRequestResponse

HTTP request response

Properties:
Name Type Description
status int

HTTP status

headers Object

HTTP response headers

responseText String

Response Text

Since:
  • 0.2.1
See:

httpRequestSettings

HTTP request settings

Properties:
Name Type Argument Default Description
method gpf.http.methods <optional>
gpf.http.methods.get

HTTP method. Custom verbs (use any string) may be supported depending on the host (see Compatibility layer).

url String

URL to submit the request to

headers Object <optional>

Request headers

data String <optional>

Request data, valid only for gpf.http.methods.post and gpf.http.methods.put

Since:
  • 0.2.1
See:

mapFunc(data)

Mapping function

Parameters:
Name Type Description
data *

Data to map

Since:
  • 0.2.5
Returns:

Mapped data (might be the received parameter)

Type
*

mockedRequest

Definition of a mocked request

Properties:
Name Type Description
method gpf.http.methods

HTTP method to mock

url RegExp

Regular expression matching the URL to mock

response gpf.typedef.mockedResponseCallback

Function that generates response when mocking applies

Since:
  • 0.2.2

mockedRequestID

Mocked request identifier

Since:
  • 0.2.2

mockedResponseCallback(HTTP, captured)

Mocked response callback

Parameters:
Name Type Argument Description
HTTP gpf.typedef.httpRequestSettings

request settings

captured String <repeatable>

Regular expression capturing group values

Since:
  • 0.2.2
Returns:
Type
Promise.<gpf.typedef.httpRequestResponse> | undefined

regExpForEachCallback(match, string)

Callback function executed on each regular expression match

Parameters:
Name Type Description
match Array

The current match

string String

The string that is currently being matched

Since:
  • 0.2.1

requireOptions

Properties:
Name Type Argument Default Description
base String <optional>

Base path used to resolve names

cache Object <optional>

Inject names into the require cache

clearCache Boolean <optional>
false

When set, the require cache is first cleared

preload Object <optional>

Inject names into the loading cache

preprocess gpf.typedef.requirePreprocessFunc <optional>

Resource preprocessor

Since:
  • 0.2.2

requirePreprocessFunc(resource)

Resource preprocessing function. It enables changing the resource content and / or the resource type before it is evaluated.

Parameters:
Name Type Description
resource gpf.typedef.requireResource

Resource definition

Since:
  • 0.2.9
Returns:
Type
Promise.<gpf.typedef.requireResource>

requireResource

Properties:
Name Type Description
name String

Resource resolved name

content String

Resource content

type String

Resource type (extension, for instance: ".js")

Since:
  • 0.2.9

serialConverter(value, property, member)

Converter function executed upen property value serialization

Parameters:
Name Type Description
value *

The value to convert

property gpf.typedef.serializableProperty

The property definition

member String

The object member

Since:
  • 0.2.8
Returns:

converter value

Type
*

serializableProperty

Serializable property specification

Properties:
Name Type Argument Default Description
name String

Name of the property

type gpf.serial.types <optional>
gpf.serial.types.string

Type of the property

required Boolean <optional>
false

Property must have a value

readOnly Boolean <optional>

Property is read only. When undefined, and if the host supports [Object.getOwnPropertyDescriptors](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ Object/getOwnPropertyDescriptors), the framework will check if the property can be set. This property is resolved when used in the gpf.typedef.serialConverter.

Since:
  • 0.2.8
See:

sortItem

Property sorting specification

Properties:
Name Type Argument Default Description
property String

Name of the property to sort by

type String <optional>
"number"

Property type, only allowed values are "number" and "string"

ascending Boolean <optional>
true

Descending if false

Since:
  • 0.1.9

tagChild

Tag generation function child specification. When string, a text node is created.

Properties:
Type Description
String | gpf.typedef.Tag
Since:
  • 0.2.1
See:

tagChildren

Tag generation function children specification

Properties:
Type Description
gpf.typedef.tagChild | Array.<gpf.typedef.tagChild>
Since:
  • 0.2.1
See:

tagFunc( [attributes] [, children])

Tag generation function, it accepts up to two parameters:

  • When no parameter is passed, an empty node is created
  • If the first parameter is a literal object (see gpf.isLiteralObject), its properties are used to define the node attributes
  • Otherwise, the second (or first if not a literal object) is used to define children that will be appended to this tag
Parameters:
Name Type Argument Description
attributes Object | gpf.typedef.tagChildren <optional>

When a literal object is passed, it is interpreted as an attribute dictionary. The attribute name may contain the xlink namespace prefix.

children gpf.typedef.tagChildren <optional>

List of children

Since:
  • 0.2.1
See:
Returns:

Tag object

Type
gpf.typedef.Tag