Skip to main content

Space

Datalayer Core


Datalayer Core / Space

Class: Space

Defined in: tech/datalayer/core/src/client/models/Space.ts:57

Space domain model that wraps API responses with convenient methods. Provides workspace management with data refresh and content creation operations.

Example​

const space = spaces[0];
const items = await space.getItems();
const notebook = await space.createNotebook({ name: 'Analysis' });

Constructors​

Constructor​

new Space(data, sdk): Space

Defined in: tech/datalayer/core/src/client/models/Space.ts:69

Create a Space instance.

Parameters​

data​

Space

Space data from API

sdk​

DatalayerClient

SDK instance

Returns​

Space

Properties​

_data​

protected _data: Space

Defined in: tech/datalayer/core/src/client/models/Space.ts:58

Accessors​

description​

Get Signature​

get description(): string

Defined in: tech/datalayer/core/src/client/models/Space.ts:135

The description of the space.

Returns​

string


handle​

Get Signature​

get handle(): string

Defined in: tech/datalayer/core/src/client/models/Space.ts:114

URL-friendly handle for the space.

Returns​

string


name​

Get Signature​

get name(): string

Defined in: tech/datalayer/core/src/client/models/Space.ts:128

The name of the space.

Returns​

string


uid​

Get Signature​

get uid(): string

Defined in: tech/datalayer/core/src/client/models/Space.ts:108

Unique identifier for the space.

Returns​

string


variant​

Get Signature​

get variant(): string

Defined in: tech/datalayer/core/src/client/models/Space.ts:120

Space variant type.

Returns​

string

Methods​

createLexical()​

createLexical(data): Promise<Lexical>

Defined in: tech/datalayer/core/src/client/models/Space.ts:252

Create a new lexical document in this space.

Parameters​

data​

Lexical creation configuration

description​

string

file?​

Blob | File

name​

string

Returns​

Promise<Lexical>

Created Lexical instance


createNotebook()​

createNotebook(data): Promise<Notebook>

Defined in: tech/datalayer/core/src/client/models/Space.ts:233

Create a new notebook in this space.

Parameters​

data​

Notebook creation configuration

description​

string

file?​

Blob | File

name​

string

Returns​

Promise<Notebook>

Created Notebook instance


getItems()​

getItems(): Promise<(Notebook | Lexical)[]>

Defined in: tech/datalayer/core/src/client/models/Space.ts:211

Get all items in this space as model instances.

Returns​

Promise<(Notebook | Lexical)[]>

Array of Notebook and Lexical model instances


rawData()​

rawData(): Space

Defined in: tech/datalayer/core/src/client/models/Space.ts:304

Get the raw space data exactly as received from the API. This preserves the original snake_case naming from the API response.

Returns​

Space

Raw space data from API


refresh()​

refresh(): Promise<void>

Defined in: tech/datalayer/core/src/client/models/Space.ts:93

Refresh space data from the API by fetching user's spaces.

Returns​

Promise<void>


toJSON()​

toJSON(): SpaceJSON

Defined in: tech/datalayer/core/src/client/models/Space.ts:282

Get space data in camelCase format. Returns only the core fields that consumers need. This provides a stable interface regardless of API changes.

Returns​

SpaceJSON

Core space data with camelCase properties


toString()​

toString(): string

Defined in: tech/datalayer/core/src/client/models/Space.ts:310

String representation of the space.

Returns​

string