# README

## Content

# spreadjs-api

## Table of contents

### Enumerations

- [BrowsingMode](enums/BrowsingMode)
- [OpType](enums/OpType)
- [PermissionTypes](enums/PermissionTypes)

### Interfaces

- [IBindPresenceOptions](interfaces/IBindPresenceOptions)
- [IChangeSet](interfaces/IChangeSet)
- [IOpComponent](interfaces/IOpComponent)
- [IPermission](interfaces/IPermission)
- [IPresence](interfaces/IPresence)
- [IRange](interfaces/IRange)
- [ISelections](interfaces/ISelections)
- [IUser](interfaces/IUser)
- [IUserWithPermission](interfaces/IUserWithPermission)

### Type aliases

- [IImageSource](README#iimagesource)

### Variables

- [type](README#type)

### Functions

- [bind](README#bind)
- [bindPresence](README#bindpresence)

## Type aliases

### <a id="iimagesource" name="iimagesource"></a> IImageSource

Ƭ **IImageSource**: { `kind`: ``"url"`` ; `src`: `string`  } \| { `dataUrl`: `string` ; `kind`: ``"data"``  } \| { `blobUrl`: `string` ; `kind`: ``"blobUrl"``  } \| { `blob`: `Blob` ; `kind`: ``"blob"``  } \| { `file`: `File` ; `kind`: ``"file"``  }

{
kind: 'url';
src: string;
} | {
kind: 'data';
dataUrl: string;
} | {
kind: 'blobUrl';
blobUrl: string;
} | {
kind: 'blob';
blob: Blob;
} | {
kind: 'file';
file: File;
}

## Variables

### <a id="type" name="type"></a> type

• **type**: `OT_Type`<`unknown`, [`IChangeSet`](interfaces/IChangeSet)\>

Defines the OT type for spreadsheets.

## Functions

### <a id="bind" name="bind"></a> bind

▸ **bind**(`workbook`, `doc`): `Promise`<`void`\>

Binds a workbook to a shared document.

#### Parameters

| Name | Type | Description |
| :------ | :------ | :------ |
| `workbook` | `any` | The instance of GC.Spread.Sheets.Workbook. |
| `doc` | `SharedDoc`<`any`, [`IChangeSet`](interfaces/IChangeSet)\> | The instance of SharedDoc. |

#### Returns

`Promise`<`void`\>

A promise that resolves when the binding is complete.

___

### <a id="bindpresence" name="bindpresence"></a> bindPresence

▸ **bindPresence**(`workbook`, `presence`, `user`, `options?`): `Promise`<`void`\>

Binds a workbook to a presence instance.

#### Parameters

| Name | Type | Description |
| :------ | :------ | :------ |
| `workbook` | `any` | The instance of GC.Spread.Sheets.Workbook. |
| `presence` | `Presence`<[`IPresence`](interfaces/IPresence)\> | The presence instance. |
| `user` | [`IUserWithPermission`](interfaces/IUserWithPermission) | The user information. |
| `options?` | [`IBindPresenceOptions`](interfaces/IBindPresenceOptions) | - |

#### Returns

`Promise`<`void`\>

A promise that resolves when the binding is complete.
