Hypertable Client Library / Exports / TestModeHypClientLib

Class: TestModeHypClientLib

Hierarchy

Table of contents

Constructors

Accessors

Methods

Constructors

constructor

new TestModeHypClientLib(api)

Parameters

Name Type
api HypClientLibApi

Overrides

HypClientLib.constructor

Accessors

utils

get utils(): Object

Get a reference to the collection of utility functions

Returns

Object

Name Type
dereference <T>(object: T) => any
log (...message: any[]) => never
readFromClipboard () => Promise<undefined | string>
wait (ms: number) => Promise<void>
writeToClipboard (toWrite: string) => never

Inherited from

HypClientLib.utils

Methods

alertConfirm

alertConfirm(message, opts?): Promise<boolean>

Display a message to the user in a styled modal, requiring them to either confirm or cancel.

Parameters

Name Type
message string
opts? ClientLibApiAlertOptions

Returns

Promise<boolean>

The returned promise resolves with true if the user selects the confirm option.

Overrides

HypClientLib.alertConfirm


alertNotify

alertNotify(message, opts?): Promise<undefined>

Display a message to the user in a styled modal.

The returned promise resolves once they dismiss the modal.

Parameters

Name Type
message string
opts? ClientLibApiAlertOptions

Returns

Promise<undefined>

Overrides

HypClientLib.alertNotify


alertPrompt

alertPrompt(message, opts?): Promise<undefined>

Prompt the user to enter some text in an input, displayed in a styled modal.

Parameters

Name Type
message string
opts? ClientLibApiAlertOptions

Returns

Promise<undefined>

The string the user entered, or undefined if the user cancelled the modal

Overrides

HypClientLib.alertPrompt


alertToast

alertToast(message): Promise<undefined>

Display a short message to the user, in a non-interrupting toast pop-up (AKA candybar)

Parameters

Name Type
message string

Returns

Promise<undefined>

Overrides

HypClientLib.alertToast


cloneRecord

cloneRecord(collectionId, recordId, opts?): Promise<undefined | HypRecord>

Parameters

Name Type
collectionId string
recordId string
opts? Object
opts.references? "discard" | "keep" | "clone"

Returns

Promise<undefined | HypRecord>

Inherited from

HypClientLib.cloneRecord


createBatch

createBatch(): HypBatch

Returns

HypBatch

Inherited from

HypClientLib.createBatch


createRecord

createRecord(collectionId): Promise<undefined>

Parameters

Name Type
collectionId string

Returns

Promise<undefined>

Overrides

HypClientLib.createRecord


createRecordWithoutSaving

createRecordWithoutSaving(collection): HypRecord

Parameters

Name Type
collection HypCollection

Returns

HypRecord

Inherited from

HypClientLib.createRecordWithoutSaving


deleteRecord

deleteRecord(collectionId, recordId): Promise<boolean>

Parameters

Name Type
collectionId string
recordId string

Returns

Promise<boolean>

Overrides

HypClientLib.deleteRecord


findCollection

findCollection(collectionId): Promise<undefined>

Find the collection with the given ID

Parameters

Name Type
collectionId string

Returns

Promise<undefined>

Overrides

HypClientLib.findCollection


findFieldFromKey

findFieldFromKey(collectionId, fieldKey): undefined | HypField

Parameters

Name Type
collectionId string
fieldKey string

Returns

undefined | HypField

Inherited from

HypClientLib.findFieldFromKey


findRecord

findRecord(collectionId, recordId): Promise<undefined>

Parameters

Name Type
collectionId string
recordId string

Returns

Promise<undefined>

Overrides

HypClientLib.findRecord


findRecords

findRecords(collectionId, recordIds): Promise<HypRecord[]>

Parameters

Name Type
collectionId string
recordIds string[]

Returns

Promise<HypRecord[]>

Inherited from

HypClientLib.findRecords


getAllRecords

getAllRecords(collectionId): Promise<HypRecord[]>

Parameters

Name Type
collectionId string

Returns

Promise<HypRecord[]>

Inherited from

HypClientLib.getAllRecords


getCollection

getCollection(collectionId): Promise<HypCollection>

