API
Demo
@alinea/client
export class
Client
<
T
extends
Workspaces
>
implements
Hub
<
T
>
{
constructor
<
T
extends
Workspaces
>
(
config
:
Config
<
T
>
,
url
:
string
,
applyAuth
:
AuthenticateRequest
,
unauthorized
:
{
}
)
:
Client
<
T
>
applyAuth
:
AuthenticateRequest
config
:
Config
<
T
>
unauthorized
:
{
}
url
:
string
authenticate
(
applyAuth
:
AuthenticateRequest
,
unauthorized
:
{
}
)
:
Client
<
T
>
deleteDraft
(
id
:
string
)
:
Future
<
boolean
>
entry
(
id
:
string
,
stateVector
:
Uint8Array
)
:
Future
<
null
|
Detail
>
fetch
(
endpoint
:
string
,
init
:
RequestInit
)
:
Promise
<
Response
>
&
{
cancel
:
{
}
,
catch
:
{
}
,
then
:
{
}
}
fetchJson
(
endpoint
:
string
,
init
:
RequestInit
)
:
Promise
<
Response
>
&
{
cancel
:
{
}
,
catch
:
{
}
,
then
:
{
}
}
listDrafts
(
workspace
:
string
)
:
Future
<
Array
<
{
id
:
string
}
>
>
listFiles
(
location
:
string
)
:
Future
<
Array
<
DirEntry
>
>
publishEntries
(
entries
:
Array
<
Entry
>
)
:
Future
<
void
>
query
<
T
>
(
cursor
:
Cursor
<
T
>
,
options
:
QueryOptions
)
:
Future
<
Array
<
T
>
>
updateDraft
(
id
:
string
,
update
:
Uint8Array
)
:
Future
<
void
>
uploadFile
(
workspace
:
string
,
root
:
string
,
file
:
Upload
)
:
Future
<
File
>
}