swrlit # swrlit ## Table of contents ### Type Aliases - [ContainerResult](index.html#containerresult) - [FileResult](index.html#fileresult) - [MetaResult](index.html#metaresult) - [ProfileResult](index.html#profileresult) - [ResourceResult](index.html#resourceresult) - [SwrldResult](index.html#swrldresult) - [SwrlitConfigInterface](index.html#swrlitconfiginterface) - [SwrlitKey](index.html#swrlitkey) - [ThingResult](index.html#thingresult) ### Functions - [useContainer](index.html#usecontainer) - [useFile](index.html#usefile) - [useMeta](index.html#usemeta) - [useMyProfile](index.html#usemyprofile) - [useProfile](index.html#useprofile) - [useResource](index.html#useresource) - [useStorageContainer](index.html#usestoragecontainer) - [useSwrld](index.html#useswrld) - [useThing](index.html#usething) - [useThingInResource](index.html#usethinginresource) ## Type Aliases ### ContainerResult Ƭ **ContainerResult**: [`SwrldResult`](index.html#swrldresult) & { `resources`: `any` } #### Defined in things.ts:33 ___ ### FileResult Ƭ **FileResult**: [`SwrldResult`](index.html#swrldresult) & { `file`: `any` ; `save`: `any` } #### Defined in things.ts:34 ___ ### MetaResult Ƭ **MetaResult**: [`ResourceResult`](index.html#resourceresult) & { `meta`: `SolidDataset` } #### Defined in things.ts:32 ___ ### ProfileResult Ƭ **ProfileResult**: [`ThingResult`](index.html#thingresult) & { `profile`: `Thing` } #### Defined in things.ts:35 ___ ### ResourceResult Ƭ **ResourceResult**: [`SwrldResult`](index.html#swrldresult) & { `resource`: `SolidDataset` ; `save`: `any` } #### Defined in things.ts:30 ___ ### SwrldResult Ƭ **SwrldResult**: `SWRResponse`<`any`, `any`\> #### Defined in things.ts:29 ___ ### SwrlitConfigInterface Ƭ **SwrlitConfigInterface**: `SWRConfiguration` & { `fetch?`: `Fetcher`<`any`\> } #### Defined in things.ts:23 ___ ### SwrlitKey Ƭ **SwrlitKey**: `UrlString` \| ``null`` \| `undefined` #### Defined in things.ts:27 ___ ### ThingResult Ƭ **ThingResult**: [`ResourceResult`](index.html#resourceresult) & { `saveResource`: `any` ; `thing`: `Thing` } #### Defined in things.ts:31 ## Functions ### useContainer ▸ **useContainer**(`uri`, `options?`): [`ContainerResult`](index.html#containerresult) Retrieve and manage the Container identified by `url` #### Parameters | Name | Type | Description | | :------ | :------ | :------ | | `uri` | [`SwrlitKey`](index.html#swrlitkey) | the URL of a Solid Container | | `options` | [`SwrlitConfigInterface`](index.html#swrlitconfiginterface) | Optional parameter `options.fetch`: An alternative `fetch` function to make the HTTP request, compatible with the browser-native [fetch API](https://developer.mozilla.org/en-US/docs/Web/API/WindowOrWorkerGlobalScope/fetch#Parameters). | #### Returns [`ContainerResult`](index.html#containerresult) a useSWR style response map #### Defined in things.ts:222 ___ ### useFile ▸ **useFile**(`uri`, `options?`): [`FileResult`](index.html#fileresult) Retrieve and manage the file identified by `url` #### Parameters | Name | Type | Description | | :------ | :------ | :------ | | `uri` | [`SwrlitKey`](index.html#swrlitkey) | the URL of a file | | `options` | [`SwrlitConfigInterface`](index.html#swrlitconfiginterface) | Optional parameter `options.fetch`: An alternative `fetch` function to make the HTTP request, compatible with the browser-native [fetch API](https://developer.mozilla.org/en-US/docs/Web/API/WindowOrWorkerGlobalScope/fetch#Parameters). | #### Returns [`FileResult`](index.html#fileresult) a useSWR style response map #### Defined in things.ts:87 ___ ### useMeta ▸ **useMeta**(`uri`, `options?`): [`MetaResult`](index.html#metaresult) Retrieve and manage the metadata SolidDataset of the Resource identified by `url` #### Parameters | Name | Type | Description | | :------ | :------ | :------ | | `uri` | [`SwrlitKey`](index.html#swrlitkey) | the URL of a Solid Resource | | `options` | [`SwrlitConfigInterface`](index.html#swrlitconfiginterface) | Optional parameter `options.fetch`: An alternative `fetch` function to make the HTTP request, compatible with the browser-native [fetch API](https://developer.mozilla.org/en-US/docs/Web/API/WindowOrWorkerGlobalScope/fetch#Parameters). | #### Returns [`MetaResult`](index.html#metaresult) a useSWR style response map #### Defined in things.ts:121 ___ ### useMyProfile ▸ **useMyProfile**(`options?`): [`ProfileResult`](index.html#profileresult) Retrieve and manage the profile document of the currently authenticated user. #### Parameters | Name | Type | Description | | :------ | :------ | :------ | | `options` | [`SwrlitConfigInterface`](index.html#swrlitconfiginterface) | Optional parameter `options.fetch`: An alternative `fetch` function to make the HTTP request, compatible with the browser-native [fetch API](https://developer.mozilla.org/en-US/docs/Web/API/WindowOrWorkerGlobalScope/fetch#Parameters). | #### Returns [`ProfileResult`](index.html#profileresult) a useSWR style response map #### Defined in things.ts:276 ___ ### useProfile ▸ **useProfile**(`webId`, `options?`): [`ProfileResult`](index.html#profileresult) Retrieve and manage the profile document identified by `webId` #### Parameters | Name | Type | Description | | :------ | :------ | :------ | | `webId` | [`SwrlitKey`](index.html#swrlitkey) | the URL of a Solid profile document | | `options` | [`SwrlitConfigInterface`](index.html#swrlitconfiginterface) | Optional parameter `options.fetch`: An alternative `fetch` function to make the HTTP request, compatible with the browser-native [fetch API](https://developer.mozilla.org/en-US/docs/Web/API/WindowOrWorkerGlobalScope/fetch#Parameters). | #### Returns [`ProfileResult`](index.html#profileresult) a useSWR style response map #### Defined in things.ts:246 ___ ### useResource ▸ **useResource**(`url`, `options?`): [`ResourceResult`](index.html#resourceresult) Retrieve and manage the SolidDataset identified by `url` #### Parameters | Name | Type | Description | | :------ | :------ | :------ | | `url` | [`SwrlitKey`](index.html#swrlitkey) | - | | `options` | [`SwrlitConfigInterface`](index.html#swrlitconfiginterface) | Optional parameter `options.fetch`: An alternative `fetch` function to make the HTTP request, compatible with the browser-native [fetch API](https://developer.mozilla.org/en-US/docs/Web/API/WindowOrWorkerGlobalScope/fetch#Parameters). | #### Returns [`ResourceResult`](index.html#resourceresult) a useSWR style response map #### Defined in things.ts:137 ___ ### useStorageContainer ▸ **useStorageContainer**(`webId`, `options?`): ``null`` \| `string` Retrieve and manage the storage container from the profile document identified by `webId` #### Parameters | Name | Type | Description | | :------ | :------ | :------ | | `webId` | [`SwrlitKey`](index.html#swrlitkey) | the URL of a Solid profile document | | `options` | [`SwrlitConfigInterface`](index.html#swrlitconfiginterface) | Optional parameter `options.fetch`: An alternative `fetch` function to make the HTTP request, compatible with the browser-native [fetch API](https://developer.mozilla.org/en-US/docs/Web/API/WindowOrWorkerGlobalScope/fetch#Parameters). | #### Returns ``null`` \| `string` a useSWR style response map #### Defined in things.ts:262 ___ ### useSwrld ▸ **useSwrld**(`url`, `options?`): [`SwrldResult`](index.html#swrldresult) Retrieve and manage the entity identified by `url` This function wraps `useSWR` and return its result. It will automatically use authentication from a swrlit AuthenticationContext and strips hash fragments from the URL to avoid duplicative caching of Resources. #### Parameters | Name | Type | Description | | :------ | :------ | :------ | | `url` | [`SwrlitKey`](index.html#swrlitkey) | the URL of a file | | `options` | [`SwrlitConfigInterface`](index.html#swrlitconfiginterface) | Optional parameter `options.fetch`: An alternative `fetch` function to make the HTTP request, compatible with the browser-native [fetch API](https://developer.mozilla.org/en-US/docs/Web/API/WindowOrWorkerGlobalScope/fetch#Parameters). | #### Returns [`SwrldResult`](index.html#swrldresult) a useSWR style response map #### Defined in things.ts:66 ___ ### useThing ▸ **useThing**(`url`, `options?`): [`ThingResult`](index.html#thingresult) Retrieve and manage the Thing identified by `url` #### Parameters | Name | Type | Description | | :------ | :------ | :------ | | `url` | [`SwrlitKey`](index.html#swrlitkey) | - | | `options` | [`SwrlitConfigInterface`](index.html#swrlitconfiginterface) | Optional parameter `options.fetch`: An alternative `fetch` function to make the HTTP request, compatible with the browser-native [fetch API](https://developer.mozilla.org/en-US/docs/Web/API/WindowOrWorkerGlobalScope/fetch#Parameters). | #### Returns [`ThingResult`](index.html#thingresult) a useSWR style response map #### Defined in things.ts:171 ___ ### useThingInResource ▸ **useThingInResource**(`thingUri`, `resourceUri`, `options?`): [`ThingResult`](index.html#thingresult) Retrieve the and manage the Thing identified by `thingUri` stored in resource identified by `resourceUri` #### Parameters | Name | Type | Description | | :------ | :------ | :------ | | `thingUri` | [`SwrlitKey`](index.html#swrlitkey) | the URL of a Thing in a Solid Resource | | `resourceUri` | [`SwrlitKey`](index.html#swrlitkey) | the URL of a Solid Resource | | `options` | [`SwrlitConfigInterface`](index.html#swrlitconfiginterface) | Optional parameter `options.fetch`: An alternative `fetch` function to make the HTTP request, compatible with the browser-native [fetch API](https://developer.mozilla.org/en-US/docs/Web/API/WindowOrWorkerGlobalScope/fetch#Parameters). | #### Returns [`ThingResult`](index.html#thingresult) a useSWR style response map #### Defined in things.ts:186