Get the collection with the given name. If the collection is renamed, this call will need to be updated.

Parameters

Name Type
collectionId string

Returns

Promise<HypCollection>

The specified collection

Overrides

HypClientLib.getCollection


getCollectionById

getCollectionById(id): Promise<HypCollection>

Get the collection with the given ID.

throws An error if the specified collection is not found

Parameters

Name Type Description
id string The ID of the desired collection

Returns

Promise<HypCollection>

The specified collection

Inherited from

HypClientLib.getCollectionById


getRecord

getRecord(collectionId, recordId): Promise<HypRecord>

Parameters

Name Type
collectionId string
recordId string

Returns

Promise<HypRecord>

Overrides

HypClientLib.getRecord


getRecords

getRecords(collectionId, recordIds): Promise<HypRecord[]>

Parameters

Name Type
collectionId string
recordIds string[]

Returns

Promise<HypRecord[]>

Inherited from

HypClientLib.getRecords


getView

getView(viewId): Promise<undefined | HypView>

Get the View with the given ID. Returns undefined if the View was not found.

Parameters

Name Type
viewId string

Returns

Promise<undefined | HypView>

Inherited from

HypClientLib.getView


getViewRecords

getViewRecords(viewId): Promise<undefined | HypRecord[]>

Get the Records visible in the given View. Returns undefined if the View was not found, or if the View is not a "collection" View.

Parameters

Name Type Description
viewId string The ID of the spceified View

Returns

Promise<undefined | HypRecord[]>

Inherited from

HypClientLib.getViewRecords


log

log(message, level?): void

Log a message to the Hypertable custom function log

Parameters

Name Type
message string
level? ClientLibApiLogLevel

Returns

void

Overrides

HypClientLib.log


logTestCall

Private logTestCall(methodName): Promise<void>

Parameters

Name Type
methodName string

Returns

Promise<void>


openPreview

openPreview(record): Promise<boolean>

Open the specified record in the record preview modal

Parameters

Name Type
record HypRecord

Returns

Promise<boolean>

Inherited from

HypClientLib.openPreview


openRecordPreview

openRecordPreview(collectionId, recordId): Promise<boolean>

Open the specified record in the record preview modal

Parameters

Name Type
collectionId string
recordId string

Returns

Promise<boolean>

Inherited from

HypClientLib.openRecordPreview


openView

openView(viewId, recordId?): Promise<boolean>

Immediately open the specified View

Parameters

Name Type Description
viewId string The View to open
recordId? string Specify a record to select if the View is a Record View

Returns

Promise<boolean>

Whether the specified View was opened

Inherited from

HypClientLib.openView


printMarkdown

printMarkdown(markdown, options?): Promise<any>

Parameters

Name Type
markdown string
options? any

Returns

Promise<any>

Inherited from

HypClientLib.printMarkdown


queryRecords

queryRecords(collectionId, query): Promise<never[]>

Parameters

Name Type
collectionId string
query any

Returns

Promise<never[]>

Overrides

HypClientLib.queryRecords


saveBatch

saveBatch(batch): Promise<boolean>

Parameters

Name Type
batch HypBatch

Returns

Promise<boolean>

Inherited from

HypClientLib.saveBatch


selectRecord

selectRecord(collectionId): Promise<undefined | HypRecord>

Parameters

Name Type
collectionId string

Returns

Promise<undefined | HypRecord>

Inherited from

HypClientLib.selectRecord


selectRecords

selectRecords(collectionId): Promise<undefined | HypRecord[]>

Parameters

Name Type
collectionId string

Returns

Promise<undefined | HypRecord[]>

Inherited from

HypClientLib.selectRecords


showCustomModal

showCustomModal(customViewId, opts?): Promise<boolean>

Parameters

Name Type
customViewId string
opts? ClientLibApiAlertOptions

Returns

Promise<boolean>

Overrides

HypClientLib.showCustomModal


updateRecord

updateRecord(collectionId, recordId, updates): Promise<boolean>

Parameters

Name Type
collectionId string
recordId string
updates any

Returns

Promise<boolean>

Overrides

HypClientLib.updateRecord