# Class: `ServiceWorkerContentsAPI` [@jupyterlite/contents](../modules/jupyterlite_contents.md).ServiceWorkerContentsAPI An Emscripten-compatible synchronous Contents API using the service worker. ## Hierarchy - [`ContentsAPI`](jupyterlite_contents.ContentsAPI.md) ↳ **``ServiceWorkerContentsAPI``** ## Constructors ### `constructor` > > **`new ServiceWorkerContentsAPI`**(`baseUrl`, `driveName`, `mountpoint`, `FS`, `ERRNO_CODES`) #### Parameters | Name | Type | | :------ | :------ | | `baseUrl` | `string` | | `driveName` | `string` | | `mountpoint` | `string` | | `FS` | [`FS`](../modules/jupyterlite_contents.md#fs) | | `ERRNO_CODES` | `any` | #### Overrides [ContentsAPI](jupyterlite_contents.ContentsAPI.md).[constructor](jupyterlite_contents.ContentsAPI.md#constructor) #### Defined in [packages/contents/src/drivefs.ts:538](https://github.com/jupyterlite/jupyterlite/blob/999c7f0/packages/contents/src/drivefs.ts#L538) ## Properties ### `ERRNO_CODES` > > `Protected` **`ERRNO_CODES`**: `any` #### Inherited from [ContentsAPI](jupyterlite_contents.ContentsAPI.md).[ERRNO_CODES](jupyterlite_contents.ContentsAPI.md#errno_codes) #### Defined in [packages/contents/src/drivefs.ts:531](https://github.com/jupyterlite/jupyterlite/blob/999c7f0/packages/contents/src/drivefs.ts#L531) ### `FS` > > `Protected` **`FS`**: [`FS`](../modules/jupyterlite_contents.md#fs) #### Inherited from [ContentsAPI](jupyterlite_contents.ContentsAPI.md).[FS](jupyterlite_contents.ContentsAPI.md#fs) #### Defined in [packages/contents/src/drivefs.ts:530](https://github.com/jupyterlite/jupyterlite/blob/999c7f0/packages/contents/src/drivefs.ts#L530) ### `_baseUrl` > > `Private` **`_baseUrl`**: `string` #### Defined in [packages/contents/src/drivefs.ts:574](https://github.com/jupyterlite/jupyterlite/blob/999c7f0/packages/contents/src/drivefs.ts#L574) ## Accessors ### `endpoint` > > `get` **`endpoint`**(): `string` Get the api/drive endpoint #### Returns `string` #### Defined in [packages/contents/src/drivefs.ts:570](https://github.com/jupyterlite/jupyterlite/blob/999c7f0/packages/contents/src/drivefs.ts#L570) ## Methods ### `get` > > **`get`**(`path`): [`IFile`](../interfaces/jupyterlite_contents.DriveFS.IFile.md) #### Parameters | Name | Type | | :------ | :------ | | `path` | `string` | #### Returns [`IFile`](../interfaces/jupyterlite_contents.DriveFS.IFile.md) #### Inherited from [ContentsAPI](jupyterlite_contents.ContentsAPI.md).[get](jupyterlite_contents.ContentsAPI.md#get) #### Defined in [packages/contents/src/drivefs.ts:420](https://github.com/jupyterlite/jupyterlite/blob/999c7f0/packages/contents/src/drivefs.ts#L420) ### `getattr` > > **`getattr`**(`path`): [`IStats`](../interfaces/jupyterlite_contents.IStats.md) #### Parameters | Name | Type | | :------ | :------ | | `path` | `string` | #### Returns [`IStats`](../interfaces/jupyterlite_contents.IStats.md) #### Inherited from [ContentsAPI](jupyterlite_contents.ContentsAPI.md).[getattr](jupyterlite_contents.ContentsAPI.md#getattr) #### Defined in [packages/contents/src/drivefs.ts:486](https://github.com/jupyterlite/jupyterlite/blob/999c7f0/packages/contents/src/drivefs.ts#L486) ### `getmode` > > **`getmode`**(`path`): `number` #### Parameters | Name | Type | | :------ | :------ | | `path` | `string` | #### Returns `number` #### Inherited from [ContentsAPI](jupyterlite_contents.ContentsAPI.md).[getmode](jupyterlite_contents.ContentsAPI.md#getmode) #### Defined in [packages/contents/src/drivefs.ts:386](https://github.com/jupyterlite/jupyterlite/blob/999c7f0/packages/contents/src/drivefs.ts#L386) ### `lookup` > > **`lookup`**(`path`): [`ILookup`](../interfaces/jupyterlite_contents.DriveFS.ILookup.md) #### Parameters | Name | Type | | :------ | :------ | | `path` | `string` | #### Returns [`ILookup`](../interfaces/jupyterlite_contents.DriveFS.ILookup.md) #### Inherited from [ContentsAPI](jupyterlite_contents.ContentsAPI.md).[lookup](jupyterlite_contents.ContentsAPI.md#lookup) #### Defined in [packages/contents/src/drivefs.ts:382](https://github.com/jupyterlite/jupyterlite/blob/999c7f0/packages/contents/src/drivefs.ts#L382) ### `mknod` > > **`mknod`**(`path`, `mode`): ``null`` #### Parameters | Name | Type | | :------ | :------ | | `path` | `string` | | `mode` | `number` | #### Returns ``null`` #### Inherited from [ContentsAPI](jupyterlite_contents.ContentsAPI.md).[mknod](jupyterlite_contents.ContentsAPI.md#mknod) #### Defined in [packages/contents/src/drivefs.ts:390](https://github.com/jupyterlite/jupyterlite/blob/999c7f0/packages/contents/src/drivefs.ts#L390) ### `normalizePath` > > **`normalizePath`**(`path`): `string` Normalize a Path by making it compliant for the content manager #### Parameters | Name | Type | | :------ | :------ | | `path` | `string` | #### Returns `string` #### Inherited from [ContentsAPI](jupyterlite_contents.ContentsAPI.md).[normalizePath](jupyterlite_contents.ContentsAPI.md#normalizepath) #### Defined in [packages/contents/src/drivefs.ts:511](https://github.com/jupyterlite/jupyterlite/blob/999c7f0/packages/contents/src/drivefs.ts#L511) ### `put` > > **`put`**(`path`, `value`): ``null`` #### Parameters | Name | Type | | :------ | :------ | | `path` | `string` | | `value` | [`IFile`](../interfaces/jupyterlite_contents.DriveFS.IFile.md) | #### Returns ``null`` #### Inherited from [ContentsAPI](jupyterlite_contents.ContentsAPI.md).[put](jupyterlite_contents.ContentsAPI.md#put) #### Defined in [packages/contents/src/drivefs.ts:457](https://github.com/jupyterlite/jupyterlite/blob/999c7f0/packages/contents/src/drivefs.ts#L457) ### `readdir` > > **`readdir`**(`path`): `string`[] #### Parameters | Name | Type | | :------ | :------ | | `path` | `string` | #### Returns `string`[] #### Inherited from [ContentsAPI](jupyterlite_contents.ContentsAPI.md).[readdir](jupyterlite_contents.ContentsAPI.md#readdir) #### Defined in [packages/contents/src/drivefs.ts:406](https://github.com/jupyterlite/jupyterlite/blob/999c7f0/packages/contents/src/drivefs.ts#L406) ### `rename` > > **`rename`**(`oldPath`, `newPath`): ``null`` #### Parameters | Name | Type | | :------ | :------ | | `oldPath` | `string` | | `newPath` | `string` | #### Returns ``null`` #### Inherited from [ContentsAPI](jupyterlite_contents.ContentsAPI.md).[rename](jupyterlite_contents.ContentsAPI.md#rename) #### Defined in [packages/contents/src/drivefs.ts:398](https://github.com/jupyterlite/jupyterlite/blob/999c7f0/packages/contents/src/drivefs.ts#L398) ### `request` > > **`request`**<`T`\>(`data`): [`TDriveResponse`](../modules/jupyterlite_contents.md#tdriveresponse)<`T`\> #### Type parameters | Name | Type | | :------ | :------ | | `T` | extends [`TDriveMethod`](../modules/jupyterlite_contents.md#tdrivemethod) | #### Parameters | Name | Type | | :------ | :------ | | `data` | [`TDriveRequest`](../modules/jupyterlite_contents.md#tdriverequest)<`T`\> | #### Returns [`TDriveResponse`](../modules/jupyterlite_contents.md#tdriveresponse)<`T`\> #### Overrides [ContentsAPI](jupyterlite_contents.ContentsAPI.md).[request](jupyterlite_contents.ContentsAPI.md#request) #### Defined in [packages/contents/src/drivefs.ts:550](https://github.com/jupyterlite/jupyterlite/blob/999c7f0/packages/contents/src/drivefs.ts#L550) ### `rmdir` > > **`rmdir`**(`path`): ``null`` #### Parameters | Name | Type | | :------ | :------ | | `path` | `string` | #### Returns ``null`` #### Inherited from [ContentsAPI](jupyterlite_contents.ContentsAPI.md).[rmdir](jupyterlite_contents.ContentsAPI.md#rmdir) #### Defined in [packages/contents/src/drivefs.ts:416](https://github.com/jupyterlite/jupyterlite/blob/999c7f0/packages/contents/src/drivefs.ts#L416)