iniquity

A re-imagining of the iconic BBS software.

View on GitHub

Module: core/decorators-runtime

Runtime Utility Decorators

Summary

Utility decorators for runtime class enhancement

Table of contents

Functions

Functions

Cached

Cached(options?): (target: any, propertyKey: string, descriptor: PropertyDescriptor) => PropertyDescriptor

Cached

Parameters

Name Type Description
options? Object Cache configuration
options.keyGenerator? (args: any[]) => string -
options.ttl? number -

Returns

fn

▸ (target, propertyKey, descriptor): PropertyDescriptor

Parameters
Name Type
target any
propertyKey string
descriptor PropertyDescriptor
Returns

PropertyDescriptor

Defined in

core/src/decorators-runtime.ts:11


Debounce

Debounce(ms): (target: any, propertyKey: string, descriptor: PropertyDescriptor) => PropertyDescriptor

Debounce

Parameters

Name Type Description
ms number Debounce delay in milliseconds

Returns

fn

▸ (target, propertyKey, descriptor): PropertyDescriptor

Parameters
Name Type
target any
propertyKey string
descriptor PropertyDescriptor
Returns

PropertyDescriptor

Defined in

core/src/decorators-runtime.ts:242


Lifecycle

Lifecycle(openMethod, closeMethod): (constructor: Function) => void

Lifecycle

Parameters

Name Type Description
openMethod string Name of the open method
closeMethod string Name of the close method

Returns

fn

▸ (constructor): void

Parameters
Name Type
constructor Function
Returns

void

Defined in

core/src/decorators-runtime.ts:90


Measure

Measure(label?): (target: any, propertyKey: string, descriptor: PropertyDescriptor) => PropertyDescriptor

Measure

Parameters

Name Type Description
label? string Optional label for logging

Returns

fn

▸ (target, propertyKey, descriptor): PropertyDescriptor

Parameters
Name Type
target any
propertyKey string
descriptor PropertyDescriptor
Returns

PropertyDescriptor

Defined in

core/src/decorators-runtime.ts:40


Retry

Retry(options?): (target: any, propertyKey: string, descriptor: PropertyDescriptor) => PropertyDescriptor

Retry

Parameters

Name Type Description
options Object Retry configuration
options.delay? number -
options.maxAttempts? number -

Returns

fn

▸ (target, propertyKey, descriptor): PropertyDescriptor

Parameters
Name Type
target any
propertyKey string
descriptor PropertyDescriptor
Returns

PropertyDescriptor

Defined in

core/src/decorators-runtime.ts:191


Synchronized

Synchronized(): (target: any, propertyKey: string, descriptor: PropertyDescriptor) => PropertyDescriptor

Synchronized

Returns

fn

▸ (target, propertyKey, descriptor): PropertyDescriptor

Parameters
Name Type
target any
propertyKey string
descriptor PropertyDescriptor
Returns

PropertyDescriptor

Defined in

core/src/decorators-runtime.ts:144


Throttle

Throttle(ms): (target: any, propertyKey: string, descriptor: PropertyDescriptor) => PropertyDescriptor

Throttle

Parameters

Name Type Description
ms number Minimum time between calls

Returns

fn

▸ (target, propertyKey, descriptor): PropertyDescriptor

Parameters
Name Type
target any
propertyKey string
descriptor PropertyDescriptor
Returns

PropertyDescriptor

Defined in

core/src/decorators-runtime.ts:265


Timeout

Timeout(ms): (target: any, propertyKey: string, descriptor: PropertyDescriptor) => PropertyDescriptor

Timeout

Parameters

Name Type Description
ms number Timeout in milliseconds

Returns

fn

▸ (target, propertyKey, descriptor): PropertyDescriptor

Parameters
Name Type
target any
propertyKey string
descriptor PropertyDescriptor
Returns

PropertyDescriptor

Defined in

core/src/decorators-runtime.ts:223


Transaction

Transaction(): (target: any, propertyKey: string, descriptor: PropertyDescriptor) => PropertyDescriptor

Transaction

Returns

fn

▸ (target, propertyKey, descriptor): PropertyDescriptor

Parameters
Name Type
target any
propertyKey string
descriptor PropertyDescriptor
Returns

PropertyDescriptor

Defined in

core/src/decorators-runtime.ts:123


Validate

Validate(validator): (target: any, propertyKey: string, descriptor: PropertyDescriptor) => PropertyDescriptor

Validate

Parameters

Name Type Description
validator (args: any[]) => string | boolean Validation function returning true or error message

Returns

fn

▸ (target, propertyKey, descriptor): PropertyDescriptor

Parameters
Name Type
target any
propertyKey string
descriptor PropertyDescriptor
Returns

PropertyDescriptor

Defined in

core/src/decorators-runtime.ts:68