Skip to content

Commit

Permalink
Merge branch 'main' of github.com:ionic-team/capacitor-docs
Browse files Browse the repository at this point in the history
# Conflicts:
#	docs/main/getting-started/environment-setup.md
#	docs/main/updating/5-0.md
#	docs/main/updating/6-0.md
#	docs/main/updating/plugins/5-0.md
  • Loading branch information
rdlabo committed Apr 16, 2024
2 parents efbb46a + 9d5ba9c commit 14708c4
Show file tree
Hide file tree
Showing 23 changed files with 1,021 additions and 83 deletions.
114 changes: 90 additions & 24 deletions docs/apis/cookies.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
---
title: Capacitor Cookies Plugin API
title: Cookies Capacitor Plugin API
description: The Capacitor Cookies API provides native cookie support via patching `document.cookie` to use native libraries.
editUrl: https://github.com/ionic-team/capacitor/blob/main/core/cookies.md
editApiUrl: https://github.com/ionic-team/capacitor/blob/main/core/src/core-plugins.ts
sidebar_label: Cookies
---

Expand Down Expand Up @@ -103,14 +105,33 @@ As of iOS 14, you cannot use 3rd party cookies by default. Add the following lin

<docgen-index>

- [`setCookie(...)`](#setcookie)
- [`deleteCookie(...)`](#deletecookie)
- [`clearCookies(...)`](#clearcookies)
- [`clearAllCookies()`](#clearallcookies)
* [`getCookies(...)`](#getcookies)
* [`setCookie(...)`](#setcookie)
* [`deleteCookie(...)`](#deletecookie)
* [`clearCookies(...)`](#clearcookies)
* [`clearAllCookies()`](#clearallcookies)
* [Interfaces](#interfaces)
* [Type Aliases](#type-aliases)

</docgen-index>

<docgen-api>
<!--Update the source file JSDoc comments and rerun docgen to update the docs below-->

### getCookies(...)

```typescript
getCookies(options?: GetCookieOptions) => Promise<HttpCookieMap>
```

| Param | Type |
| ------------- | ------------------------------------------------------------- |
| **`options`** | <code><a href="#getcookieoptions">GetCookieOptions</a></code> |

**Returns:** <code>Promise&lt;<a href="#httpcookiemap">HttpCookieMap</a>&gt;</code>

--------------------


### setCookie(...)

Expand All @@ -124,7 +145,8 @@ Write a cookie to the device.
| ------------- | ------------------------------------------------------------- |
| **`options`** | <code><a href="#setcookieoptions">SetCookieOptions</a></code> |

---
--------------------


### deleteCookie(...)

Expand All @@ -138,7 +160,8 @@ Delete a cookie from the device.
| ------------- | ------------------------------------------------------------------- |
| **`options`** | <code><a href="#deletecookieoptions">DeleteCookieOptions</a></code> |

---
--------------------


### clearCookies(...)

Expand All @@ -152,7 +175,8 @@ Clear cookies from the device at a given URL.
| ------------- | ----------------------------------------------------------------- |
| **`options`** | <code><a href="#clearcookieoptions">ClearCookieOptions</a></code> |

---
--------------------


### clearAllCookies()

Expand All @@ -162,31 +186,73 @@ clearAllCookies() => Promise<void>

Clear all cookies on the device.

---
--------------------


### Interfaces


#### HttpCookieMap


#### HttpCookie

| Prop | Type | Description |
| ----------- | ------------------- | ------------------------ |
| **`url`** | <code>string</code> | The URL of the cookie. |
| **`key`** | <code>string</code> | The key of the cookie. |
| **`value`** | <code>string</code> | The value of the cookie. |


#### HttpCookieExtras

| Prop | Type | Description |
| ------------- | ------------------- | -------------------------------- |
| **`path`** | <code>string</code> | The path to write the cookie to. |
| **`expires`** | <code>string</code> | The date to expire the cookie. |


### Type Aliases


#### GetCookieOptions

<code><a href="#omit">Omit</a>&lt;<a href="#httpcookie">HttpCookie</a>, 'key' | 'value'&gt;</code>


#### Omit

Construct a type with the properties of T except for those in type K.

<code><a href="#pick">Pick</a>&lt;T, <a href="#exclude">Exclude</a>&lt;keyof T, K&gt;&gt;</code>


#### Pick

From T, pick a set of properties whose keys are in the union K

<code>{ [P in K]: T[P]; }</code>


#### Exclude

<a href="#exclude">Exclude</a> from T those types that are assignable to U

<code>T extends U ? never : T</code>


#### SetCookieOptions

| Prop | Type | Description |
| -------------- | ------------------- | -------------------------------- |
| **`url?`** | <code>string</code> | The URL to write the cookie to. |
| **`key`** | <code>string</code> | The key to give the cookie. |
| **`value`** | <code>string</code> | The value to give the cookie. |
| **`path?`** | <code>string</code> | The path to write the cookie to. |
| **`expires?`** | <code>string</code> | The date to expire the cookie. |
<code><a href="#httpcookie">HttpCookie</a> & <a href="#httpcookieextras">HttpCookieExtras</a></code>


#### DeleteCookieOptions

| Prop | Type | Description |
| ---------- | ------------------- | ---------------------------------- |
| **`url?`** | <code>string</code> | The URL to delete the cookie from. |
| **`key`** | <code>string</code> | The key of the cookie to delete. |
<code><a href="#omit">Omit</a>&lt;<a href="#httpcookie">HttpCookie</a>, 'value'&gt;</code>


#### ClearCookieOptions

| Prop | Type | Description |
| ---------- | ------------------- | ------------------------------ |
| **`url?`** | <code>string</code> | The URL to clear cookies from. |
<code><a href="#omit">Omit</a>&lt;<a href="#httpcookie">HttpCookie</a>, 'key' | 'value'&gt;</code>

</docgen-api>
</docgen-api>
Expand Down
Loading

0 comments on commit 14708c4

Please sign in to comment.