1.0.1 • Published 3 years ago

@plumtreesystems/pts-utils v1.0.1

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

PTS Utils

Instalation

Add module

    yarn add typescript-rollup-test

Add types definition to tsconfig.json file if necessary

    "typeRoots": [
      "./node_modules/typescript-rollup-test/dist/esm/@types"
    ],

Utils

Browser detector

Initiated BrowserDetector class.

{ browserDetector } from 'typescript-rollup-test';

Components decorators

Contains:

  • debounce

debounced function.

{ debounced } from 'typescript-rollup-test';

Currency prefix

CurrencyPrefix uninitiated class.

{ CurrencyPrefix } from 'typescript-rollup-test';

new CurrencyPrefix(countryOptions);

Params:

  • countryOptions: Object<{key: value}>

Date manager

DateManager uninitiated class.

{ DateManager } from 'typescript-rollup-test';

new DateManager(dateFormat, timeFormat);

Params:

  • dateFormat: string = 'YYYY-MM-DD'
  • timeFormat: string = 'HH:mm'

File downloader

Function for file downloading

{ fileDownload } from 'typescript-rollup-test';

Hydra

Uninitiated Hydra pagination object.

{ Hydra } from 'typescript-rollup-test';

new Hydra(hydraObject);

Params:

  • hydraObject: HydraObjectType

Image tools

ImageTools initiated class.

{ ImageTools } from 'typescript-rollup-test';

Impersonator

Impersonator initiated class. Handle impersonation token actions with local storage.

{ Impersonator } from 'typescript-rollup-test';

Local storage manager

LocalStorageManager uninitiated class.

{ LocalStorageManager } from 'typescript-rollup-test';

new LocalStorageManager(storeVersion, excludedModules);

Params:

  • storeVersion: string
  • excludedModules: string[]

Match snapshot

matchSnapshot function

{ matchSnapshot } from 'typescript-rollup-test';

Mocked date manager

MockedDateManager uninitiated class.

{ MockedDateManager } from 'typescript-rollup-test';

new MockedDateManager(currentDate);

Params:

  • currentDate: string = '2020-08-08 08:00'

Object processor

ObjectProcessor initiated class.

{ ObjectProcessor } from 'typescript-rollup-test';

Pagination helper

PaginationHelper initiated class.

{ PaginationHelper } from 'typescript-rollup-test';

Request cache

RequestCache initiated class.

{ RequestCache } from 'typescript-rollup-test';

Response error processor

ResponseErrorsProcessor uninitiated class.

{ ResponseErrorsProcessor } from 'typescript-rollup-test';

new ResponseErrorsProcessor(registerError)

Params:

  • registerError: (e: any) => any

Scroll to top

scrollToTop function.

{ scrollToTop } from 'typescript-rollup-test';

Types overwrite

typesOverwrite type to overwrite existing types.

{ typesOverwrite } from 'typescript-rollup-test';

Url tools

UrlTools initiated class.

{ UrlTools } from 'typescript-rollup-test';

Vuex module decorators

CustomAction function witch overrides default action parameters.

{ CustomAction } from 'typescript-rollup-test';

Vuex module mutators

CollectionMap interface.

{ CollectionMap } from 'typescript-rollup-test';

CollectionModule decorator. CollectionVuexModule uninitiated class.

{ CollectionModule, CollectionVuexModule } from 'typescript-rollup-test';

@CollectionModule({
    namespaced: true, dynamic: true, store, name: 'moduleName', item: ModuleDataClass,
})
class ModuleName extends CollectionVuexModule<ModuleDataClass> {}

Functions to handle modules data.

{
    getId, addPropertiesToObject, AutoMutations, CId, Get, Sync,
    CGet, CSync
} from 'typescript-rollup-test';