Skip to content

Commit

Permalink
Replace derived CreateCookieOptions with explicit type
Browse files Browse the repository at this point in the history
  • Loading branch information
colincasey committed Apr 22, 2024
1 parent 55387ef commit 20f629c
Show file tree
Hide file tree
Showing 12 changed files with 512 additions and 20 deletions.
2 changes: 1 addition & 1 deletion api/docs/tough-cookie.cookie._constructor_.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ options

</td><td>

CreateCookieOptions
[CreateCookieOptions](./tough-cookie.createcookieoptions.md)


</td><td>
Expand Down
2 changes: 1 addition & 1 deletion api/docs/tough-cookie.cookie.parse.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ options

</td><td>

ParseCookieOptions
[ParseCookieOptions](./tough-cookie.parsecookieoptions.md)


</td><td>
Expand Down
2 changes: 1 addition & 1 deletion api/docs/tough-cookie.cookie.tojson.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ toJSON(): SerializedCookie;
```
**Returns:**

SerializedCookie
[SerializedCookie](./tough-cookie.serializedcookie.md)

## Remarks

Expand Down
306 changes: 306 additions & 0 deletions api/docs/tough-cookie.createcookieoptions.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,306 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [tough-cookie](./tough-cookie.md) &gt; [CreateCookieOptions](./tough-cookie.createcookieoptions.md)

## CreateCookieOptions interface

Configurable values that can be set when creating a [Cookie](./tough-cookie.cookie.md)<!-- -->.

**Signature:**

```typescript
export interface CreateCookieOptions
```

## Properties

<table><thead><tr><th>

Property


</th><th>

Modifiers


</th><th>

Type


</th><th>

Description


</th></tr></thead>
<tbody><tr><td>

[creation?](./tough-cookie.createcookieoptions.creation.md)


</td><td>


</td><td>

Date \| 'Infinity' \| null


</td><td>

_(Optional)_ Set to the date and time when a Cookie is initially stored or a matching cookie is received that replaces an existing cookie (See [RFC6265 Section 5.3](https://www.rfc-editor.org/rfc/rfc6265.html#section-5.3)<!-- -->).

Also used to maintain ordering among cookies. Among cookies that have equal-length path fields, cookies with earlier creation-times are listed before cookies with later creation-times (See [RFC6265 Section 5.4](https://www.rfc-editor.org/rfc/rfc6265.html#section-5.4)<!-- -->).


</td></tr>
<tr><td>

[domain?](./tough-cookie.createcookieoptions.domain.md)


</td><td>


</td><td>

string \| null


</td><td>

_(Optional)_ The 'Domain' attribute of the cookie represents the domain the cookie belongs to (See [RFC6265 Section 5.2.3](https://www.rfc-editor.org/rfc/rfc6265.html#section-5.2.3)<!-- -->).


</td></tr>
<tr><td>

[expires?](./tough-cookie.createcookieoptions.expires.md)


</td><td>


</td><td>

Date \| 'Infinity' \| null


</td><td>

_(Optional)_ The 'Expires' attribute of the cookie (See [RFC6265 Section 5.2.1](https://www.rfc-editor.org/rfc/rfc6265.html#section-5.2.1)<!-- -->).


</td></tr>
<tr><td>

[extensions?](./tough-cookie.createcookieoptions.extensions.md)


</td><td>


</td><td>

string\[\] \| null


</td><td>

_(Optional)_ Contains attributes which are not part of the defined spec but match the `extension-av` syntax defined in Section 4.1.1 of RFC6265 (See [RFC6265 Section 4.1.1](https://www.rfc-editor.org/rfc/rfc6265.html#section-4.1.1)<!-- -->).


</td></tr>
<tr><td>

[hostOnly?](./tough-cookie.createcookieoptions.hostonly.md)


</td><td>


</td><td>

boolean \| null


</td><td>

_(Optional)_ A boolean flag indicating if a cookie is a host-only cookie (i.e.; when the request's host exactly matches the domain of the cookie) or not (See [RFC6265 Section 5.3](https://www.rfc-editor.org/rfc/rfc6265.html#section-5.3)<!-- -->).


</td></tr>
<tr><td>

[httpOnly?](./tough-cookie.createcookieoptions.httponly.md)


</td><td>


</td><td>

boolean


</td><td>

_(Optional)_ The 'HttpOnly' flag of the cookie indicates if the cookie is inaccessible to client scripts or not (See [RFC6265 Section 5.2.6](https://www.rfc-editor.org/rfc/rfc6265.html#section-5.2.6)<!-- -->).


</td></tr>
<tr><td>

[key?](./tough-cookie.createcookieoptions.key.md)


</td><td>


</td><td>

string


</td><td>

_(Optional)_ The name or key of the cookie


</td></tr>
<tr><td>

[lastAccessed?](./tough-cookie.createcookieoptions.lastaccessed.md)


</td><td>


</td><td>

Date \| 'Infinity' \| null


</td><td>

_(Optional)_ Set to the date and time when a cookie was initially stored ([RFC6265 Section 5.3](https://www.rfc-editor.org/rfc/rfc6265.html#section-5.3)<!-- -->) and updated whenever the cookie is retrieved from the [CookieJar](./tough-cookie.cookiejar.md) ([RFC6265 Section 5.4](https://www.rfc-editor.org/rfc/rfc6265.html#section-5.4)<!-- -->).


</td></tr>
<tr><td>

[maxAge?](./tough-cookie.createcookieoptions.maxage.md)


</td><td>


</td><td>

number \| 'Infinity' \| '-Infinity' \| null


</td><td>

_(Optional)_ The 'Max-Age' attribute of the cookie (See [RFC6265 Section 5.2.2](https://www.rfc-editor.org/rfc/rfc6265.html#section-5.2.2)<!-- -->).


</td></tr>
<tr><td>

[path?](./tough-cookie.createcookieoptions.path.md)


</td><td>


</td><td>

string \| null


</td><td>

_(Optional)_ The 'Path' attribute of the cookie represents the path of the cookie (See [RFC6265 Section 5.2.4](https://www.rfc-editor.org/rfc/rfc6265.html#section-5.2.4)<!-- -->).


</td></tr>
<tr><td>

[pathIsDefault?](./tough-cookie.createcookieoptions.pathisdefault.md)


</td><td>


</td><td>

boolean \| null


</td><td>

_(Optional)_ A boolean flag indicating if a cookie had no 'Path' attribute and the default path was used (See [RFC6265 Section 5.2.4](https://www.rfc-editor.org/rfc/rfc6265.html#section-5.2.4)<!-- -->).


</td></tr>
<tr><td>

[sameSite?](./tough-cookie.createcookieoptions.samesite.md)


</td><td>


</td><td>

string \| undefined


</td><td>

_(Optional)_ The 'SameSite' attribute of a cookie as defined in RFC6265bis (See [RFC6265bis (v13) Section 5.2](https://www.ietf.org/archive/id/draft-ietf-httpbis-rfc6265bis-13.html#section-5.2)<!-- -->).


</td></tr>
<tr><td>

[secure?](./tough-cookie.createcookieoptions.secure.md)


</td><td>


</td><td>

boolean


</td><td>

_(Optional)_ The 'Secure' flag of the cookie indicates if the scope of the cookie is limited to secure channels (e.g.; HTTPS) or not (See [RFC6265 Section 5.2.5](https://www.rfc-editor.org/rfc/rfc6265.html#section-5.2.5)<!-- -->).


</td></tr>
<tr><td>

[value?](./tough-cookie.createcookieoptions.value.md)


</td><td>


</td><td>

string


</td><td>

_(Optional)_ The value of the cookie


</td></tr>
</tbody></table>
Loading

0 comments on commit 20f629c

Please sign in to comment.