1 | # Installation
|
2 | > `npm install --save @types/angular-cookies`
|
3 |
|
4 | # Summary
|
5 | This package contains type definitions for angular-cookies (http://angularjs.org).
|
6 |
|
7 | # Details
|
8 | Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/angular-cookies.
|
9 | ## [index.d.ts](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/angular-cookies/index.d.ts)
|
10 | ````ts
|
11 | declare var _: string;
|
12 | export = _;
|
13 |
|
14 | import * as angular from "angular";
|
15 |
|
16 | declare module "angular" {
|
17 | /**
|
18 | * ngCookies module (angular-cookies.js)
|
19 | */
|
20 | namespace cookies {
|
21 | /**
|
22 | * CookiesProvider
|
23 | * see https://docs.angularjs.org/api/ngCookies/provider/$cookiesProvider
|
24 | */
|
25 | interface ICookiesProvider {
|
26 | /**
|
27 | * Object containing default options to pass when setting cookies.
|
28 | */
|
29 | defaults: ICookiesOptions;
|
30 | }
|
31 |
|
32 | /**
|
33 | * Cookies options
|
34 | * see https://docs.angularjs.org/api/ngCookies/provider/$cookiesProvider#defaults
|
35 | */
|
36 | interface ICookiesOptions {
|
37 | /**
|
38 | * The cookie will be available only for this path and its sub-paths.
|
39 | * By default, this would be the URL that appears in your base tag.
|
40 | */
|
41 | path?: string | undefined;
|
42 | /**
|
43 | * The cookie will be available only for this domain and its sub-domains.
|
44 | * For obvious security reasons the user agent will not accept the cookie if the
|
45 | * current domain is not a sub domain or equals to the requested domain.
|
46 | */
|
47 | domain?: string | undefined;
|
48 | /**
|
49 | * String of the form "Wdy, DD Mon YYYY HH:MM:SS GMT" or a Date object
|
50 | * indicating the exact date/time this cookie will expire.
|
51 | */
|
52 | expires?: string | Date | undefined;
|
53 | /**
|
54 | * The cookie will be available only in secured connection.
|
55 | */
|
56 | secure?: boolean | undefined;
|
57 | /**
|
58 | * Prevents the browser from sending the cookie along with cross-site requests.
|
59 | * Accepts the values "lax" and "strict".
|
60 | */
|
61 | samesite?: string | undefined;
|
62 | }
|
63 |
|
64 | /**
|
65 | * CookiesService
|
66 | * see https://docs.angularjs.org/api/ngCookies/service/$cookies
|
67 | */
|
68 | interface ICookiesService {
|
69 | get(key: string): string;
|
70 | getObject(key: string): any;
|
71 | getObject<T>(key: string): T;
|
72 | getAll(): any;
|
73 | put(key: string, value: string, options?: ICookiesOptions): void;
|
74 | putObject(key: string, value: any, options?: ICookiesOptions): void;
|
75 | remove(key: string, options?: ICookiesOptions): void;
|
76 | }
|
77 | }
|
78 | }
|
79 |
|
80 | ````
|
81 |
|
82 | ### Additional Details
|
83 | * Last updated: Mon, 06 Nov 2023 22:41:04 GMT
|
84 | * Dependencies: [@types/angular](https://npmjs.com/package/@types/angular)
|
85 |
|
86 | # Credits
|
87 | These definitions were written by [Diego Vilar](https://github.com/diegovilar), and [Anthony Ciccarello](https://github.com/aciccarello).
|
88 |
|
\ | No newline at end of file |