Layouts
@smokeballdev/smokeball-client-sdk
Interface: Api
Entry point for layouts to Smokeball.
Methods
add()
add(
request
):Promise
<LayoutMatter
>
Adds a new layout matter item to a matter.
Parameters
request
the update request.
Returns
Promise
<LayoutMatter
>
Example
get()
get(
matterId?
):Promise
<LayoutMatter
>
Gets the layout associated to the current context or the specified matter id if provided.
Parameters
matterId?
string
the layout to retrieve, use null for the matter in the current context.
Returns
Promise
<LayoutMatter
>
the specified layout.
Example
getContacts()
getContacts(
itemId
):Promise
<GetLayoutMatterItemContactsResponse
>
Gets the contacts associated to the provided item id and matter id of the current context.
Parameters
itemId
string
the layout item with contacts.
Returns
Promise
<GetLayoutMatterItemContactsResponse
>
the contacts associated with the layout item.
Example
getItem()
getItem(
itemId
):Promise
<LayoutMatterItem
>
Gets a layout item associated to the current context.
Parameters
itemId
string
the layout item to retrieve.
Returns
Promise
<LayoutMatterItem
>
the specified layout item.
Example
observe()
observe(
callback
,matterId?
):void
Creates a subscription for the layout matter associated to the current context or the specified matter id if provided.
Only one subscription will be made per session. Regardless of how many times this function is called, the last registered callback will be used.
Parameters
callback
(layout
) => void
the function to execute when a change is made to layout(s) in Smokeball.
matterId?
string
the layout to subscribe to.
Returns
void
Example
remove()
remove(
request
):Promise
<LayoutMatter
>
Removes a layout matter item from a matter.
Parameters
request
the update request.
Returns
Promise
<LayoutMatter
>
Example
update()
update(
request
):Promise
<LayoutMatter
>
Updates the layout associated to the specified matter id and returns the layout.
Parameters
request
the update request.
Returns
Promise
<LayoutMatter
>