UNPKG

2.43 kBTypeScriptView Raw
1declare var _: string;
2export = _;
3
4import * as angular from "angular";
5
6declare module "angular" {
7 /**
8 * ngCookies module (angular-cookies.js)
9 */
10 namespace cookies {
11 /**
12 * CookiesProvider
13 * see https://docs.angularjs.org/api/ngCookies/provider/$cookiesProvider
14 */
15 interface ICookiesProvider {
16 /**
17 * Object containing default options to pass when setting cookies.
18 */
19 defaults: ICookiesOptions;
20 }
21
22 /**
23 * Cookies options
24 * see https://docs.angularjs.org/api/ngCookies/provider/$cookiesProvider#defaults
25 */
26 interface ICookiesOptions {
27 /**
28 * The cookie will be available only for this path and its sub-paths.
29 * By default, this would be the URL that appears in your base tag.
30 */
31 path?: string | undefined;
32 /**
33 * The cookie will be available only for this domain and its sub-domains.
34 * For obvious security reasons the user agent will not accept the cookie if the
35 * current domain is not a sub domain or equals to the requested domain.
36 */
37 domain?: string | undefined;
38 /**
39 * String of the form "Wdy, DD Mon YYYY HH:MM:SS GMT" or a Date object
40 * indicating the exact date/time this cookie will expire.
41 */
42 expires?: string | Date | undefined;
43 /**
44 * The cookie will be available only in secured connection.
45 */
46 secure?: boolean | undefined;
47 /**
48 * Prevents the browser from sending the cookie along with cross-site requests.
49 * Accepts the values "lax" and "strict".
50 */
51 samesite?: string | undefined;
52 }
53
54 /**
55 * CookiesService
56 * see https://docs.angularjs.org/api/ngCookies/service/$cookies
57 */
58 interface ICookiesService {
59 get(key: string): string;
60 getObject(key: string): any;
61 getObject<T>(key: string): T;
62 getAll(): any;
63 put(key: string, value: string, options?: ICookiesOptions): void;
64 putObject(key: string, value: any, options?: ICookiesOptions): void;
65 remove(key: string, options?: ICookiesOptions): void;
66 }
67 }
68}